Commit Graph

24736 Commits

Author SHA1 Message Date
Juergen Spitzmueller
dadec50a18 Fix race condition in processFuncRequestQueue
The issue here was that the element was only removed from the queue
after the func request was processed, but within that process, other
function could access the queue, so the queue could even be empty
when this function finally wanted to remove the item.

Fixes: #10406.
2018-02-10 15:35:12 +01:00
Juergen Spitzmueller
4311571b9d Fix Windows compiler warning about double declaration of "it"
See #10912
2018-02-10 08:23:18 +01:00
Pavel Sanda
a3ad39c770 Cosmetics per JMarc's suggestions. 2018-02-09 23:46:56 +01:00
Enrico Forestieri
8e8b3f6104 Avoid an infinite loop
When pasting "\big" without any following delimiter, avoid
processing the same token again and again. For unknown reasons,
the delim docstring turns out to always be not empty: even when
it simply contains a '0' (no delimiter follows), its length is 1.

Fixes bug #11027.
2018-02-09 23:42:24 +01:00
Juergen Spitzmueller
3cc98a9bf6 tex2lyx: normalize bib and bst paths
Fixes: #7637
2018-02-09 13:23:50 +01:00
Juergen Spitzmueller
398e026250 Fix child document regex in scanLogFile
Several problems:
* The regex failed at names such as 1_text_2_text.tex
  (returned "2_text.tex)
* The regex failed at names such as 12_text.tex
  (returned "2_text.tex)
* Masters with digits in the name (2018_text.tex) were
  tracked as their own children
2018-02-09 11:46:43 +01:00
Pavel Sanda
b7caaf6196 Proper naming of LFUN_SET_GRAPHICS_GROUP. 2018-02-08 21:59:41 +01:00
Pavel Sanda
6e1ca3a4f2 Group similar lfuns. 2018-02-08 21:53:08 +01:00
Pavel Sanda
b88ed81e7f Unify graphics-groups inside marked block functionality.
Fixes #11026.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg203683.html
2018-02-08 21:33:37 +01:00
Juergen Spitzmueller
6e4e086900 Reset cur.pit() when pasting into tables.
The number of paragraphs can change here, so pit() can become invalid.

Fixes: #9983
2018-02-08 19:06:35 +01:00
Juergen Spitzmueller
9987adb2a7 Revert "Mark follow-up paragraphs in a paragraph group as nested."
This reverts commit 761a542551.
2018-02-08 17:00:41 +01:00
Juergen Spitzmueller
2f6ada6644 Consider class-provided citation engines
Do not attempt to load, nor allow to set, a different engine in this
case.

Fixes: #11022
2018-02-08 13:25:19 +01:00
Juergen Spitzmueller
84658d37e2 Remove createTempFile method
and use the new and safer tempFileName() method instead for the creation
of temporary directories
2018-02-08 12:16:30 +01:00
Juergen Spitzmueller
9e2928be68 Re-add method to get a temporary file name without persistent QTemporaryFile object
This is needed for cases where the temp file has to be manually removed
at some point (e.g., if temp files are used as conversion target, and
the initial file only serves as a placeholder), since QTemporaryFile
objects cannot be manually removed at least on Windows (they are always
kept open internally even after close()). See
​http://lists.qt-project.org/pipermail/interest/2013-August/008352.html

In order to avoid race conditions due to duplicate names (the issue why
the old method was removed), we record all used temp file names.

Fixes: #9139
2018-02-08 11:31:23 +01:00
Pavel Sanda
41f59527d1 * comment 2018-02-07 23:24:05 +01:00
Pavel Sanda
1e5b471d58 * comment 2018-02-07 23:19:20 +01:00
Juergen Spitzmueller
c6861923f0 Add missing break and polish formatting. 2018-02-07 10:16:05 +01:00
Juergen Spitzmueller
92990adc23 Do not use English, but the context language, when pasting from math
Fixes: #2596
2018-02-06 14:10:12 +01:00
Juergen Spitzmueller
e85704020b Do not use English, but the context language, when pasting from LaTeX
Fixes: #9199
2018-02-06 13:20:45 +01:00
Juergen Spitzmueller
6236bcb653 Add missing connection.
This activates the OK/Apply when a biblatex style file is changed
manually
2018-02-06 12:45:22 +01:00
Pavel Sanda
96cb9e9cea forgotten glitch 2018-02-03 22:43:00 +01:00
Pavel Sanda
89b7f12a3b LFUN_DOC_ANONYMIZE -> LFUN_BUFFER_ANONYMIZE per JMarc's suggestion. 2018-02-03 22:05:49 +01:00
Pavel Sanda
c19c3899d1 Add LFUN_DOC_ANONYMIZE, quick fix for #7259. 2018-02-02 23:42:56 +01:00
Pavel Sanda
a76334c78a * doxy 2018-02-02 23:42:33 +01:00
Juergen Spitzmueller
5ce36019e5 Enable CompressorProxy for all Workareas (incl. EmbeddedWorkarea)
This fixes the Advanced F&R.
2018-02-01 14:58:49 +01:00
Jean-Marc Lasgouttes
173f9282e0 Fix Cursor::sanitize
This is a follow-up to 02028c0b12.

Fix two bugs introduced when moving Cursor::sanitize() to CursorData:

* the setBuffer that is supposed to set buffer from bufferview became
  a no-op.

* new_word_ is now part of CursorData, but it is sanitized only in
  Cursor::sanitize().

Additionally, make all protected CursorData data members private to enforce
encapsulation.
2018-01-31 23:07:59 +01:00
Jean-Marc Lasgouttes
2e633645ed Make CursorData::checkNewWordPosition() more robust
Before accessing things like new_word_.lastpos(), it is better to make
sure that new_word_ points to something that exists. Therefore, the
call to fixIfBroken() is moved in first position.

Other changes: inTexted() is replaced by a more general test that
current inset has not changed; test idx() in addition to pit().
2018-01-31 16:26:45 +01:00
Günter Milde
0d9708ef04 Use LaTeX macros instead of Latin transcription for Greek characters.
Use the LaTeX internal character representation (LICR) macros
provided by lgrenc.def (since version 0.8 from 2013-05-13)
in lib/unicodesymbols. This fixes the PDF bookmarks (except for the
legacy input encoding iso-8859-7) and solves the problem of a missing
"v" character in Libertine LGR fonts (see lyx-users from 2018-01-29).

The ctest unicodesymbols/008-greek-and-coptic_iso8859-7_pdf2" now fails
(due to #9681). This is not a regression, as it is already
"unreliable" (wrong output, Latin character instead of Greek).

Drop compatibility definition of \~ as perispomeni accent
(that was required with lgrenc.def < 0.8).
2018-01-30 22:31:08 +01:00
Jean-Marc Lasgouttes
63a4e82874 Add support for enchant 2.x
As of enchant 2.x, it is required to create a Broker instance instead
of relying on a static one provided by the library.

Add autoconf and cmake (courtesy of Kornel) tests that check whether
one can indeed instantiate a Broker object, and act on the result in a
new broker() helper function.

Fixes bug #10986.
2018-01-30 12:11:22 +01:00
Jean-Marc Lasgouttes
c2ed75fd37 Fixup 6b6fa94c: coverity says there are more possible exceptions.
The bulk of the changes is indentation.
2018-01-29 15:06:32 +01:00
Jean-Marc Lasgouttes
6b6fa94c91 Catch exceptions to please coverity
Actually, the possible exception path is from replaceEnvironmentPath.
It would be better if coverity was able to asses that our hardcoded
regexp:s are correct.
2018-01-29 13:50:09 +01:00
Juergen Spitzmueller
10f02c4160 Whitespace 2018-01-29 08:37:25 +01:00
Richard Heck
d3ee87eea2 Fix bug #11055.
See also https://marc.info/?l=lyx-devel&m=151709211602688&w=2.
2018-01-28 23:37:20 -05:00
Richard Heck
d24a1c8fa4 Whitespace. 2018-01-28 23:37:20 -05:00
Juergen Spitzmueller
5db4d712ef Differentiate Buffer strings and GUI strings in citeengines
The former need to be translated to the buffer language, the latter to
the GUI language.

Fixes: #10946
2018-01-27 14:29:41 +01:00
Jean-Marc Lasgouttes
253b935f65 Make sure to add at least one element in row if possible
breakRow should only produce an empty row when there is nothing left
in the paragraph.

Fixes bug #10996.
2018-01-27 12:32:52 +01:00
Juergen Spitzmueller
e2160ec960 Use proper localization chain for Box special width/height
Fixes: #11000
2018-01-27 12:26:01 +01:00
Juergen Spitzmueller
6ed7bbbf7e Make another GUI string translatable
Part of #10999.
2018-01-27 11:20:11 +01:00
Juergen Spitzmueller
26755a015e Make GUI string translatable
Part of #10999
2018-01-27 10:57:33 +01:00
Jean-Marc Lasgouttes
d789a3c941 Fix embarrassing thinko (fixup 1a969fa4a6)
Now people know for sure that I sometimes forget to test that code
actually works before committing. It was so straightforward, what
could possibly go wrong?
2018-01-26 10:06:28 +01:00
Juergen Spitzmueller
f924ef2966 Properly communicate forced encodings
This is currently only relevant fo InsetListings, which falls back to
a fixed-width encoding under specific conditions. It is now possible
to query the inset about that and report the correct encoding in
DocIterator::getEncoding.

Addresses the second part of #10995
2018-01-26 08:38:52 +01:00
Juergen Spitzmueller
7b169de401 Account for custom encoding in DocIteratior::getEncoding
Addresses #10995
2018-01-26 08:37:06 +01:00
Jean-Marc Lasgouttes
1a969fa4a6 New method zoomedPixel to compute pixel amount also in HiDpi
The function does not use for now any information from the BufferView
(only lyxrc), but this should eventually change if we want to honor
multi monitor setups properly.
2018-01-25 22:08:35 +01:00
Enrico Forestieri
144f06a00c Correctly output a single char_type
On platforms where char_type is typedef'd to an integral type
rather than to wchar_t, when using the insertion operator <<
a single char_type is output as the number corresponding to the
code point of the character rather than as the character itself.
In this case, one has to use put().
2018-01-25 09:40:36 +01:00
Jean-Marc Lasgouttes
e63b891de5 Better debug message 2018-01-24 14:05:57 +01:00
Juergen Spitzmueller
5fce313ffc Fix output of quote ligatures with TeX font LuaTeX
Fixes: #10988
2018-01-21 12:24:02 +01:00
Richard Heck
f8ca747109 Introduce Inset::asInsetGraphics.
Then use it to avoid explicit LyXCode checks in the graphic group
code.
2018-01-20 23:00:15 -05:00
Juergen Spitzmueller
2f854bdf8c remove unnecessary braces 2018-01-20 10:39:18 +01:00
Jean-Marc Lasgouttes
76a8ca27a7 Set endlabel color correctly when there is a selection
Current code would change the color of static endlabel when the
_start_ of line is selected. This is only used with hollywood and
broadway layouts, though.

Change the box endlabel painting code to use Color_selectiontext as needed.

Follow-up to bug #10972.
2018-01-16 14:10:30 +01:00
Jean-Marc Lasgouttes
654cded167 Partial cleanup of the row selection code
This is preliminary work, this code still feels too complicated for
its own good.

Let Row::isMarginSelected return false when Row::selection() is false
(the other changes are indentation).

This allows to remove the test for selection() in
setSelectionAndMargins, so that begin/end_margin_sel are always set
correctly.

Add clearSelectionAndMargins() instead of calling directly setSelection
(which is now private) with arguments (-1, -1).

Fixes bug #10972.
2018-01-15 17:20:34 +01:00