Commit Graph

284 Commits

Author SHA1 Message Date
Richard Heck
c6a16909e0 Status for last two commits. 2017-10-23 16:36:34 -04:00
Enrico Forestieri
054b7c68a4 Speed up exit time
Instantiating a single QSettings and using it for each ui element
can significantly shorten the time required to save the various
states at exit. The speed up can be better appreciated on *nix,
where the settings are saved on disk, rather than on Windows where
they are held in memory (in the registry).
2017-10-18 22:11:56 +02:00
Stephan Witt
108deae543 This change solves dialog stacking problems on newer Mac OS X in combination with the OS provided file open dialog.
(cherry picked from commit 97dc585138)
(cherry picked from commit 1460e8fe6f)
2017-10-14 17:58:10 +02:00
Juergen Spitzmueller
5ba05b546b Do not error on missing ZWNJ (ligature break) characters.
Since TeXLive 2016, "fontspec" maps the ligature break command
\textcompwordmark to the ZWNJ character (U+200C).
This character is missing in many fonts (including the default: Latin
Modern) which leads to "Missing character" warnings in the XeTeX/LuaTeX
log file if a document using non-TeX fonts contains a ligature break.

LyX reports missing characters as error since fixing #9610.
In case of "invisible" characters, there is no data loss, in case of the
ZWNJ the functionality is kept: ligatures are prevented also if the ZWNJ
is missing in a font.

