Commit Graph

25468 Commits

Author SHA1 Message Date
Kornel Benko
9ee515c984 Amend 154b4fde 2018-12-26 17:45:34 +01:00
Juergen Spitzmueller
9495ff665d Make "paste recent" accessible from toolbar
via button menu
2018-12-26 17:11:24 +01:00
Juergen Spitzmueller
154b4fdece Give textstyle-apply a history
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)

Fixes: #7133

This also changes the default icon and toolbar position of the action,
as requested in #11427
2018-12-26 15:46:14 +01:00
Juergen Spitzmueller
057d83d8ae Handle null pointer 2018-12-26 14:38:02 +01:00
Juergen Spitzmueller
0492239be0 Fix qt4 build 2018-12-25 18:35:52 +01:00
Juergen Spitzmueller
7610179bc7 More alignment fixes 2018-12-25 18:20:02 +01:00
Juergen Spitzmueller
47ecd75d7f Unify group box style across dialogs. 2018-12-25 17:02:18 +01:00
Juergen Spitzmueller
7674a83ce9 Prefs dialog: some layout fixes. 2018-12-24 18:38:23 +01:00
Juergen Spitzmueller
e52bd7bb00 Advanced F&R layout fixed
Patch by Daniel Ramöller (racoon)
2018-12-24 17:02:11 +01:00
Juergen Spitzmueller
5258cee93e Fix height of paragraph dialog
Patch by Daniel Ramöller (racoon)
2018-12-24 16:48:22 +01:00
Juergen Spitzmueller
fa5703196f Fix Text Properties dialog height
Patch by Daniel Ramöller (racoon)
2018-12-24 16:18:54 +01:00
Juergen Spitzmueller
9ee4a914da Tabular Create layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:13:29 +01:00
Juergen Spitzmueller
499871d141 Messages panes layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:08:39 +01:00
Juergen Spitzmueller
30d527895e Layout fixes for compare dialog
Based on a patch by racoon.
2018-12-24 16:00:43 +01:00
Juergen Spitzmueller
4c7b3fc109 Theasurus dialog layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:24:03 +01:00
Juergen Spitzmueller
5936edfe24 Spellchecker dialog alignment fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:16:28 +01:00
Juergen Spitzmueller
d2527038a3 Polishment of the simple Search dialog
Based on a patch by racoon.
2018-12-24 14:47:48 +01:00
Juergen Spitzmueller
4d51206585 When cancelling saving of a children, cancel the whole process.
Fixes remainder of #11405
2018-12-24 13:02:41 +01:00
Juergen Spitzmueller
4f67cf2344 Fix prefs color layout
the list widget is too narrow with some localizations.
2018-12-23 12:08:54 +01:00
Juergen Spitzmueller
81e4f8dfb6 Allow to restore default UI colors in prefs
Patch by Daniel Ramöller (racoon), with slight modifications of mine.

Fixes: #10062
2018-12-22 18:44:58 +01:00
Jean-Marc Lasgouttes
dff0c5729e Make DEPM respect current cursor position.
Spaces are now conserved when they surround current cursor. Examples:
  abc   |   def
becomes
  abc | def
after DEPM and
  abc |
is kept as it is.

