Commit Graph

302 Commits

Author SHA1 Message Date
Juergen Spitzmueller
93dd9cd229 Update tex2lyx tests
Fixes: #10800.
2018-03-11 09:11:31 +01:00
Juergen Spitzmueller
cd6a31c0d4 syntax.default: add missing *
Fixes: #10501
(cherry picked from commit 23766fdd59)
2018-03-10 10:51:29 +01:00
Uwe Stöhr
ecc9fde511 status.22x: fix a typo 2018-03-03 12:23:16 +01:00
Uwe Stöhr
3ed0dc700e configure.py: add quotes around path to python
fixes bug #11053
2018-03-03 12:19:28 +01:00
Pavel Sanda
17544670de * status.22x 2018-02-24 01:33:26 +01:00
Uwe Stöhr
a57b0bf3e5 status.22x: mention Arabic 2018-02-23 22:35:13 +01:00
Jean-Marc Lasgouttes
66fd21adcb Kill macro mode when using LFUN_ESCAPE
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)
2018-02-21 11:24:32 +01:00
Juergen Spitzmueller
77d10ca20a Localize items in view/update popup icons
Fixes: #11040
(cherry picked from commit 578cf77f6f)
2018-02-21 09:50:34 +01:00
Juergen Spitzmueller
a049bfef7a tex2lyx: normalize bib and bst paths
Fixes: #7637
(cherry picked from commit 3cc98a9bf6)
2018-02-10 07:53:41 +01:00
Juergen Spitzmueller
0c95259589 Reset cur.pit() when pasting into tables.
The number of paragraphs can change here, so pit() can become invalid.

Fixes: #9983
(cherry picked from commit 6e4e086900)
2018-02-09 09:55:28 +01:00
Juergen Spitzmueller
a9eee8e1c0 Use proper localization chain for Box special width/height
Fixes: #11000
(cherry picked from commit e2160ec960)
2018-01-28 09:01:03 +01:00
Juergen Spitzmueller
0df51f0f85 Make GUI string translatable
Part of #10999

(cherry picked from commit 26755a015e)
2018-01-28 08:49:37 +01:00
Jean-Marc Lasgouttes
f66807dd80 Fix repaint of unselected paragraph label
This works around a TextMetrics issue where Row::beg/end_margin_sel
are sometimes not reset correctly when there is no selection on the
row.

In master a fix for this problem has been done at 654cded1. Here we
prefer a much simpler work around that fixes the symptom.

Fixes bug #10972.

(cherry picked from commit 9bec4b8a0a)
2018-01-16 09:43:53 +01:00
Jean-Marc Lasgouttes
02b248d270 Handle properly undo groups in embedded work areas
When a buffer is in an embedded work area (adv. find&replace), it is
not found by BufferList:::exists(), and therefore the undo group
created in GuiApplication::dispatch and in the handling of
LFUN_COMMAND_SEQUENCE will not be closed. Crashes can ensue, as
described in Ubuntu bug:
https://bugs.launchpad.net/bugs/1737429

The solution is to introduce BufferList::isInternal and act on it.

Fixes bug #10847.

(cherry picked from commit 8b107f0490)
2017-12-23 19:35:17 +01:00
Juergen Spitzmueller
6ef5e10e66 InsetExternal: update renderer after preview status change
This fixes a crash when changing instant preview prefs while
document with previewed external inset is opened.

Fixes: #10785
(cherry picked from commit 0842e22f45)
2017-11-13 09:54:37 +01:00
Juergen Spitzmueller
9235d5299e Mark some intentional fall-throughs (in a way understandable to gcc)
This silences -Wimplicit-fallthrough warnings with gcc7.
2017-11-10 13:07:00 +01:00
Enrico Forestieri
3628ceec48 Fix #10778 (issue with CJK and language nesting)
When using CJK, don't try to close a language that was never
opened before, such as when it is the main language.
2017-11-08 08:44:00 +01:00
Juergen Spitzmueller
16fcce1f71 Enable OK/Apply buttons when resetting to class defaults.
(cherry picked from commit b851a349b6)
2017-11-01 18:07:56 +01:00
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