Therefore, a missing ZWNJ is now treated similar to missing characters
in "nullfont" (see [63f41711/lyxgit], bug #10394) and does not trigger
an error.

Fixes: #10727
(cherry picked from commit a40868510d)
2017-10-14 17:52:42 +02:00
Juergen Spitzmueller
cd626c2411 Fix PDF output of clipped graphics with recent graphics package
The previous redirection of the senseless option "bb" to "viewport" in
PDFLaTeX output has been removed in a recent graphics package update.

This breaks documents, since clipped graphics silently stop displaying.

This change restores the previous output by using "viewport" instaed of
"bb" for non-PS/DVI output, while leaving PS/DVI untouched (where "bb"
and "viewport" behave differently.

Fixes: #7910
2017-10-13 08:31:37 +02:00
Juergen Spitzmueller
7b41d977ad Fix crash when closing master with children and grandchildren
In some cases, it is possible that the BufferPositionMap has
dangling pointers. We thus check whether the Buffer is loaded
before accessing it.

Fixes: #10766
(cherry picked from commit 4f50cbcfe4)
2017-09-28 09:24:58 +02:00
jpc
1d55d8cd25 Update status.ééx 2017-09-26 18:21:23 +02:00
Jean-Marc Lasgouttes
4db40b11af Use the proper buffer when recording undo
The code in InsetLabel::updateReferences code changes reference insets
in potentially several buffers. When recording undo, it is important
to use the right undo stack, otherwise crashes can ensue.

Once it is done, it is neccessary to create undo groups as needed.
This is done using UndoGroupHelper. This demonstrates a shortcoming of
UndoGroupHelper: if a buffer is encountered in two seperate
occasions, two undo groups will be created for this buffer. This is
not correct.

Fixes bug #10643.

(cherry picked from commit 4eb9b50dc6)
2017-09-03 18:35:37 +02:00
Jean-Marc Lasgouttes
8ff22de938 When a row is shortened, reset its flushed() attribute.
Fixes bug #10699.

(cherry picked from commit 59e2c40564)
2017-09-03 18:34:01 +02:00
Jean-Marc Lasgouttes
48904cc5a1 Fix computation of string width when using a QTextLayout
It was not a good idea to rely on QTextLine::naturalTextWidth() to
compute a string width. The correct method is horizontalAdvance().

Also round the value to the nearest pixel, since this is what
QFontMetrics::width() does.

By contrast with the code in 2.3.x/master, this code had to be adapted
for Qt < 4.7, where horizontalAdvance() is not defined and
naturalTextWidth() has to be used instead. The fix is thus only
effective starting from Qt 4.7.

Fixes bug #10700 (and maybe others).

(cherry picked from commit c874641e95)
2017-08-29 15:15:39 +02:00
Juergen Spitzmueller
86e54f6cc7 Babel option for Vietnamese is called "vietnamese"
The renaming happened in 2013. Contrary to what is stated in the
babel-vietnamese manual, option "vietnam" does not work anymore.

Also, the special care is not needed anymore, since language options
are not hardcoded anymore in babel.

Fixes: #10743
2017-08-13 18:43:26 +02:00
Juergen Spitzmueller
f1428488b1 Add missing break
As correctly pointed out by gcc7.
2017-08-13 09:32:51 +02:00
Uwe Stöhr
8f476415ea status.22x: move crash fixes up
- also correct a bug number
2017-07-26 01:32:36 +02:00
Juergen Spitzmueller
5eda278c80 Properly import \newtheorem*
Fixes: #10622
2017-07-25 18:28:47 +02:00
Juergen Spitzmueller
f61e88b7dd Update parent buffer as soon as a child has been released
This prevents dangling pointers that might crash LyX.

Fixes: #9979.
2017-07-17 10:34:58 +02:00
Jean-Marc Lasgouttes
e5105a0dce Do not use toobar menu as fallback context menu
This is a consequence of 060a9664, although it is not clear why. The
contextMenuEvent code of the workarea should not delegate context
menu when it cannot honor it.

Also fix a small memory leak.

Fixes bug #10616.

(cherry picked from commit ab81c23656)
2017-07-15 16:21:41 +02:00
Juergen Spitzmueller
476705ba76 Load color before polyglossia also in preview snippets
This fixes an error in the preview generation with polyglossia
and bidi that prevents snippet generation (and consequently also
"math as image" xhtml output).

Fixes: #10716.
2017-07-15 15:05:34 +02:00
Enrico Forestieri
0237292eb1 Fix bug #10546
A labeled equation is also numbered.
2017-07-09 23:31:33 +02:00
Jean-Marc Lasgouttes
4fbb0f1770 Avoid crash when selecting long text
In some (not yet understood) situations, the paragraph metrics cache
is empty in generateSyntheticMouseEvent(). We just avoid a crash in
this case, but there is probably an underlying problem that deserves
being fixed.

Fixes bug #10324.

(cherry picked from commit 4efb129ccb)
2017-07-05 10:59:26 +02:00
Juergen Spitzmueller
9c0dd478df Catch xdvipdfmx driver error (that breaks XeTeX compilation).
This prevents an assertion due to an unrecognized error.

Fixes: #10076.
2017-07-04 10:48:45 +02:00
Juergen Spitzmueller
678f3e7589 natbibapa.module: Do not overwrite preamble.
Also add author information.
2017-07-03 16:28:40 +02:00
Enrico Forestieri
68bc505029 Fix bug #10705
Seemingly, std::regex does not account for newlines in the string.
2017-06-26 23:10:30 +02:00
Guillaume MM
ba5e8c443e Fix crash with full view source (#10560 and #10617) 2017-06-17 20:05:59 +02:00
Jean-Marc Lasgouttes
1c07c0dc38 Make fixIfBroken() more robust
Chop slice when its inset is not editable.

Fixes bug #10667.

(cherry picked from commit 522516d99e)
2017-06-17 13:07:36 +02:00
Juergen Spitzmueller
f7aabdd9fa Catch "! Incomplete \\if[x]" error
Fixes: #10666
2017-06-16 10:05:12 +02:00
Jean-Marc Lasgouttes
5f08a1b41d When entering an inset by cursor, reset boundary
This happens when cursor-left/right enters an inset.

Fixes bug #10630.

(cherry picked from commit 2e84b8030e)
2017-06-15 10:31:14 +02:00
Jean-Marc Lasgouttes
c492f22593 Set cursor properly after double/triple click in mathed
Without this setCurrentFont() is not correctly called on the
BufferView cursor and the cursor could appear in L-form.

Fixes bug #10686.

(cherry picked from commit 5d7dae9e38)
2017-06-15 10:21:18 +02:00
Jean-Marc Lasgouttes
8fef81a373 Avoid rounding issue when painting selection
This issue was already addressed in the all_sel case. It only happens
at specific zoom and jusification values.

Fixes part of #8883.

(cherry picked from commit 71563835c7)
2017-06-12 14:47:32 +02:00
Jean-Marc Lasgouttes
04efc84abc Fix bad cursor positioning when entering an inset
The test added at 359aef92 was incorrect. Actually, Inset::editXY
returns the inset when it is edited and also when it is not, which
can be confusing. So if we are unlucky and the slices positions in the
text area and in the inner inset match, the code below triggers and
many bad things can happen.

Also improve the documentation of Inset::editXY and TextMetrics::editXY.

Fixes #10691.

(cherry picked from commit c9fefd5a2c)
2017-06-12 13:57:46 +02:00
Uwe Stöhr
8429a27494 ja.po: updates from Koji 2017-06-06 23:35:33 +02:00
Enrico Forestieri
d738151a9b Fix bug #10685
Make sure to properly nest \begin{lang} and \end{lang} tags even
when no language package is selected. In this case, LyX assumes
that babel is being used, so the language names might be wrong
if the user arranged for using polyglossia in the preamble.
Nevertheless, we assure that the produced output is syntactically
correct, so that by adding proper preamble code a correct output
is still possible.
2017-06-06 00:01:14 +02:00
Enrico Forestieri
59c22bd7b6 Fix bugs #9598 and #10650 2017-06-05 23:14:48 +02:00
Enrico Forestieri
4945fabff1 Fix bug #10636
The code was not accounting for partial preview of the source code
and was trying to pop a language that was never pushed.
2017-06-05 22:59:25 +02:00
Jean-Marc Lasgouttes
04350ad288 Cache QTextLayout objects with Qt/Mac
It seems that the internal Qt5 caching does not work well here,
especially in the case of ancient Hebrew documents.

(cherry picked from commit 5354c64b27)
2017-06-01 10:54:28 +02:00
Jean-Marc Lasgouttes
413de12adf Take in account end of paragraph marker for inset width
When an inset wants to use the whole available width, it is necessary
to take into account that some of this width may already be taken by
the end-of-paragraph (pilcrow) marker.

Fixes bug #10537.

(cherry picked from commit 91f3b21e42)
2017-05-30 11:59:35 +02:00
Richard Heck
f92744d18d These two routines are now redundant.
(cherry picked from commit c19794a013)
2017-05-24 23:44:03 -04:00
Jean-Marc Lasgouttes
db9f41c039 Work around bug in QTextLine::xToCursor
With RtL text, the method can be non-monotonic wrt x value (which is a
Qt bug). To work around this, we check whether positions adjacent to
those returned by xToCursor look better. Depending on whether the new
x position is too small or too large, we look backward or forward for
a better solution.

The performance is probably not great, but this is only needed for
user interactions, so the performance penalty should not be a problem.

Fixes part of #10569.

(cherry picked from commit da590925cd)
2017-05-23 10:50:08 +02:00
Enrico Forestieri
05d4332152 Fix bug #10469 2017-05-20 02:36:16 +02:00
Uwe Stöhr
7b0f63f67b Color.cpp: backport fix for bug #10656 2017-05-16 23:47:35 +02:00
Uwe Stöhr
e40205e749 InsetFloat.cpp: backport fix for bug #10618 2017-05-16 23:44:32 +02:00
Juergen Spitzmueller
0887f89350 Do not add symbols twice to Encoding::symbolsList()
Also sort the list properly.

Fixes #10644
2017-05-16 13:37:29 +02:00
Richard Heck
eb4723a589 Start 2.2.4 development. 2017-05-15 21:35:33 -04:00
Uwe Stöhr
f0877e26c0 ia.po: updates for 2.2.3 from Giovanni 2017-04-29 16:00:36 +02:00
Uwe Stöhr
826b704b31 backport fix for bug #10440
thanks Enrico!
2017-04-20 22:20:50 +02:00
Uwe Stöhr
0271602b8d - backport fix for bug #10466
Handle the command \multicolumn correctly in math macros
2017-04-18 23:53:27 +02:00
Uwe Stöhr
a3edc38747 status.22x: the image update deserves an entry 2017-04-16 19:57:59 +02:00
Uwe Stöhr
64206d3725 lyx2lyx/lyx_2_2.py: fix 2 issues with the reversion of boxes 2017-04-16 16:37:05 +02:00
Uwe Stöhr
a9e154cdee PDF-form.lyx: New German translation
- also many fixes and updates of the English version
- also some according fixes in de.po
2017-04-15 04:59:30 +02:00
Uwe Stöhr
a526ff58c1 GuiDialog.cpp: remove question marks from Windows dialogs
backported from master, fixes bug #10098, patch from Guillaume
2017-04-04 23:54:31 +02:00
Enrico Forestieri
caf56220c6 Fix bug #10554
The \lyxdeleted macro cannot cope with \newpage & co.
2017-04-03 00:07:53 +02:00