Commit Graph

24559 Commits

Author SHA1 Message Date
Juergen Spitzmueller
388a284688 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
(cherry picked from commit 9e2928be68)
2018-02-14 17:24:37 +01:00
Jean-Marc Lasgouttes
e11c8ba81b Disable and hide the pixmap cache feature 2018-02-14 10:12:11 +01:00
Richard Heck
0dfca93139 Fix crash when citeengine is unknown.
(cherry picked from commit 5ee3396459)
2018-02-12 23:31:42 -05:00
Juergen Spitzmueller
fe414fcdd8 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.
(cherry picked from commit dadec50a18)
2018-02-10 18:32:03 +01:00
Enrico Forestieri
e43bf58223 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.

(cherry picked from commit 8e8b3f6104)
2018-02-10 10:36:48 +01:00
Juergen Spitzmueller
2d923e4243 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

(cherry picked from commit 398e026250)
2018-02-10 07:59:30 +01:00
Juergen Spitzmueller
04e995e807 tex2lyx: normalize bib and bst paths
Fixes: #7637
(cherry picked from commit 3cc98a9bf6)
2018-02-09 18:57:53 +01:00
Juergen Spitzmueller
af91405786 Consider class-provided citation engines
Do not attempt to load, nor allow to set, a different engine in this
case.

Fixes: #11022
(cherry picked from commit 2f6ada6644)
2018-02-09 09:50:43 +01:00
Juergen Spitzmueller
5549d3033f 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:37:51 +01:00
Juergen Spitzmueller
78911c7379 Revert "Mark follow-up paragraphs in a paragraph group as nested."
This reverts commit 70d580fea7.
2018-02-08 17:09:15 +01:00
Juergen Spitzmueller
4285438558 Add missing connection.
This activates the OK/Apply when a biblatex style file is changed
manually

(cherry picked from commit 6236bcb653)
2018-02-06 17:58:13 +01:00
Juergen Spitzmueller
14e0a27098 Enable CompressorProxy for all Workareas (incl. EmbeddedWorkarea)
This fixes the Advanced F&R.

(cherry picked from commit 5ce36019e5)
2018-02-03 09:43:36 +01:00
Jean-Marc Lasgouttes
19c90f3a89 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.

(cherry picked from commit 253b935f65)
2018-01-30 11:07:44 +01:00
Jean-Marc Lasgouttes
34c1b3c42c Remove 'premature optimization' that proved buggy
At some time it seemed like a good idea in breakRow() to return early
when the row was bound to be empty. It turns out that this creates two
symptoms:

* empty paragraphs will not have an end of paragraph marker

* since row width is not correctly computed in this case, caret ghosts
  can appear in master.

This commit removes the oprimization and replace the do {} while()
construct to a straightforward while() {}.

Related to bug #10952.

(cherry picked from commit 76f0a3dd4e)
2018-01-30 11:06:30 +01:00
Juergen Spitzmueller
275d5d30de 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
(cherry picked from commit 5db4d712ef)
2018-01-30 08:21:21 +01:00
Richard Heck
bb30118ff4 Revert "Fix bug #11055."
This reverts commit 0be5ae123c.

Unintentionally committed. Sorry!!
2018-01-28 23:51:40 -05:00
Richard Heck
0be5ae123c Fix bug #11055.
See also https://marc.info/?l=lyx-devel&m=151709211602688&w=2.

(cherry picked from commit d3ee87eea2)
2018-01-28 23:46:39 -05:00
Juergen Spitzmueller
cf6ff2cac7 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

(cherry picked from commit f924ef2966)
2018-01-27 18:35:16 +01:00
Juergen Spitzmueller
463c994de2 Account for custom encoding in DocIteratior::getEncoding
Addresses #10995

(cherry picked from commit 7b169de401)
2018-01-27 18:34:51 +01:00
Juergen Spitzmueller
fdc98c3fa8 Make another GUI string translatable
Part of #10999.