Fixes ticket #11412.
2018-12-21 15:40:03 +01:00
Juergen Spitzmueller
7c31bfa423 Compile fix for Qt < 5.7
Only after that version, the QAction argument is optional.
2018-12-21 13:37:07 +01:00
Juergen Spitzmueller
4ea64ca89a GuiThesaurus: maintain default state of Replace button
Rest of #11417
2018-12-21 12:56:02 +01:00
Juergen Spitzmueller
ac8aac5b36 GuiCharacter: Add menu to Restore button
and allow for resetting all widgets to "No Change" besides "Default"
2018-12-21 12:31:25 +01:00
Juergen Spitzmueller
e6b562d027 Rename ambiguous enum 2018-12-21 12:14:11 +01:00
Juergen Spitzmueller
7fae26c9a7 Handle GuiParagraph for OK default button issue as well 2018-12-20 15:12:53 +01:00
Juergen Spitzmueller
44a0748ba3 Add forgotten initialization 2018-12-20 13:46:41 +01:00
Juergen Spitzmueller
e087722900 Maintain default status for all dialogs using ButtonController
Should fix rest of #11417
2018-12-20 12:56:30 +01:00
Juergen Spitzmueller
33344c6015 Also check for dirty children on QUIT
Fixes rest of #11405
2018-12-20 11:37:19 +01:00
Pavel Sanda
99bfe20120 Properly clean cache which binds inset and dialog.
We fill up edited insets into cache when editing inset is triggered, but
this cache is never cleared up for dialogs unassociated with some inset
- thus when e.g. graphics dialog is open for completely new image the
old cache is (wrongly) used.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207192.html
2018-12-19 21:31:26 +01:00
Juergen Spitzmueller
af5909beac Maintain default status for InsetParams dialogs
Part of #11417
2018-12-19 11:39:04 +01:00
Juergen Spitzmueller
6dce63496d Maintain default status for ref dialog
Part of #11417
2018-12-19 11:09:32 +01:00
Enrico Forestieri
2dcb730026 Fix bug 11346
Enclose in braces an optional argument of a math macro when it
starts with an incomplete script inset or ends with a delimiter
size-modifier macro.
2018-12-18 11:39:21 +01:00
Kornel Benko
187b518648 FindAdv: to please cppcheck ...
Initialize class elements
Removed unused method
Added 'explicit' keyword
Optimize handling for sizes ( \tiny, \small, etc)
2018-12-18 06:53:58 +01:00
Jean-Marc Lasgouttes
058c6750ac Fix embarrassing typo
Not clear whether this caused any bug.
2018-12-17 15:33:47 +01:00
Juergen Spitzmueller
6d4a63d86b Add Qt-internal GUI string 2018-12-17 13:39:45 +01:00
Juergen Spitzmueller
5f03889609 GuiCharacter: Add "Reset" and "Restore Defaults" buttons
Addresses #11415
2018-12-17 12:59:40 +01:00
Juergen Spitzmueller
1b6ce0e827 GuiCharacter: INHERIT is OFF for the tristate buttons. 2018-12-17 10:38:05 +01:00
Kornel Benko
a1a7c21871 FindAdv: Amend 4276e1b0 2018-12-17 10:33:23 +01:00
Juergen Spitzmueller
bf2bf2eaed GuiCharacter: Consider default settings for underline, strikeout and language 2018-12-17 10:12:02 +01:00
Juergen Spitzmueller
f87218bbb5 Check for hidden dirty child on close
Fixes: #11405
2018-12-17 09:11:34 +01:00
Juergen Spitzmueller
ab5c08b3f0 Amend 9705b88251 2018-12-17 09:03:46 +01:00
Kornel Benko
4276e1b01e FindAdv: Handle also sizes of characters 2018-12-16 14:50:38 +01:00
Juergen Spitzmueller
a48f28dc19 Improve comment. 2018-12-16 12:30:48 +01:00
Juergen Spitzmueller
9705b88251 Use current_font, not real_current_font, in character dialog
The latter has the workarea font settings, which are not of interest
here.

Fixes: #11385
2018-12-16 12:29:15 +01:00
Kornel Benko
2682170556 FindAdv: Comments 2018-12-14 19:51:24 +01:00
Richard Kimberly Heck
f3558213e1 Comment. 2018-12-14 10:58:13 -05:00
Richard Kimberly Heck
577746ad92 Fix slowness problem on Windows reported on the list.
https://marc.info/?l=lyx-devel&m=154458979925296&w=2

This is related to the fix for #9158 and the caching of bibfile
information. On Windows, it is incredibly slow to run kpsewhich,
which we do to check where files actually are, so as to get info
about them (e.g., timestamps). So we have started to cache that
as a map. The map is supposed to be invalidated when various
things happen, but an oversight was causing it to be invalidated
on every cut operation. This is because cutting uses a temporary
Buffer, and the operations on it were affecting the *global* cache
of biblio file info. (It makes sense to have a global cache, since
these files are not document-specific.) Basically, we have to update
the list of bibfiles in that temporary Buffer---but that is one of
the things that invalidated the cache. The solution is only to
invalidate the cache if the list of bibfiles has actually changed
(a sensible idea anyway). The only time that will happen in the
temporary Buffer is when the copied information contains a BibTeX
inset. That should be fairly rare.
2018-12-14 10:55:16 -05:00
Enrico Forestieri
4c9df62c6c Fix bug #9622
The backslash is the escape character used in our parser. Hence,
when used as a path separator on Windows, it has to be itself
escaped or the path enclosed in either double or single quotes.
Windows users are maybe trained to quote paths containing spaces
but not paths with backslashes. So, we automatically escape the
backslashes when they are not already enclosed in quotes.
2018-12-14 11:41:16 +01:00
Enrico Forestieri
95bc273a59 Fix display of single-char macro names
Essentially, all characters are allowed in single-char macro names.

