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)
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)
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)
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)
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)
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)
When splitting parameters at commas, take into account that
commas inside curly braces are not parameter separators.
(cherry picked from commit 6316b9b7ae)
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)
The PATH prefix modified through the GUI was set without
replacing embedded environment variables. This might have
caused problems on Windows with external python installations.
(cherry picked from commit 472bdf5910)
This adds a new (boolean) parameter "active" to the label cache, where
we track whether a label is deleted in ct mode (the same could be done,
if wanted, for labels in notes and inactive branches).
Deleted (inactive) labels are neither considered in the uniqueness check
nor added to the outliner. This also means that undeleted references to
deleted labels are now (correctly) marked as BROKEN.
Cherry-picked from:
[3ae6bff538/lyxgit]
[a550a613e8/lyxgit]
[c457ea90e/lyxgit]
[5cfd25697/lyxgit]
[5afacb144/lyxgit]
[54366c38e/lyxgit]
Fixes: #6563
If we use that, the document actually needs to be in utf8 encoding, and
the CJK environment needs to account for it.
Candidate for stable.
(cherry picked from commit d193cd05a8)
The column is flushed when the display of equations is flushed.
Not sure what to do with RtL languages.
Fixes bug 11324.
(cherry picked from commit 7cb0284a3f)
This broke the activation and de-activation of plural, capitalize,
etc. I guess that tells us how much those get used....
(cherry picked from commit 9b3f9cc687)
In particular, introduce the new InsetMathScript::allowLimits method
that checks for that and honor it in getStatus/ddoDispatch.
Do the same for (over|under)brace
(cherry picked from commit 7b7ed64a0e)
(cherry picked from commit 6cfd733dea)
For some reason, adding a LTR/RTL Override unicode character before a
MinionPro string increases the ascent of the line.
This creates vertical offset issues when painting if the ascent used
as reference is the one of the font. Use the QTextLine ascent instead
for better results.
This is a followup to 1bed76e2a.
Fixes (reopened) ticket #11284.
Fixes ticket #10532.
Fixes ticket #10767.
(cherry picked from commit d8498d4785)
We need to do this unconditionally, since there is no (trivial and non-
awkward) way to update it when the bibliography paragraphs are modified.
Fixes: #4899
(cherry picked from commit 35534231d4)
When blinking the caret, it looks like a cool idea to only update the
small rectangle containing the caret. Actually it is an awful idea, since
the paint event will paint some rows, and these rows will not be
properly painted outside of the small rectangle. Unfortunately, the
painter will skip those "painted" rows on next paint events.
This leads to painting errors that depend on the ordering of "real"
and "caret" paint events. This is the reason why they only appeared
with split screens.
Quote of the day: ``The real problem is that programmers have spent far
too much time worrying about efficiency in the wrong places and at the
wrong times; premature optimization is the root of all evil (or at
least most of it) in programming.''
-- Donald Knuth, The Art of Computer Programming.
Fixes bug #11354.
(cherry picked from commit fba9f5b9e8)
Eventually, all overridden virtual methods should be marked properly.
Currently, clang only warns about those in classes that already use
override in at least one place (which was the case dor GuiApplication).
(cherry picked from commit c8f4b68423)
Outsource the bibliography to an own child, which is then also included
in the children's "Standalone" branch
Add some clarifying notes.
Fixes: #10748
(cherry picked from commit 12aaeb259f)
We used to need a hack to set the size of the layout combo, but
the code was changed in Qt 4.5 or so. Hence the appearance of this
bug in 2009. We can now just remove this hack, and all seems to
work correctly.
(cherry picked from commit d7f4346a19)
I'm not entirely happy with this way of doing it. It seems messy.
But there is not another clear option right now.
(cherry picked from commit 4f0ccae399)
We need to load the master document before applying the params, since
otherwise the TOC reset (and other things) happen before the master
has been loaded (and set as parent).
(cherry picked from commit ac3693c04f)
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.
(cherry picked from commit dff0c5729e)
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.
(cherry picked from commit 2dcb730026)
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.
(cherry picked from commit 4c9df62c6c)
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.
(cherry picked from commit 1bed76e2a1)
As of LaTeX2e 2018, characters are made active earlier, which results
in new expansion problems.
Following a suggestion of Markus Kohm (pc) and the TL mailing list [1],
we embrace non-ASCII input paths in \detokenize. This relies on e-tex,
but I think we can assume this is nowadays available everywhere.
[1] http://tug.org/pipermail/tex-live/2018-May/041691.htmlFixes: #11146
(cherry picked from commit 8bd65041f2)
This is a fixup to 4ecbff00. 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.
(cherry picked from commit 2dc84b69d5)
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.
(cherry picked from commit 7db99672e6)
Add the "hyperref-driver=dvips" option to the extra flags of the
latex->dvi converter so that the breakurl package is automatically
loaded when needed.
(cherry picked from commit f5e6db7171)
Instead of "Save" (permanently) and "Apply" (temporarily), OK and Apply
now always save permanently, unless the new checkbox "Apply to current
session only" is checked.
Addresses: #10016
(cherry picked from commit c7bdb3b342)
If we were not ready to paint the screen, this does not mean that we
should give up on repainting, just potpone it.
I thought that it was bad to call update() in the paint event, but I
cannot find reference to this anymore and everything seems to work as
intended.
Fixes part of bug #11323.
(cherry picked from commit 38f09c177b)
(cherry picked from commit 2617a4dd50)
When a raster image with an advertised pixel density different
from 72 dpi is included in a latex file, the output image dimensions
are scaled by the ratio 72/pixel_density. Hence, if a clipping
bounding box is specified, it has to be scaled by the same ratio,
otherwise the images will be clipped differently on screen and output.
Here we use the extractbb command (present in any TeX distribution)
to ask about the output dimensions of the image as dictated by the
pixel density and compute the scaling ratio by the knowledge of the
actual dimensions. If, for whatever reason, extractbb is not found,
everything goes as before, because the clipping bounding box will
simply not be corrected.
(cherry picked from commit 380f34a114)
On Windows, start viewers in detached processes in order to avoid
a crash of the QProcess destructor when their thread terminates.
The opening of a console window is avoided by redirecting to the
null device all standard I/O channels.
This can happen when the inset that contains the cursor is outside of
the screen.
THis is only a workaround. The real solution would be a
processUpdateFlags(FitCursor) call, but the code is not ready for that
yet.
Fixes bug #11296.
(cherry picked from commit 17576fb83b)
We do not know what to do with horizontal scrolling events, so we ignore them.
Note that the code has to be different between Qt4 and Qt5.
Fixes bug #11257.
(cherry picked from commit 2cfbc5ecf6)
1/ Handle space in color name in set-color (with quoting)
2/ read properly branch inset which name has a space
Fixes bug #11108.
(cherry picked from commit 819cf53c22)
Also fix a glitch in non-refstyle import (getOpt() returns the option
with delimiter, so do not add them in ERT once more)
Candidate for stable
(cherry picked from commit faf40fb408)
1. Do not attempt to mix diverging btUnits (e.g., chapters and sections).
2. use parse_text to properly parse the contents.
(cherry picked from commit 68d48b0015)
Make sure that the blue language underline is not below the bottom of
the row. Otherwise, it can disappear when the next row is painted.
(cherry picked from commit 8e9e050670)
This gives a better idea of the TeX output, even though the thicknesses are
not correct. Like in LaTeX, this happens only for full top/bottom rules.
(cherry picked from commit 8651cd89f6)
(cherry picked from commit 84328c8538)
QKeySequence returns special characters for keys on the mac rather than
textual key names (as on other OSes).
Since these symbols are not included in many fonts, we re-translate them
to textual names
Fixes: #10641
(cherry picked from commit 5f45b3ed9c)
The goal of this patch is to make "self-insert <string>" act as a
sequence of individual self-insert calls. Once it is done, the
insertion of the commit string in GuiWorkArea can use that, which
fixes the issues described in bug 11183.
1/ in InsetMathNest, SELF_INSERT is rewritten to be a proper loop of
interpretChar, instead of inserting the string as characters. This
solves the issue of interpreting ^ properly.
2/ the text version does not need to be changed (the loop is rewritten
using a range, though).
3/ Then {{{GuiWorkArea::inputMethodEvent}}} is changed to invoke
directly self-insert. This removes the update issues.
Fixes bug 11183.
(cherry picked from commit ad5548cfe3)
A new UNDECIDED state is used if multiple cells with differing border
settings are selected.
This prevents additional borders to be set without being asked.
Fixes: #10010
(cherry picked from commit 99aefa5fd2)
Rather than checking for hardcoded title commands such as \maketitle,
use the titlename and titletype as defined in the layout.
This now also includes title environments.
Fixes part of #6461
(cherry picked from commit 429edc0a59)
Also, use EuropeanNumberSeparator information rather than relying on an
own (incomplete) list of number separators.
Fixes: #4057
(cherry picked from commit 611df441b6)
Minted does not have a language option but it is possible to enter
this option in the LyX interface for compatibility with the listings
package, and also for letting to enter a language not present in the
gui. So, this option is only used for properly specifying a language
in a listing, unless it is entered in the document settings dialog.
This case was not foreseen and thus the option was being passed to
the package as is, causing havoc. With this commit the option is
still available but is used to set a default language for a new
listing in place of the default "tex" language used so far.
(cherry picked from commit 16ca5290c0)
On some recent Windows versions, GetLastError() may also return
NO_ERROR instead of ERROR_IO_PENDING during an overlapped write
operation to a pipe. This was confusing the state machine in
Server.cpp so that replies to commands were scheduled but were
never actually output.
(cherry picked from commit cf5f2661dc)
The checkProg() function was separating a command from its parameters
by splitting at the first space. This was a problem if the command
was specified with a full path containing spaces. Now the checkProg()
function separates a command from the parameters by splitting at the
first non-quoted space. So, it suffices quoting a path to solve the
issue.
Qt 5.2 introduces the possibility to place a checkbox on a QMessageBox,
so we need no longer to use our own crude dialog.
(cherry picked from commit 0148ef7e6c)
Apparently, a new paragraph is started after a float even if
no blank line is actually present. So, account for this fact.
(cherry picked from commit f6922b8c88)
LyX on Mac uses a user directory with version suffix. On change of the version suffix
the existence of the directories with previous versions is checked and the latest one
is used for a copy on first configure run.
For 2.3 the candidate list starts with 2.2 now as it should.
(cherry picked from commit 17c3617c49)
Compute a height from current font and current cell vertical
dimensions in MathData::metrics(), because this is where current font
is known.
Introduce BufferView::setCaretAscentDescent to remember this value.
This mechanism is not used for text because Cursor::current_font is
restored by undo, and the caret height would not be changed then. But
in principle it is doable.
(cherry picked from commit 90cfe4ec3b)
We have a couple of converters (using Sweave and knitr to "tangle"
an intermediate file) that are used for exporting code chunks
contained in a .lyx file. Since the code is just exported to a text
file and is not executed, needauth is not necessary.
(cherry picked from commit 065e37e96f)
This commit fixes an issue where the menu option "Insert Separated
Frame Below" would show up twice, with one instance disabled. This
occurred when there was a "Standard" environment nested in a
"Frame". With this commit, the duplicate instance is removed.
(cherry picked from commit 4f7a5f8c3e)
The fixes are simple and on line with the changes made during
the 2.3 development. It was an oversight to leave them out.
With this commit all the python scripts should be supported by
python 2 and 3.
(cherry picked from 5b160e82be)
When the cursor is inside a subscript that may become empty, metrics
issues can happen. This patch fixes the issue, although it is not
clear to see what the problem is.
Still, requesting a metrics update also in the case where the macro
mode is canceled makes sense.
Fixes bug #11125.
(cherry picked from commit 68ec34e603)
For some reason, special code was added for LFUN_INDEX_INSERT
when it was not actually needed. So just delete it.
(cherry picked from commit 83356ab9fe)
Spaces are, amazingly, allowed at the end of bibliography keys. So we
introduce a new parameter allowing getVectorFromString not to trim
whitespace, and then use it.
For some reason, this seems not actually to have been backported
to 2.3.x.
If a master document is compiled and has errors, and then a child is
compiled without error, the errors from the master compilation were
shown.
The setup of the relevant code is the following:
processingThreadFinished() calls errors(). errors() makes the
assumption that if it is called, there must have been an error
somewhere.
The logic of the setup is the following:
processingThreadFinished() knows whether there was an error on
the most recent preview/export, although it doesn't know whether
the error is from master or child (i.e. does not know whether the
user was compiling the child, or whether master-buffer-view was
called). Inside error(), if there is no error in the child, it is
assumed the error is from master.
For the above logic to work, errors() should only be called if there
was an error.
This commit fixes#11106 and preserves the fix to #7330.
(cherry picked from commit 8d2b121ef5)
This change is made in response to Ticket 10992.
The change made is consistent with those captured in Ticket 9966.
(cherry picked from commit 869e2fe9b9)
This is mandatory for some features (such as bookmarks,pdfusetitle)
to work, and only a handful of drivers can be auto-detected by hyperref.
Fixes: #6418
(cherry picked from commit 33bfbf89c4)
Things like
pdfpagemode=UseOutlines%None,UseOutlines,UseThumbs,FullScreen
was not imported correctly (the comment was not stripped)
Fixes the rest of #5737
(cherry picked from commit 820ec38da7)
Add a new LyXRC variable use_native_filedialog (true by default) that
allows to select the kind of FileDialog we want at runtime.
(cherry picked from commit af795b80d8)
* Describe the viewport/bb situation more accurate
* Use generic term "coordinates", since bb and viewport are flavor-specific
* Add some tooltips
* Increase the width of the options widget.
(cherry picked from commit c462fadff5)
Some classes provide a \bibliographystyle, so we must not output any
\bibliographystyle if none is set in the TeX file.
Fixes: #10673
(cherry picked from commit ed331bedd6)
Add a `cancel' boolean to macroModeClose() that just removes all trace
of what has been entered instead of finalizing it.
When entering a macro in mathed, let LFUN_ESCAPE invoke
macroModeClose(true). The new semantics of LFUN_ESCAPE in mathed is
thus to abort the input of a macro name.
Fixes bug #9251.
(cherry picked from commit 9296344b9a)
As of v. 1.7.7, chktex has four exit values. Only consider the program
failed with EXIT_FAILURE (1). This is backwards compatible to chktex
up to v. 1.7.5 and later patched versions included in TeXLive, where
there was the distinction EXIT_FAILURE (program failed) and EXIT_SUCCESS
(program successfully run, with or without something to report).
Note that ChkTeX v. 1.7.5 and 1.7.6 vanilla (as included in MikTeX) also
returned EXITE_FAILURE if ChkTeX found something to report.
We do not, and never did, support this case.
Fixes: #9989 (after ChkTeX 1.7.7. is released).
(cherry picked from commit 0d806799aa)
* Consider new quote styles
* Consider changed quote styles
* Try to be a bit smarter with ambiguous quotation marks
(cherry picked from commit 8184f08f4a)