(cherry picked from commit 6ed7bbbf7e)
2018-01-27 18:30:14 +01:00
Juergen Spitzmueller
47adfa661e Make GUI string translatable
Part of #10999

(cherry picked from commit 26755a015e)
2018-01-27 18:29:46 +01:00
Juergen Spitzmueller
d65eee3688 Use proper localization chain for Box special width/height
Fixes: #11000
(cherry picked from commit e2160ec960)
2018-01-27 18:25:52 +01:00
Jean-Marc Lasgouttes
f27d2cfa30 Revert "Remove 'premature optimization' that proved buggy"
This reverts commit 894ae19224.

Fixes bug 10996.
2018-01-27 12:18:25 +01:00
Juergen Spitzmueller
8cc7fe1c4b Fix outliner movement of frames
Make sure frames are properly separated from their neighbors above
and below in the target location.

Fixes: #10977.
2018-01-27 09:59:19 +01:00
Enrico Forestieri
8b0280d216 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().

(cherry picked from commit 144f06a00c)
2018-01-25 20:49:45 +01:00
Juergen Spitzmueller
17e241c694 Fix output of quote ligatures with TeX font LuaTeX
Fixes: #10988
(cherry picked from commit 5fce313ffc)
2018-01-22 09:24:59 +01:00
Juergen Spitzmueller
34097ce8f0 Prevent to paste uncodable characters into verbatim
Since we now have proper encoding here, we can set this restriction.

(cherry picked from commit 54846d2d93)
2018-01-20 09:23:00 +01:00
Juergen Spitzmueller
74a1666531 Introduce "inherit" encoding for latex_language
This gets rid of the hardcoded latin1 encoding for verbatim. Instead,
verbatim now inherits the encoding from the context, which is what is
actually wanted here.

Fixes: #9012, #9258
2018-01-20 09:22:38 +01:00
Jean-Marc Lasgouttes
93893396e4 Initialize properly class member
Spotted by coverity.

(cherry picked from commit 2ba00ecb7b)
2018-01-19 09:33:53 +01:00
Juergen Spitzmueller
b0868e6eb1 Use qt4-compatible connect() syntax.
Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
(cherry picked from commit aab58fed6b)
2018-01-19 09:33:06 +01:00
Guillaume MM
789617b818 Install a new compressor
A brand new event compressor based on Kuba Ober's cleverly simple
solution: <https://stackoverflow.com/a/21006207>.

Fix #9362, #9461, #9933: Lyx suddenly gets keyboard keys wrong, and
deadlocks

Fix #9790: LyX should perform key event compression (for improving the
remote X connections one would also need to implement
Qt::WA_KeyCompression)

Fix #10516: slowness on repeated arrow keys with IBus and Qt5

Patch pulled from
https://github.com/gadmm/lyx-unstable/commit/bf5a1efb0db5bfc2b

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
(cherry picked from commit 43e4b80734)
2018-01-19 09:32:32 +01:00
Jean-Marc Lasgouttes
9bec4b8a0a Fix repaint of unselected branch
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.
2018-01-16 09:37:30 +01:00
Jean-Marc Lasgouttes
894ae19224 Remove 'premature optimization' that proved buggy
At some time it seemed like a good idea in breakRow() to return early
when the row was bound to be empty. It turns out that this creates two
symptoms:

* empty paragraphs will not have an end of paragraph marker

* since row width is not correctly computed in this case, caret ghosts
  can appear in master.

This commit removes the oprimization and replace the do {} while()
construct to a straightforward while() {}.

Related to bug #10952.

(cherry picked from commit 76f0a3dd4e)
2018-01-15 09:49:10 +01:00
Juergen Spitzmueller
9b603d90c8 Fix loop while separating
getMaxDepthAfter() gives wrong result here.