Part of #11158.
2018-12-13 19:41:56 +01:00
Kornel Benko
358626b735 FindAdv: Add handling spaces, dots, quotes ...
Treate spaces, dots and quotes as ordinary characters
Also discard length values for hspace,vspace and mspace
2018-12-13 17:12:57 +01:00
Jean-Marc Lasgouttes
2ec25c8eef Set buffer correctly when changing math space type.
Fixes bug #7747.
2018-12-13 10:27:20 +01:00
Kornel Benko
8a29bdb3d1 FindAdv: Added code, href, url and footnote to handled search formats
Remark: Inside code{} and footnote{} are the language settings ignored.
2018-12-11 17:27:50 +01:00
Pavel Sanda
9547e0b765 typo 2018-12-08 00:04:04 +01:00
Pavel Sanda
04fe818b22 Keep permissions of the saved files intact.
Previously the permission were destroyed by the newly created
temporary file -- which is later used as new saved file.
Tested on symlinks as well but only on Linux.
2018-12-07 23:10:46 +01:00
Kornel Benko
32c6724fd6 FindAdv: Amend cd941804
Revert changes in Paragraph.cpp
2018-12-06 14:20:43 +01:00
Enrico Forestieri
976e0b7993 Amend bd21aa9
Check whether a line is actually blank rather than whether
we are at the beginning of a line.
2018-12-06 10:30:58 +01:00
Kornel Benko
cd94180492 FindAdv: Simplify search for chars '&', '%', '#' and '_'
This is not possible for '$', because of the latex-meaning to
start/end math inset.
Therefore, if not ignoring format, we still have to use
[\\][\$] in regex in order to find '$' in text.
2018-12-05 13:36:43 +01:00
Guillaume MM
131f4b92ba Fix segfault after deleting monitor
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.

The solution is to make the boost signal asynchronous using the Qt event loop.

Thanks to Scott Kostyshak for the report and MWE.
2018-12-04 00:05:01 -05:00
Enrico Forestieri
bd21aa99d2 Fix bug #11398
When deciding how to strike out deleted math in change-tracking
mode, differentiate only on begin-of-line or not, and not on
after-paragraph-break or not.

The assumption that a new paragraph is always started after a
float seems to be not true and was causing this bug.
2018-12-02 18:27:38 +01:00
Pavel Sanda
1047754228 Update after buffer-anonymize in branch.
This is not strictly necessary in master (compared to 2.3.x),
but JMarc wanted it anyway.
2018-12-02 02:24:04 +01:00
Kornel Benko
de4ca7b742 FindAdv: Use plain text as value for \index{}
If we are in search mode, there is no need for
any special handling.
2018-11-29 11:57:11 +01:00
Kornel Benko
1cd80ff6c8 FindAdv: Eliminate a corner case in the binary search
Given the regex 'r.*r\b' and a string
"abc regular something cursor currently"
we expect to find "regular something cursor".
But while searching we may be confronted with input
"regular something cursor curr"
and so the searched string would be seen longer.
2018-11-27 19:10:27 +01:00
Kornel Benko
8549fbb326 FindAdv: Avoid crash finding char at end of inset
Testcase without this patch:
1.) open de/Additional.lyx
2.) goto 6.1 Astronomy & Astrophysics
3.) open the index
4.) find advaced
	a.) not ignoring format
	b.) regex = .+
	c.) language of regex: English
	4.) search next
The seach finds the next break (which is outside of the index)
The following try to display the selection leads to crash
2018-11-26 12:37:18 +01:00
Kornel Benko
578a4b6fb0 find: This change was not intended, amend e96a9d6329 2018-11-25 18:25:14 +01:00
Kornel Benko
e96a9d6329 Find: Use greedy behaviour
This change is valid for findadv too.
Patterns like '.*' now are greedy, like it is normal in regex
Searching for whole words is corrected, but can be slow.
One can speed up the search with adapted pattern.
So for instance searching for words starting and ending with 'r'
the normal pattern is 'r.*r'. The speed-up pattern could be
'\br[^\s]*r\b'. This halves the search time.

