Commit Graph

24753 Commits

Author SHA1 Message Date
Alexander Dunlap
cca365f26c save session when we save a buffer
Implements enhancement #10712.
2018-02-21 11:53:19 +01:00
Juergen Spitzmueller
ab6bd5e319 Fix list of viewable formats in view/update menu.
Also fix list in (currently unused) Export toolbar button.

Fixes: #11044
2018-02-21 10:17:10 +01:00
Juergen Spitzmueller
578cf77f6f Localize items in view/update popup icons
Fixes: #11040
2018-02-20 16:42:01 +01:00
Jean-Marc Lasgouttes
9296344b9a 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.
2018-02-20 13:49:17 +01:00
Jean-Marc Lasgouttes
56e012be83 Improve metrics of equations. More work remains to be done.
Use proper value for above/below skip (12pt) instead of the hardcoded
12 pixels.

Add forgotten skip before display math preview.

Make "too small preview" size dpi-dependent.
Make gap in front of equation (what is it good for, BTW?) dpi-dependent.
2018-02-19 18:36:33 +01:00
Juergen Spitzmueller
0bf8865122 escape label in included listings
Also use docstring rather than string.

Fixes part of #10544
2018-02-19 17:15:31 +01:00
Juergen Spitzmueller
3ad7eed374 grammar 2018-02-18 09:19:03 +01:00
Jean-Marc Lasgouttes
5861df7172 Another go at fixing string metrics
This time, it is the problems with \int in esint and cmex that we are
trying to work around. This code is becoming too complicated to my
taste.
2018-02-17 16:57:35 +01:00
Juergen Spitzmueller
8f9b733e67 Skip insets when checking for uncodable chars to paste.
Fixes paste of quote insets to ERT/chunk.
2018-02-17 12:27:26 +01:00
Juergen Spitzmueller
0d806799aa Adapt to new ChkTeX return values.
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).
2018-02-17 11:25:28 +01:00
Juergen Spitzmueller
47e85b37eb Disable unsupported ref types in mathed.
Also repair prettyref in InsetMathRef.

Part of #9798
2018-02-14 17:18:24 +01:00
Richard Heck
5ee3396459 Fix crash when citeengine is unknown. 2018-02-12 16:27:14 -05:00
Jean-Marc Lasgouttes
a25b48f86c Use parMetrics to access the par_metrics_ map
In cursorY, it is dangerous to access par_petrics_[0], since one does
not know whether metrics have been computed for this paragraph (which
may be off-screen).

It is safer to use parMetrics(0), that will compute the paragraph
metrics as needed.

Fixes bug #8120.
2018-02-12 17:11:09 +01:00
Jean-Marc Lasgouttes
1dba36c7ce Implement buffer-anonymize more efficiently
The work is done now in Paragraph::anonymize().

Move the handling of the lfun to Buffer class.
2018-02-12 14:38:28 +01:00
Juergen Spitzmueller
1437ae3f9c Disable BUFFER_EXPORT and BUFFER_EXPORT_AS while buffer is processed
I am rather irritated we didn't do this already, since synchronous runs
with BUFFER_VIEW or BUFFER_UPDATE leads to all sorts of problems,
including crashes.

Fixes the crash in #8338 (but not the bug itself).
2018-02-11 09:50:38 +01:00
Juergen Spitzmueller
be4d49ebd1 amend 71fea63326 2018-02-10 19:02:35 +01:00
Juergen Spitzmueller
71fea63326 Disable CheckTeX while buffer is processed
Since CheckTeX itself processes the tex file, a synchronous run with
a TeX process can lead to all sorts of conflicts, including crashes.

Fixes: #7434.
2018-02-10 18:18:43 +01:00
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