Fixes: #10979

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
(cherry picked from commit bceaa7f929)
2018-01-13 10:01:44 +01:00
Juergen Spitzmueller
9e8d702d63 Fix Null-checking issue detected by Coverity.
(cherry picked from commit 974553d858)
2018-01-12 10:31:40 +01:00
Pavel Sanda
f91e77d18e RCS: commit undo allowed only in unlocked state. 2018-01-11 23:47:41 +01:00
Juergen Spitzmueller
70d580fea7 Mark follow-up paragraphs in a paragraph group as nested.
This gives a more consistent indication of what belongs to an environment
(and semantically, such paragraphs are synonymous to nested standard
paragraphs)

Addresses part of #9261.
2018-01-07 10:38:30 +01:00
Jean-Marc Lasgouttes
572b29b139 Update buffer when an inset or an INFO inset has bee inserted
This is important for info inset, since if updateBuffer needs to be
run in redoParagraph (for the macro code), crashes can happen.

Fixes bug #10944.

(cherry picked from commit 806f40dbd4)
2018-01-06 15:08:42 +01:00
Guillaume MM
225d47f298 Fix preview with a nested preview not being shown (#10795)
Regression at db581113.

(cherry picked from commit 94c65074e0)
2018-01-06 02:58:36 -05:00
Richard Heck
b92ddb0362 Fix bug #10951.
The Buffer member for the remembered definition_ was not being set.

(cherry picked from commit f130f7713f)
2018-01-04 15:26:57 -05:00
Juergen Spitzmueller
cf97ec4a21 Do note attempt to nest more than possible.
(cherry picked from commit 32efb91438)
2018-01-04 18:40:26 +01:00
Juergen Spitzmueller
7668633b94 Properly handle color none.
Fixes: #5870
(cherry picked from commit 9a1eeb8cbb)
2018-01-04 08:23:04 +01:00
Juergen Spitzmueller
d3ca12a5c2 Disable useless environment-split function at the core.
(cherry picked from commit f965d23633)
2018-01-03 13:19:24 +01:00
Juergen Spitzmueller
1b2dd66f78 Use the command-alternatives sequence as defined in menus.bind
Otherwise, the shortcut is not displayed in the menu.

(cherry picked from commit 7d2764fb9e)
2018-01-03 11:00:47 +01:00
Juergen Spitzmueller
d60fa7f501 Prepend "Insert " in the context menu for environment separators.
(cherry picked from commit 8f86feb260)
2018-01-01 13:42:38 +01:00
Juergen Spitzmueller
92613ac63c Implement environment-split before and previous
Possibility to add an environment before the current one and to append
and environment from outside the nesting scope.

This commit includes all fixes that went in during testing these
functions in master. It also moves the menu items from Edit to Insert.
2018-01-01 12:34:39 +01:00
Juergen Spitzmueller
8ad7b0caea Add ignoresep option to layout lfun
This does not force the cursor in a separator paragraph to endpos.

This is needed for environment-split.
2018-01-01 12:31:31 +01:00
Juergen Spitzmueller
12bd7352fd Implement auto-nesting.
Now layouts can specify other layouts that should be nested in and
after the current one (if the layout is switched from the current one
and if it follows a paragraph in the current one).

This is particularly useful for things such as the beamer frames, where
particular layouts are practically always nested.

This is a backport from master, including all fixes.
2018-01-01 12:30:34 +01:00
Juergen Spitzmueller
438b067b5a Properly implement IsTocCaption for Arguments in standard TOC
Fixes: #10631

Candidate for 2.3.x.

(cherry picked from commit 3a4b233dbd)
2017-12-30 11:02:49 +01:00
Juergen Spitzmueller
196032f79f Fix footnotes in table with RevTeX4
These classes come with their own working implementation of table
footnotes, so we are not supposed to use the tablefootnote or
footnote package.

Also add missing outliner name.

(cherry picked from commit dfaa4e9466)
2017-12-28 10:07:56 +01:00