Search results are now different to that of lyx2.3, because the greedy
'.*' is now really greedy.
To achive the same results, we have to use '.*?' instead.
2018-11-25 17:51:20 +01:00
Jean-Marc Lasgouttes
e2a3dd1167 Fix compilation with msvc 2015
Without this, the compiler does not know whether 0 is a size_t or char
const *.
2018-11-24 19:17:31 +01:00
Jean-Marc Lasgouttes
57feb0fed0 Fix undo after breaking a nested paragraph
We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.
2018-11-23 16:53:53 +01:00
Jean-Marc Lasgouttes
2dc84b69d5 Show cursor correctly whn loading file
This is a fixup to 8d8988de4. When a file is loaded and the cursor is
set, it is required to first compute metrics to be able to scroll the
screen correctly.

Fixes bug #11377.
2018-11-22 11:21:07 +01:00
Kornel Benko
e9e3c50c65 FindAdv: Optimization
A try to decrement the number of tests for a match.

Also a try to handle Hebrew documents. Unfortunatelly
the latex output is missing the language specification
(only the change of encoding is available there).
I failed to find a proper place to add the lang.
That means, searching for e.g. English text in Hebrew documents
is not satisfying.
2018-11-20 14:36:11 +01:00
Kornel Benko
17ee4cafb1 FindAdv: Enable search for different languages in Korean documents too
The problem here was that for european languages only the encoding
was visible in latex output. Now also the language is provided.
2018-11-18 10:40:42 +01:00
Enrico Forestieri
7822d11361 Fix reloading of local layout file (bug #11120) 2018-11-16 21:47:24 +01:00
Kornel Benko
0964ffb266 FindAdv: Remove left over comment character
Sometimes language spec starts with "% ". This happens in Japaneese documents
containig English text at start of paragraph.
2018-11-16 12:12:06 +01:00
Kornel Benko
06c05430d9 FindAdv: Added lyx-function search-ignore
Enable/disable ignoring the specified type
	language: e.g. british, slovak, latin, ...
	color:	blue, red, ...
	sectioning: part, chapter, ..
	font:
		series: bold, ...
		shape: upright, italic, slanted
		family: serif, monospace ...
	markup: enphasize, noun
	underline:
	strike:

Examples:
	search-ignore language true
	search-ignore shape true
2018-11-15 14:20:50 +01:00
Kornel Benko
702c495e98 FindAdv: Significantly increase the search speed
The needed time to find a simple string dependes on the
paragraph length was O(n^2)
Now it is down to O(n).
Before:
	To determine if the pattern matches we compared the
	paragraph from current position to the its end.
	Increment current position if no match
Now:
	Check if the character at current position has at least
	the needed features (text, color, language etc)
	If not, Increment current position
	else proceed as before
2018-11-13 12:11:33 +01:00
Enrico Forestieri
1bdba953a5 Fix cursor left/right navigation in overset, underset, and stackrel
Before this commit, navigating with the cursor was visiting either
the nucleus or the script depending on the direction (left or right)
of the cursor movement. Now the 2.3.x behavior of always going through
the nucleus is restored (at least for overset and underset, as stackrel
seems to behave oddly also in 2.3.x).
2018-11-12 19:05:09 +01:00
Kornel Benko
636bb6c2d9 FindAdv: Polishing search with regex containing '.'
Also added missing math env alignat
Modified handling of longtable/tabular
Added a routine to count for valid chars. This is needed
for detection of word boundaries.

Due to detection conflicts
	regex '.*' vs match of word-boundaries in MatchStringAdv::operator()
we need to use '\b' in regex explicitly. E.g. '\b.*\b'

The backward search works, but
1.) only in current paragraph (this is the same as before)
2.) only in the same language environment.
2018-11-12 12:28:31 +01:00
Jean-Marc Lasgouttes
1ff0816a02 Typo 2018-11-12 11:41:54 +01:00
Enrico Forestieri
9c3bbeefab Fix bug #11367
The overset, underset, and stackrel insets behave like the script
rather than the fraction inset.
2018-11-10 15:50:51 +01:00
Enrico Forestieri
77234fecd8 Restore correct left/right navigation in root inset
Now all cells are correctly visited in sequence when moving with
cursor left/right.
2018-11-10 14:55:00 +01:00
Jean-Marc Lasgouttes
93db2bd08e Make cell-forward/backward cycle in math
Make cell-backward put the cursor at the end of cell when using
mac-like cursor movement.
2018-11-09 16:05:09 +00:00
Jean-Marc Lasgouttes
ee9451aaf5 improve left/right navigation in root inset
Now the cursor is correctly set when changing cell with xursor left/right.
2018-11-09 16:05:09 +00:00
Jean-Marc Lasgouttes
7055bb0098 Change IgnoreFormats to a proper class
Instantiate a global variabble holding the formats and allow to modify
it using the helper function setIgnoreFormat.
2018-11-09 16:05:09 +00:00
Kornel Benko
f5d5777a86 FindAdv: Polishing
1.) Added \textmd to be ignored (sometimes it is used and sometimes not)
2.) Typo: multiline --> multline. Searching in 'multline' caused a crash
	because processing all of the '{' and '}' in the content of this math
	exceeded the size of the interval field.
