Commit Graph

25163 Commits

Author SHA1 Message Date
Juergen Spitzmueller
e20389ed6b UI improvement to math matrix dialog, suggested by magistere (#11888) 2020-06-11 17:29:37 +02:00
Jean-Marc Lasgouttes
f01c23bd5a Fixup d207e85c: paint sublabel with the correct background color
The above mentionned patch did paint the background of the sublabel to
avoid "bold-like" effect. However the correct backgound color is the
row's one, not the inset's one.

To fix this, extend MetricsInfo::backgroundColor to work when no inset
is specified. The code is also simplified as in master.

(cherry picked from commit 74540c9896)
(cherry picked from commit a71b96ac42)
2020-06-07 14:25:48 +02:00
Richard Kimberly Heck
774bbbe1b6 Fix bug #11405.
We don't actually prevent hidden buffers from being dirty, so we need
to save them if they are.

(cherry picked from commit b2517d60b8)
2020-06-05 15:48:44 -04:00
Richard Kimberly Heck
a355cd82c2 Fix bug #10316.
By sending the request through the usual dispatch machinery, we
make sure the cursor is valid when we're done.

(cherry picked from commit e5b6be0712)
2020-06-05 15:45:07 -04:00
Jean-Marc Lasgouttes
0fde27465d Fix first draw of auto-open inset
note-next and reference-next should trigger an update so that metrics
are updated when the cursor ends up in an auto-open inset.

Fixes bug #11870.

(cherry picked from commit 7761e1317e)
2020-06-05 15:40:44 -04:00
Richard Kimberly Heck
092bc93903 Update lyx-build script and add header file for Windows. 2020-06-01 16:10:47 -04:00
Richard Kimberly Heck
96dea61f22 Internal buffers are valid 2020-06-01 12:25:07 -04:00
Juergen Spitzmueller
2975a869d4 update tex2lyx tests after d13e3193b3 2020-05-30 09:32:10 +02:00
Juergen Spitzmueller
d13e3193b3 tex2lyx: reset language after polyglossia lang environment has been closed
Fixes #11878

(cherry picked from commit 5b2479176b)
2020-05-26 17:49:17 +02:00
Juergen Spitzmueller
89d42a68f5 Disable bookmarksopenlevel SL when bookmarksopen is false
Fixes #11289

(cherry picked from commit f2243a3bc7)
2020-05-18 09:15:56 +02:00
Richard Kimberly Heck
1741eb9c2c Fix bug #11456.
Add cancel button and take no action if we're canceled.

(cherry picked from commit 2de99c5dd9)
2020-05-18 00:30:13 -04:00
Juergen Spitzmueller
af4e5aefe0 Check class options for uncodable glyphs
Fixes #11865

(cherry picked from commit 11dc817e9d)
2020-05-16 09:05:36 +02:00
Juergen Spitzmueller
991ef3840e Assign InsetBibtex to appropriate toc level
Fixes #11863

(cherry picked from commit 92ba05c53b)
2020-05-16 09:02:55 +02:00
Juergen Spitzmueller
119d38bedf Move \PassOptionsToPackage before the first package loaded
Fixes #11862

(cherry picked from commit 2663e3845e)
2020-05-14 09:18:16 +02:00
Richard Kimberly Heck
94c2466c4c Fix bug #11864 2020-05-13 14:44:08 -04:00
Scott Kostyshak
7a158055fe Only set dummy X11 selection if we do not own it
Before, we would continually set the selection to the empty string,
to maintain ownership. This causes problems with clipboard managers
GPaste and CopyQ. Further, in theory this should have better
performance since checking ownership should be faster than setting.

A disadvantage of this change is that the timestamp of the selection
will be old at this point in the code. However, when the selection
is requested, we put the selection contents at that point so the
selection timestamp should be accurate then. Further, the selection
contents are not accurate at this point in the code (they are just
the empty string), so it is not clear whether having an accurate
timestamp is beneficial.

Fixes #11715.

(cherry picked from commit af4ee1a487)
(cherry picked from commit 23abb5aaa3)
2020-05-06 08:29:00 -04:00
Juergen Spitzmueller
584550a732 Remap typographical apostrophe from Hunspell to plain apostrophe (#11832)
(cherry picked from commit ca28c9866a)
2020-05-04 23:40:18 -04:00
Richard Kimberly Heck
b4e613828e Fix bug #11787.
Make sure we are actually at the end of the document before issuing
\maketitle because we are at the end of the document.

(cherry picked from commit 7af6575cf6)
2020-05-04 23:30:52 -04:00
Jean-Marc Lasgouttes
e47834104a Adopt a 'belt and braces' approach to bidi forcing
There are two techniques that I know of for forcing the direction of a
string, regardlessly of whether its contents is naturally LtR, RtL or
undecided.

1/ The unicode LTR/LTR override characters. This is supposed to be the
   clean way, however, it does not seem to work with Qt 5.14 (see
   #11691).

2/ The undocumented QTextLayout::setFlags method. This is used
   internally and allows to pass the (undocumented) flags
   Qt::TextForceRightToLeft and Qt::TextForceLeftToRight. This was
   used until we had issues with Qt 5.11 (see #11284).

In order to get the best of both worlds, this patch allows to enable
those two methods separately, and actually enables both at the same
time by default!

Fixes bug #11691.

(cherry picked from commit 4d6041a7b6)
2020-04-29 22:55:25 +02:00
Juergen Spitzmueller
a80ecb3820 Improve reporting of undefined control sequences in preamble
Fixes #11844

(cherry picked from commit 05c7c65d93)
2020-04-19 17:32:33 +02:00
Juergen Spitzmueller
f3f0b53ba6 Reset failedtoload_ bool when include inset params are changed (#11842)
(cherry picked from commit d9b884341c)
2020-04-18 07:59:23 +02:00
Juergen Spitzmueller
e41c790f91 Fix tablefootnote loading order (#11841)
(cherry picked from commit 5bc66b5f45)
2020-04-18 07:40:45 +02:00
Jean-Marc Lasgouttes
8bb317c8db Fix embarassing crash caused by debug message
After commit 6a936d63, the helpful debug message tries to display
non-existing elements and crashes the program :(

Fix by radical simplification of the message.

Part of bug #11777.

(cherry picked from commit b5d6caac41)
2020-04-17 10:41:50 +02:00
Jean-Marc Lasgouttes
cc5d3bd9f4 Do not try to put cursor after space if no space was kept
The logic was wrong and could cause crashes

Fixes bug #11777.
2020-04-17 10:40:54 +02:00
Richard Kimberly Heck
f293de29d9 Make it nicer, thanks to JMarc
(cherry picked from commit 86a4c79dc4)
2020-04-16 21:12:30 -04:00
Richard Kimberly Heck
d1feeaaf2d Fix bug #11635
(cherry picked from commit 46f1f6f1cb)
2020-04-16 17:20:14 -04:00
Jean-Marc Lasgouttes
b7f6b979d0 Do not compute caret geometry when we are not ready to do so.
This avoid crashes with invalid cache.

Fixes bug #11763.
2020-04-09 12:51:38 +02:00
Richard Kimberly Heck
1264934898 Fix bug #11817.
Preserve line spacing when breaking a paragraph at the beginning.

(cherry picked from commit f7065fa22e)
2020-04-08 17:28:10 -04:00
Juergen Spitzmueller
97516cf2f4 Fix quotation marks in PDF TOC
(cherry picked from commit c0adb03a7a)
2020-04-06 16:41:21 +02:00
Juergen Spitzmueller
aede56fa20 Strip polyglossia options from pdf string
Fixes #11813

(cherry picked from commit f9999039ac)
2020-04-05 17:29:04 +02:00
Juergen Spitzmueller
3d0dd488c3 Disable append-column with gathered
Fixes #11812

(cherry picked from commit ed137ee435)
2020-04-05 17:18:15 +02:00
Jean-Marc Lasgouttes
ee7c607b5e Avoid bleeding of inset background outside of inset
As a consequence of fix e64ea357 to ticket #10797, we draw a bit too
much of the inset background outside of the inset (visible for insets
with colored background). #10797 is a ticket that triggers when the
cursor has a width larger than 1.

This patch limits the problems in two respects

* nothing is done on the left, since the cursor width only expands on
  the right.

* on the right, the extra width is limited to cursor width.

Fixes bug #11786.

(cherry picked from commit eb92f74d1f)
2020-04-03 19:02:29 +02:00
Richard Kimberly Heck
df2abff913 Remove newlines from shortcut LFUNs.
(cherry picked from commit c5c1683024)
2020-03-28 15:26:40 -04:00
Juergen Spitzmueller
76e71c5fdd Add hint to warning.
(cherry picked from commit 957e8669c7)
2020-03-26 07:52:37 +01:00
Juergen Spitzmueller
ee69752d61 Fix warning message
(cherry picked from commit c77be6146b)
2020-03-26 07:52:22 +01:00
Juergen Spitzmueller
e1c29a0510 Check character encodability with pass-thru in command insets
Fixes: #11584
(cherry picked from commit ebc2b1295a)
2020-03-26 07:52:01 +01:00
Juergen Spitzmueller
cca83a320b Don't omit ZERO WIDTH NON-JOINER on clipboard paste
Fixes #11790

(cherry picked from commit 7b3404fcab)
2020-03-23 17:25:04 +01:00
Richard Kimberly Heck
7c0cbe68bc Fix bug #11748.
Track the last chosen citation style when we clear the entries.

(cherry picked from commit 64f7da961a)
2020-03-17 02:01:37 -04:00
Richard Kimberly Heck
429d2171b1 Fix bug #11780.
The preamble snippets are for LaTeX and do not need to be output
with HTML.

(cherry picked from commit f044d3a359)
2020-03-14 19:19:04 -04:00
Juergen Spitzmueller
48cb1aa3b7 Fix UI quirk in IncludeOnly settings
Fixes #11564

(cherry picked from commit b568a49593)
2020-03-13 08:45:45 +01:00
Richard Kimberly Heck
2ece10f327 Fix problem with validation when using InsetLayout.
(cherry picked from commit 2e444dd657)
2020-02-26 22:30:34 -05:00
Richard Kimberly Heck
0be206c976 Fix bug #11737.
We need to use the FileName methods when moving or removing a file,
so that refresh() gets called.

No status entry since this will be in 2.3.4.3.

(cherry picked from commit d930913898)
2020-02-13 00:06:17 -05:00
Stephan Witt
058283515a Fix a crash with uninitialized buffer member of MathData
See the details here: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210294.html
2020-02-08 16:33:51 +01:00
Juergen Spitzmueller
6617d492e8 Properly resize columns of child document table widget 2020-02-08 09:27:21 +01:00
Juergen Spitzmueller
b2604aa840 Fix encoding inheritance with CJKUtf8 as custom document encoding
Fixes #11579
2020-02-07 16:18:47 +01:00
Richard Kimberly Heck
e60d5df4b3 Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.)
(cherry picked from commit 5188f0fcff)
2020-02-06 13:54:13 -05:00
Juergen Spitzmueller
b0a2868938 Ignore geometry-related settings if the class provides geometry
Fixes #11724

(cherry picked from commit dce9e44a14)
2020-01-29 16:06:44 +01:00
Enrico Forestieri
15949fc99a Fix bug #11716
Force closing and reopening of \lyxdeleted after deleted
display math so that the following deleted text can be
correctly striked out.
2020-01-27 11:21:26 +01:00
Juergen Spitzmueller
81af6062cb Fix backspace deletion of selected items with change tracking
Move cursor at beginning of selection after deletion. Else backspace
operation gets stuck in a loop (tries to remove the selection again
and again).

This also fixes backspace deletion of insets with confirmDeletion() == true.

Fixes #11630

(cherry picked from commit adfd38e4ef)
2020-01-27 08:42:11 +01:00
Juergen Spitzmueller
2deabd0fbd Fix issues with tilde in inputpath
Fixes #11699

(cherry picked from commit a426b33067)
2020-01-27 08:32:11 +01:00
Juergen Spitzmueller
878efbaf62 Re-fix #11146 with recent LaTeX
(cherry picked from commit e75fa6f3ac)
2020-01-27 08:29:12 +01:00
Jean-Marc Lasgouttes
b7c098c3fa Avoid blinking change tracking cur for math inset.
Since there is a margin above and below the inset, there is no problem
for putting it higher.

Fixes bug #11684.

(cherry picked from commit bf7f4d716c)
2020-01-26 23:17:55 +01:00
Jean-Marc Lasgouttes
b7ec3d8515 Do not check again and again for non existing files
If the file of an InsetInclude does not exist, loadIfNeeded will try
again and again to look for it. This is very bad for files with many
include insets, especially on windows.

Fixes bug #11656.

(cherry picked from commit aeed6fb8fa)
2020-01-10 11:24:24 +01:00
Jean-Marc Lasgouttes
440271540f Disable inset-dissolve in table cells
This is better than making sure that the inset has exactly one cell.

In the future, inset-dissolve could be extended to dissolve all the
cells contents in the enclosing text.

Note that this check does not appear in mathed, and using dissolve in
e.g. fraction inset may lead to data loss (only current cell contents
is preserved).

(cherry picked from commit 5ac3b88007)
2019-12-30 13:32:24 +01:00
Juergen Spitzmueller
631e42f68b Fix crash with polyglossia and intitle commands when lang_auto_end is false
(cherry picked from commit ed44bc9b12)
2019-11-21 09:37:05 +01:00
Jean-Marc Lasgouttes
0310dcb19e Revert "Set buffer when expanding macro"
This patch is not ready yet. Moreover, change the assertion in
InsetMathGrid::colAlign to a simple test.

As a consequence, math split inset might show a bad alignment in some
situations.

This reverts commit d3fd915662.
2019-11-16 12:04:09 +01:00
Jean-Marc Lasgouttes
aaf96b3025 Use backing store also with wayland platform
Like with macOS, the Wayland compositor seems to require a
backingstore when doing partial updates like we do.

This extends the mechanism that has been introduced for macOS. This
has to be done at run time, not compile time.

Fixes bug #11692.

(cherry picked from commit 575761c665)
2019-11-07 12:40:40 +01:00
Pavel Sanda
69031bb2ce Make branch compilable in C++98 mode again. 2019-11-06 09:53:28 +01:00
Juergen Spitzmueller
8ed8aeac92 Add line break in message 2019-10-31 10:41:55 +01:00
Juergen Spitzmueller
482a34c9af Validate if graphics path is encodable
Fixes #11688

(cherry picked from commit 1c0572f1ab)
2019-10-31 10:15:09 +01:00
Jean-Marc Lasgouttes
691f29b4c7 Avoid warnings with gcc 9
The warning about unneeded std::move can be solved by conditioning on
C++14 mode.

The warnings about deprecated copy is harder, so we disable it for
now. We will be able to fix our part, but Qt triggers it a lot too.

(cherry picked from commit 134f3aedaf)
2019-10-25 17:52:05 +02:00
Jean-Marc Lasgouttes
a7b5aea9b6 Keep last file positions in last-use ordering
Using a map would sort the elements in alphabetic ordering, which
means that when the number of elements is larger than 100, the wrong
elements get pruned.

This commit uses a list instead. Searching an item needs linear time,
but this should not be a problem for a list with less than 100
elements.

Fixes bug #10310.

(cherry picked from commit 58d22e0c6e)
2019-10-23 15:09:23 +02:00
Jean-Marc Lasgouttes
f6282dfec7 Be careful before using buffer parameters in colAlign
Make InsetGrid::colAlign a normal method and make it check whether
buffer is valid before using it. This avoids crashes as we have seen
in 2.3.3 (see e.g. #11686).

There is still an assertion so that failure is noticeable before release.

(cherry picked from commit 44816adce6)
2019-10-22 18:10:00 +02:00
Jean-Marc Lasgouttes
d3fd915662 Set buffer when expanding macro
This avoids a crash in InsetMathSplit which uses the buffer() value.

Fixes bug #11686.

(cherry picked from commit 19abf29ea0)
2019-10-22 17:57:52 +02:00
Juergen Spitzmueller
1030c70b48 Force LTR for numeric citations
Fixes: #3005
(cherry picked from commit cce9adc185)
2019-10-19 15:57:24 +02:00
Jean-Marc Lasgouttes
7c35081d0c Fix bad caret position with horizontal scrolling
Horizontal scrolling used to be taken into account when updating caret
geometry. This is wrong since it may have changed when time comes to
draw the caret. This leads to a situation where the first apparition
of the caret is at a wrong place.

Now the extra horizontal offset is used at drawing time.

Fixes bug #11603.

(cherry picked from commit bdf58b77e7)
2019-10-16 16:44:42 +02:00
Enrico Forestieri
fe426c2db8 Fix bug 11667
When automatic command termination was added to texstream it was
forgotten to reset its status after a math inset.

(cherry picked from commit 0573bf92e0)
2019-10-01 08:10:46 +02:00
Patrick de Visschere
37f987afc9 #6961 correct the big-endian conversion of UInt32
This is a patch from Patrick de Visschere. Thanks.

(cherry picked from commit b70c3796a1)
2019-09-20 19:57:01 +02:00
Jean-Marc Lasgouttes
71b8019d56 Enable dissolve in undefined Flex inset context menu
This is a hackish special case, so I had to add a hack...

Fixes bug #8650.

(cherry picked from commit 7c1c50d737)
2019-09-15 23:23:48 +02:00
Jean-Marc Lasgouttes
8e50b9569a Fix warning 2019-09-13 09:52:33 +02:00
Richard Kimberly Heck
bd0d2ed5b2 Fix bug #11636.
Directories are created when files are copied, so we do not need
to do it prospectively here.

(cherry picked from commit 05a446b77c)
2019-09-11 22:16:44 -04:00
Juergen Spitzmueller
f838b16a9b Allow to hide formats from menus
Fixes: #11657
(cherry picked from commit d76cef70a0)
2019-09-11 10:46:07 +02:00
Jean-Marc Lasgouttes
7940263517 Set buffer correctly when deleting column in math grid
This is a followup to ebe6612e.

Fixes bug #11623.

(cherry picked from commit 5915d69eaf)
2019-09-05 13:49:52 +02:00
Scott Kostyshak
421509b260 Enable change tracking if paragraph break change
When a selection spans more than one line, we now check for whether
there is a change at one position after the last position of each
fully selected line.

This fixes #11629.

(cherry picked from commit 27f89144bb)
2019-08-31 15:06:08 -04:00
Juergen Spitzmueller
0da95572ad Correctly set language after intitle paragraphs
Fixes: #11514
(cherry picked from commit b5722962fb)
2019-08-20 08:37:37 +02:00
Juergen Spitzmueller
bca4c65061 Properly terminate command.
This amends 1c2700eb11.
2019-08-19 07:32:57 +02:00
Juergen Spitzmueller
8831d50936 Load rotfloat and rotating after graphicx.
Fixes: #11502
(cherry picked from commit f937b5eb7a)
2019-08-16 17:25:41 +02:00
Juergen Spitzmueller
c1c94010e4 Fix coloured boxes in RTL with [pdf]latex (#8642)
(cherry picked from commit 7ca267e1fe)
2019-08-16 08:10:17 +02:00
Juergen Spitzmueller
7f58601c00 Fix greyedout note in RTL (#8647)
More complicated than I wished for, but color handling in RTL is
particularly tricky.

The three versions are needed due to the differences between [pdf]latex,
xetex, luatex/luabidi and luatex/babel.

(cherry picked from commit 4e74dd0d42)
2019-08-16 07:51:26 +02:00
Juergen Spitzmueller
1c2700eb11 Re-fix #2005
Loading keyval does not work any longer. Fix it properly by de-activating
the equal character locally if graphics options use it.

We do this statically for Turkish and Latin in stable, as opposed to
master (where we have the ActiveChars languages tag)
2019-08-15 09:20:40 +02:00
Juergen Spitzmueller
1ee62a3358 Fix interplay of memoir and geometry
Fixes: #10970
(cherry picked from commit 65c1ae8133)
2019-08-06 10:10:53 +02:00
Juergen Spitzmueller
7c0d9eb4d9 Fix text direction of references with XeTeX/bidi
Fixes: #11626
(cherry picked from commit 231b36d950)
2019-08-06 10:07:41 +02:00
Pavel Sanda
f4e700be2a Backport eceed02a90. 2019-07-26 21:42:19 +02:00
Juergen Spitzmueller
67e6f06173 Fix bug #11616
With !using_begin_end, we need to compare against the paragraph language
since cur_language is always empty.

No status entry needed as this fixes a bug introduced after 2.3.3.
2019-07-19 06:55:45 +02:00
Richard Kimberly Heck
c839747055 Fix bug #11612.
Register verbatim includes with the outliner.

(cherry picked from commit 6960bab65c)
2019-07-11 16:25:46 -04:00
Juergen Spitzmueller
5679dc5c6f Proper number ordering with luabidi
As opposed to bidi (XeTeX), luabidi (LuaTeX) does no automatic reordering,
so we need to use \\LR{}

(cherry picked from commit 1d0929b5d9)
2019-07-11 17:46:55 +02:00
Juergen Spitzmueller
f0f4b98c6e Brackets reversion differs in luabidi (LuaTeX) from bidi (XeTeX)
This amends [195f62ac93/lyxgit]

(cherry picked from commit d3aa102260)
2019-07-11 17:44:34 +02:00
Juergen Spitzmueller
f60f82e7b7 LuaTeX (luabidi) does not correct directions
This amends [9d20bc4e98/lyxgit].

(cherry picked from commit a95339c6e1)
2019-07-11 08:37:52 +02:00
Juergen Spitzmueller
6e01ceca24 LuaTeX (luabidi) does not swap table columns
This amends [21b347a2f8485/lyxgit].

(cherry picked from commit 6f8db58778)
2019-07-11 08:33:58 +02:00
Juergen Spitzmueller
2208f4f519 Fix right and left layout alignment (in workarea) with RTL
Fixes: #11606
(cherry picked from commit b6f0c1de3d)
2019-07-11 08:31:50 +02:00
Juergen Spitzmueller
6afe258453 Preserve star on citation style change via menu
Fixes: #11439
(cherry picked from commit 52fffee7f2)
2019-07-10 09:37:24 +02:00
Richard Kimberly Heck
1e98580988 Fix bug #11588.
Check for the local file before calling kpsewhich.

(cherry picked from commit 2e433654c7)
2019-07-07 13:31:27 -04:00
Jean-Marc Lasgouttes
c047dc64bf Fixup 17571104: really avoid empty numbers in toc
For some reason, I missed this one when trying to fix the bug.

Fixes bug #11423.

(cherry picked from commit 5a22b2e391)
2019-07-07 13:23:45 -04:00
Richard Kimberly Heck
ad4215e462 Fix bug #10091.
See the discussion. The decision was just to keep re-trying for a
bit, since the lock preventing us from removing the old file seems
to clear after a bit.

(cherry picked from commit d96a9aa37f)
2019-07-07 13:15:27 -04:00
Juergen Spitzmueller
53597584e6 Fix nomencl generation with LuaTeX
Fixes: #11571
(cherry picked from commit bf6a7dc38f)
2019-07-07 10:45:41 +02:00
Juergen Spitzmueller
7c673acbb1 \detokenize paths containing ~
(cherry picked from commit d876319e85)
2019-07-07 10:35:55 +02:00
Juergen Spitzmueller
5afb71cb9b Fix import of custom float definitions
Candidate for stable

(cherry picked from commit bda3b6d07e)
2019-07-05 18:47:07 +02:00
Enrico Forestieri
a2d181905a Fix bug #11586
Do not replace a latex command with the corresponding symbol
in the unicodesymbols file unless it can be encoded in the
document encoding.

The mhchem \ce inset is a text mode environment but allows entering
spaces and mathmode commands. However, even if it doesn't allow unicode
symbols, LyX allows entering them (by copy/paste, for example), causing
latex errors. As a unicode symbol may have a proper latex representation
from the unicodesymbols file, use it instead of the bare symbol. Here, we
don't care about the mode because both text and math mode should be allowed.
For example, the ⟶ symbol is not recognized but its latex representation
(\longrightarrow) is fine. Of course, there may be symbols that are
not recognized anyway, but this is better because they cause explicit
errors from mhchem instead of cryptic iconv errors in case they cannot
be represented in the document encoding.
2019-06-25 22:23:51 +02:00
Enrico Forestieri
f5510a8a8d Fix bug #11552
Do not write supefluous braces in optionals of a macro when saving.
2019-06-25 22:09:12 +02:00
Enrico Forestieri
911e6412b8 Refined fix for #9633
A branch inset modifies the layout of the internal structures in
which the text is organized. When a branch is active, it is as if it
was not there, but its only presence makes a paragraph which would not
be the last one to actually be the last one, or the check for the
language of the previous paragraph to fail because there is no
previous paragraph before the first one in a branch inset.
Oney way I found to tackle it, is tracking whether the typesetted
paragraphs are actually part of an active branch inset and acting
accordingly.
2019-06-25 21:57:00 +02:00
Enrico Forestieri
7998616edb Properly fix #9616
Now all symbols in the unicodesymbols file having a mathcommand
are not wrapped in a \text inset anymore.

(cherry picked from commit 506324ef9d)
2019-06-25 21:41:21 +02:00
Enrico Forestieri
112616a97b Fix bug #10499
The array environment has to be explicitly parsed in math mode.

(cherry picked from commit 1a286c7910)
2019-06-25 21:33:29 +02:00
Enrico Forestieri
ad8f574277 Fix bug #10498
Use the selection as the argument of a macro also when the
macro has only optional arguments.
2019-06-25 21:27:33 +02:00
Enrico Forestieri
11fd6fe43d Fix bug #11595
Avoid an endless loop when in the definition of a macro the macro
itself is used in the LyX representation part.

(cherry picked from commit 1cb2a443b5)
2019-06-22 21:48:16 +02:00
Juergen Spitzmueller
4cf56383ca tex2lyx: improve module support
The current heuristics only considered modules with styles that defined
a searched command in their preamble, and only for commands/environments
that were defined in the document's preamble. This limited the module
support drastically.

The new heuristics also checks for commands coming from packages. If the
command is not (re-)defined in the document preamble, it checks modules
that provide a style with a matching LaTeXName, checks for their
requirements and matches those with the packages loaded by the document.

If no module provides a searched style, but we found modules that load
packages that are loaded in the imported tex file, and if those packages
are not auto-loaded by LyX anyway, we also load this module.

fixes: #11259, part of #8229
(cherry picked from commit 0b54650f0e)
2019-06-19 17:23:26 +02:00
Juergen Spitzmueller
68045958ee Rename a variable
This is in preparation for a backport. See #11259
2019-06-19 17:21:00 +02:00
Juergen Spitzmueller
019a4fa124 Prevent multiplication of preamble code
Fixes rest of #8229

(cherry picked from commit f51fa38123)
2019-06-19 17:13:16 +02:00
Juergen Spitzmueller
f8eb3b9742 Fix toprule with booktabs/longtable and captions
(cherry picked from commit fe589d5622)
2019-06-19 09:45:20 +02:00
Juergen Spitzmueller
8941ec4b42 update buffer after fixBiblio
fixes: #2743
(cherry picked from commit 0a4686d8d3)
2019-06-19 09:23:52 +02:00
Juergen Spitzmueller
86f999097e reset bibitem counter in the second updateBuffer() routine as well
Fixes: #8499
(cherry picked from commit 9370135c3e)
2019-06-19 09:20:25 +02:00
Juergen Spitzmueller
8556d65279 Handle orphaned bibitems
Fixes #7160

(cherry picked from commit 96e4001d01)
2019-06-19 09:12:23 +02:00
Jean-Marc Lasgouttes
d031e67fd0 Fixup 7686af1ba8: japanese-cjk got forgotten 2019-06-08 09:45:15 +02:00
Jean-Marc Lasgouttes
bc54a55491 Cell in delimiter inset should not be tight
Fixes bug #11337.

(cherry picked from commit 4da19ef833)
2019-05-25 14:15:38 +02:00
Jean-Marc Lasgouttes
49255788ea Always paint text decoration when painting inset.
Fixes bug #11402.

(cherry picked from commit 621c908f85)
2019-05-24 10:36:13 +02:00
Jean-Marc Lasgouttes
bbe7b84f3b Reset change bar information when breaking row
This is a much less invasive version of da2696cc+da2696cc, which
reduces the risk to a minimum. There may be other Row members that
need resetting, we'll see that later.

Fixes bug #11396.
2019-05-24 10:21:43 +02:00
Enrico Forestieri
a5f5985d28 Fix bug #11528
The code was not doing what said in the description.

(cherry picked from commit 45e0ce2372)
2019-05-20 22:07:59 +02:00
Jean-Marc Lasgouttes
7686af1ba8 Some Asian langagues allow to wrap text at any position
This is hardcoded for now for simplicity and to allow backporting to
2.3.

The behavior is unchanged for all languages but Chinese, Japanese or
Korean.

Fixes part of bug #10299.

(cherry picked from commit 26c2811cc4)
2019-05-15 18:26:08 +02:00
Jean-Marc Lasgouttes
23505a8a91 Newly created inline math is not numbered
The bad initialisation created phantom entries in equation ToC

Fixes bug #11423.

(cherry picked from commit 175711046d)
2019-05-13 10:05:33 +02:00
Juergen Spitzmueller
b50949b472 Only write btUnits if we have a bibliography
Fixes: #11562
(cherry picked from commit b77094a497)
2019-04-24 07:32:07 +02:00
Juergen Spitzmueller
4104cd13a5 Fix renaming of citation refs after changing bibitem key
Fixes: #6494
(cherry picked from commit faefee3dc6)
2019-04-22 09:18:29 +02:00
Juergen Spitzmueller
6f8673bcee Pass proper text to TeXOnePar in Paragrapgh::Private::validate
This fixes InPreamble layouts in insets (#11557)

(cherry picked from commit 4f884fc92d)
2019-04-21 08:03:22 +02:00
Juergen Spitzmueller
ccf93fc0d6 Use proper listings font styles with polyglossia and RTL
Fixes: #11554

Also load color with minted and polyglossia/RTL, as minted loads it
too late.

(cherry picked from commit 3e516a6219)
2019-04-20 08:37:45 +02:00
Jean-Marc Lasgouttes
f03c4a2db4 Fixup ad79ac40: reintroduce markers around delimiters
The reasoning behind this change was not correct.

Fixes bug #11516.

(cherry picked from commit 3b58e38dc6)
2019-04-10 14:39:09 +02:00
Jean-Marc Lasgouttes
595c6d0a05 Fix bold-like characters when selecting bidi text
In painter, restrting paining regions does not really work when region is empty.

Fixes bug #11198.

(cherry picked from commit f9da28428a)
2019-04-10 14:19:18 +02:00
Juergen Spitzmueller
7986ac2f32 Fix left/right border UI when toggling formal
Fixes: #9835
(cherry picked from commit 00de6c4be7)
2019-04-01 18:48:07 +02:00
Juergen Spitzmueller
15dae1244b Fix booktabs bottom line with multirows
Fixes: #11445
(cherry picked from commit 819c9c1645)
2019-04-01 18:45:57 +02:00
Enrico Forestieri
f836783908 Fix bug #11526
Correctly categorize a textmode symbol in mathed.

(cherry picked from commit c2af2cfd94)
2019-03-24 22:19:05 +01:00
Pavel Sanda
0b24c0db58 backport forgotten accelerators 2019-03-23 07:56:21 +01:00
Jean-Marc Lasgouttes
e0879b1460 Cache the value of GuiFontMetrics::lbearing().
This seems to be necessary on windows, where math editing can get very
slow. Note that other methods like rbearing already use a cache.

In the future all these caches for single characters shall be unified.

(cherry picked from commit d3979e798c)
2019-03-21 18:43:37 +01:00
Jean-Marc Lasgouttes
f94cdf6e1c Place the depth bar correctly in full screen mode
In full screen mode, it is possible to restrict the text width. In
this case, the paint bar should not be painted outside of this
restricted area.

Fixes bug #11286.

(cherry picked from commit 7485225cc6)
2019-03-21 11:57:59 +01:00
Juergen Spitzmueller
5518ca028e Add tabular-features set-inner-lines and fix set-all-lines behavior
Patch by Daniel Ramöller (racoon)

Fixes: #11382
(cherry picked from commit cb84f752f2)
2019-03-20 12:49:23 +01:00
Enrico Forestieri
98a792c9fd Fix bug #11490
Correctly add the branch name suffix when the stem
of the filename contains a dot.

(cherry picked from commit c3b9504835)
2019-03-19 21:41:04 +01:00
Enrico Forestieri
33023e6811 Fix bug #4269 and avoid crash with gzipped file
Call gunzip with quoted filenames as they may contain spaces or
other special characters.

In computing the length of the extension, the code does not account
for the prefix "unzipped_", which is added when the zipped filename
does not have one of the extensions "gz", "z", "Z", or "svgz", and
thus the used index is out of bounds. See also this thread:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207360.html

(cherry picked from commit 69726b832b)
(cherry picked from commit 7296e0e6ba)
2019-03-19 21:27:35 +01:00
Enrico Forestieri
41a8994da9 Fix bug #4269
Call gunzip with quoted filenames as they may contain spaces or
other special characters.

(cherry picked from commit 69726b832b)
2019-03-19 21:22:14 +01:00
Juergen Spitzmueller
4456dede9c Do not force LTR with nameref and non-TeX fonts
Fixes: #11518
(cherry picked from commit f0282ddff4)
2019-03-17 17:29:14 +01:00
Richard Kimberly Heck
3ce4338e75 Fix regression concerning collapsing insets after search.
To reproduce: Do a search for text in a footnote (say) that is
currently closed. Click inside the now open footnote. It will close
by itself.

We need to know whether we can go into the inset, not whether we can
edit once we're there.

(cherry picked from commit 4484cc7751)
2019-03-14 21:34:50 -04:00
Juergen Spitzmueller
d3c47dcb13 More exceptions to percent encoding
See #11511

(cherry picked from commit 3c83f01f1b)
2019-03-10 18:04:03 +01:00
Juergen Spitzmueller
7d806ebbb6 Do not percent-encode & in urls
This is query syntax

Fixes: #11511

follows up [c2db448ff5/lyxgit]

(cherry picked from commit 936cddc715)
2019-03-10 18:02:19 +01:00
Jean-Marc Lasgouttes
ee8a336cbc Update screen as needed when preferences are changed
This commit removes the adhoc code in GuiPrefs and moves it to LyXRC,
so that it triggers in every preference change.

The code has also been updated to trigger on more variables, e.g.
font_*_foundry.

Note that the actual function that are called have not been changed
(addPreviews and LFUN_SCREEN_FONT_UPDATE), although there are doubts
that they behave as needed (see FIXMEs).

Fixes bug #11498.

(cherry picked from commit 954531f247)
2019-02-27 12:04:09 +01:00
Richard Kimberly Heck
9374d0edd9 Fix bad error message (bug 11486).
(cherry picked from commit 5b959033d2)
2019-02-25 22:04:19 -05:00
Juergen Spitzmueller
43edb36032 Amend 5f45b3ed9c
(cherry picked from commit 806f742263)
2019-02-23 17:23:40 +01:00
Jean-Marc Lasgouttes
7f177d8d4a Improve DEPM when change tracking is on
A typical problem when change tracking is on is:
1/ insert a new space between two words (as if you want to insert a new one)
2/ move the cursor
3/ see how one has one inserted and one deleted space, whereas one would expect nothing.

The problem is fixed in a general way in master, but here we propose
a simpler one, where the spaces that we keep are the ones at the end
of the sequence of spaces.

Part of #11412.
2019-02-15 11:04:28 +01:00
Jean-Marc Lasgouttes
484128d05b Fix position of cursor when DEPM is used in change tracking mode
When change tracking is active, it may happen that spaces are marked
as deleted instead of being removed. Therefore it is better to measure
the change of size of the paragraph to know how to offset the cursor.

Moreover, it the cursor was strictly after the start of the sequence
of spaces, we ensure that it is still the case.

This commit is _not_ a backport from master, which has diverged.

Part of bug #11412/
2019-02-15 11:03:17 +01:00
Jean-Marc Lasgouttes
c44dc071a5 Fix DEPM at end of paragraph
Remove special handling of spaces at end of paragraph. Now they are
handled like interword spaces by both DEPM methods.

Fix off-by-one error in loop when testing for end of paragraph.

Part of bug #11412.

(adapted from commit c00234503f)
2019-02-15 11:01:29 +01:00
Jean-Marc Lasgouttes
96ef3d320b Fix Visual C++ warning
(cherry picked from commit 2215f4c2b4)
2019-02-11 10:54:58 +01:00
Jean-Marc Lasgouttes
4c18a49c87 Fix algorithm for finding localized files
Now we search in priority with the GUI language, and then the
language(s) specified in the LANGUAGES environment variable.
Preoviously, the GUI language would only be considered when
LANGUAGES was not set (which was a bug).

Take this opportunity to remove old compatibility code from 2007.

(cherry picked from commit e203bf519b)
2019-02-07 10:19:28 +01:00
Enrico Forestieri
841f0fd3dd Fix bug #11484
When splitting parameters at commas, take into account that
commas inside curly braces are not parameter separators.

(cherry picked from commit 6316b9b7ae)
2019-02-05 14:57:18 +01:00
Juergen Spitzmueller
f785d63a0a ? and = must not be percent-encoded in hrefs
Fixes: #11482
(cherry picked from commit c2db448ff5)
2019-01-30 08:17:20 +01:00
Richard Kimberly Heck
8cbf1c7cec Rename emergency file when it is kept.
Otherwise, we will ask about it again next time, when the file
may have changed. Also, if we crash again, we'll over-write that
file, which we may not want to do.

See bug #11464.

(cherry picked from commit b804e8851c)
2019-01-17 23:01:54 -05:00
Jean-Marc Lasgouttes
aa2f5eb426 Allow to type a space in front of another one
This is a follow-up to 714b731e. This fixes the issue when the cursor
is in front of a space
  abc| def
and one inserts another space (to start a word). DEPM would eat one
space and produce
  abc |def
instead of
  abc | def

Additionally, fix the same_par boolean, wheich did not take the cell
index into account.

Related to ticket #11412.

(cherry picked from commit 7848d3c90c)
2019-01-16 10:38:47 +01:00