2018-11-09 13:49:05 +01:00
Juergen Spitzmueller
523d284729 missed this. 2018-11-09 11:47:51 +01:00
Juergen Spitzmueller
a5004a394a Fix thinko
Actually use the replaced path string :-/
2018-11-09 11:28:38 +01:00
Kornel Benko
0c05432284 FindAdv: Polishing
1.) Handle some unclosed parentheses
	Sometimes \shortcut is not correctly closed
2.) Added \ldots as known char
3.) Discard some shapes (circlepar, droppar, ...)
4.) Omit resulting empty string and use some value
	which cannot be matched instead
2018-11-08 09:59:51 +01:00
Jean-Marc Lasgouttes
2daf493cbc Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot
Exchanging cells 0 and 1 requires to implement idxBackWard/Forward.
2018-11-07 11:53:00 -10:00
Jean-Marc Lasgouttes
974766cd1c Fixup 097da3a9: update the math parser
One has to account for the change in cell numbering.
2018-11-07 08:29:46 -10:00
Kornel Benko
88428123ea FindAdv: Optimize for long matches
Still, if the matched string is at a rear part of a very long
paragraph, the search is way too slow.
2018-11-07 13:14:50 +01:00
Jean-Marc Lasgouttes
b0937fb93e When inserting math inset over selection, place cursor better
This is a follow up to 503c7c16.

The new argument for placing cursor after insertion of inset is:
* if inset has no cell, do nothing
* otherwise, place inset in entry cell.
  + if entry cell is not empty (we pasted a selection), go to next cell
  + if this next cell does not exit, stay after the inset.
2018-11-06 22:48:53 -10:00
Jean-Marc Lasgouttes
097da3a943 Change cell numbers so that 0 is the main cell
This leads to code simplification in overset, root and underset.
Further simplification is possible.
2018-11-06 22:48:53 -10:00
Kornel Benko
9d304c0a1d FindAdv: Discard table decorations
That way we do not match the whole table but only the cell contents.
The problem I had was
1.) Document language Spanish
2.) Table (copied from English doc) => language English
3.) All cell contents Spanish

Now search for English text led to a selection of the whole
table, although there was no English content in any cell.
2018-11-07 09:35:16 +01:00
Kornel Benko
4f1cd00b02 Findadv: Initialize the position of first unprocessed open parentheses
Not initializing caused some wrong matches.
2018-11-06 15:28:43 +01:00
Kornel Benko
e487274ff4 Findadv: Polishing
1.) Do not remove '{}' unconditionally from \item parameter
2.) Do not output last empty entry
2018-11-05 12:58:45 +01:00
Jean-Marc Lasgouttes
7db99672e6 Avoid extra space in tooltips
When using QTextDocument to check the natutal size of a text, one has
to remove the text margin, which is not useful here.

Fixes bug #11353.
2018-11-04 14:02:42 -10:00
Kornel Benko
70e2f09c4f Findadv: Some glitches found while searching for English text in fr/UserGuide.lyx
Ignore \index
Handle \og and \bg as characters
Remove space in empty list-item (description or labeling)
2018-11-04 21:41:04 +01:00
Kornel Benko
aa68dcefa0 Findadv: 'Optimized' detection of matched string
This is clearly a hack, because I don't understand why the
previous code did not work.
2018-11-04 14:57:40 +01:00
Jean-Marc Lasgouttes
1bed76e2a1 Fix selection of unmarked RtL text
With Qt 5.11 at least, RtL text will be drawn RtL even when the
(undocumented) flag Qt::TextForceLeftToRight is applied to the
QTextLayout object. This creates selection issues for Hebrew text
marked as English.

The solution is to do the same as in breakAt_helper, that is prepend
the string with a direction override unicode character.

Doing this requires to introduce a TEXTLAYOUT_OFFSET constant that has
to be used wisely to account for this extra character.

Fixes bug #11284.
2018-11-04 08:23:49 +00:00
Jean-Marc Lasgouttes
76e99e9a20 Remove old workaround that is not needed anymore
This causes a compilation error with boost 1.69.

Fixes bug #11349.
2018-11-04 08:23:49 +00:00