Commit Graph

24770 Commits

Author SHA1 Message Date
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
Pavel Sanda
46826155a8 * LFUN_BUFFER_RELOAD - allow dropping of the changes.
Useful in scripts.
2018-01-13 19:19:18 +01:00
Juergen Spitzmueller
e57b245d0b Work around auto-bibitem insertion when separating bibliography environment
Manually delete bibitem insets in the separator line.

In the long term, such things should not happen at all.

Candidate for 2.3.x.
2018-01-13 15:12:10 +01:00
Juergen Spitzmueller
a09ceda2c4 Once more rework outline wrt environments.
* Fixes UNDO issues
* Takes care of some special cases

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-13 14:51:01 +01:00
Juergen Spitzmueller
bceaa7f929 Fix loop while separating
getMaxDepthAfter() gives wrong result here.

Fixes: #10979

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-13 09:59:09 +01:00
Jean-Marc Lasgouttes
2ba00ecb7b Initialize properly class member
Spotted by coverity.
2018-01-12 16:54:32 +01:00
Juergen Spitzmueller
aab58fed6b Use qt4-compatible connect() syntax.
Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-12 15:42:04 +01:00
Jean-Marc Lasgouttes
57d6835a90 Spacing 2018-01-12 12:27:03 +01:00
Jean-Marc Lasgouttes
706c9f2aa5 Fixup 27eb415d: do not define mymkdir() when it is not used.
Pleases coverity.
2018-01-12 12:24:58 +01:00
Guillaume MM
43e4b80734 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>
2018-01-12 11:03:07 +01:00
Juergen Spitzmueller
2ae51a9bb9 Complement the movement handling of environments
Make sure moved environments (such as frames) are separated from their
new neighbours in all directions.

This completes 07665d1dca
2018-01-12 10:44:01 +01:00
Juergen Spitzmueller
974553d858 Fix Null-checking issue detected by Coverity. 2018-01-11 13:43:35 +01:00
Juergen Spitzmueller
0fc14060b1 Amend 07665d1dca
We need to disable auto-nesting here.
2018-01-11 13:09:04 +01:00
Juergen Spitzmueller
07665d1dca Handle movement of environments better
Make sure moved environments (such as frames) are separated from their
new neighbours.
2018-01-11 10:48:47 +01:00
Günter Milde
fcc1cffb1a Do not write LICR macro if character is encodable.
No hardcoded conversion of literal dashes to
\textemdash and \textendash macros.
2018-01-10 15:31:32 +01:00
Pavel Sanda
8c24070c85 RCS: commit undo allowed only in unlocked state. 2018-01-10 10:47:48 +01:00
Jean-Marc Lasgouttes
1de6d3f3f0 Simplify code using range-based for loops 2018-01-08 15:16:58 +01:00
Kornel Benko
6093a3a9b1 Cmake build: Use test/dummy_functions.cpp instead of support/tests/dummy_functions.cpp
Test-programms in src/tests are now handled the same as in autoconf.
2018-01-08 12:58:28 +01:00
Jean-Marc Lasgouttes
66c677b946 Fix ghost caret
This fixes a regression in e64ea357, where a test has been (badly)
tightened to avoid that two consecutive rows may be redrawn to get rid
of caret ghosts. The test prohibited empty rows from being redrawn.

Moreover, improve the test of cursor boundary to avoid the case where
cursor position is already 0.

Fixes bug #10952.
2018-01-08 11:54:57 +01:00
Jean-Marc Lasgouttes
4f21f788b4 Looks like these are not needed for tests in support/ 2018-01-08 11:20:06 +01:00
Jean-Marc Lasgouttes
586890f09e Make #include directories explicit 2018-01-08 11:19:15 +01:00
Jean-Marc Lasgouttes
3aa10c8dba Fix compilation in monolithic mode 2018-01-06 20:46:06 +01:00
Jean-Marc Lasgouttes
af9f3fe8bd Remove unused variables 2018-01-06 15:48:36 +01:00
Guillaume MM
94c65074e0 Fix preview with a nested preview not being shown (#10795)
Regression at db581113.
2018-01-06 02:39:51 -05:00
Jean-Marc Lasgouttes
d77b05db80 Move the inPixels(MetricsBase) help from Length to MetricsBase.
A basic class like Length should not depend on something from
frontend.

This change allows to remove several dummy implementations of
theFontMetrics().
2018-01-05 20:14:04 +01:00
Jean-Marc Lasgouttes
806f40dbd4 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.
2018-01-05 19:32:17 +01:00
Jean-Marc Lasgouttes
76f0a3dd4e 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.
2018-01-05 19:15:40 +01:00
Richard Heck
f130f7713f Fix bug #10951.
The Buffer member for the remembered definition_ was not being set.
2018-01-04 15:12:16 -05:00
Juergen Spitzmueller
32efb91438 Do note attempt to nest more than possible. 2018-01-04 18:38:08 +01:00
Juergen Spitzmueller
9a1eeb8cbb Properly handle color none.
Fixes: #5870
2018-01-03 13:20:05 +01:00
Juergen Spitzmueller
f965d23633 Disable useless environment-split function at the core. 2018-01-03 13:16:07 +01:00
Juergen Spitzmueller
7d2764fb9e Use the command-alternatives sequence as defined in menus.bind
Otherwise, the shortcut is not displayed in the menu.
2018-01-03 10:58:30 +01:00
Juergen Spitzmueller
da57a6135e Amend 761a542551 once more.
As it is designed now, Static label is the only case that makes sense.
2018-01-03 08:55:35 +01:00
Juergen Spitzmueller
55349823f0 Limit 761a542551 to the case where we have a label. 2018-01-02 18:05:43 +01:00
Jean-Marc Lasgouttes
39a8000589 Do not use Application for a 'cancel export' boolean
It is not good for a support function to depend of anything outside of
it, especially Application.

Here the boolean that indicates that export should be canceled is put
in Systemcall. This allows to remove all the dummy theApp() function
that have been added here and there for linking needs.
2018-01-02 16:01:07 +01:00
Günter Milde
d852bbd5d9 Fix a comment.
Ligating of -- to en dashes occure also in teletype fonts.
With some 8-bit fonts, em and en dashes are not copied
exported from the PDF (but this is not limited to dashes in teletype).
With LatinModern, PDF export works fine
MWE:
\documentclass[]{article}
%\usepackage{lmodern}
\usepackage[T1]{fontenc}
\begin{document}
Hallo \texttt{Welt --Welt ---Welt}
Hallo Welt --Welt ---Welt
2018-01-02 09:28:04 +01:00
Jean-Marc Lasgouttes
9428ad56b9 Fix 'make check' 2018-01-01 23:55:34 +01:00
Juergen Spitzmueller
8f86feb260 Prepend "Insert " in the context menu for environment separators. 2018-01-01 13:40:49 +01:00
Juergen Spitzmueller
ebc3fee728 mention new option 2018-01-01 12:41:00 +01:00
Juergen Spitzmueller
8a6fa01d14 LyXAction.cpp: Whitespace and line breaking fixes. 2017-12-31 18:57:27 +01:00
Juergen Spitzmueller
99ae8d58c8 Another case where nesting needs to be preserved. 2017-12-31 14:43:45 +01:00
Juergen Spitzmueller
761a542551 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.
2017-12-31 10:37:35 +01:00
Juergen Spitzmueller
167c38377c Use real cursor pit, not the modified one. 2017-12-31 09:41:43 +01:00
Juergen Spitzmueller
857e70eb83 Maintain nesting when separating outer environment 2017-12-30 18:54:39 +01:00
Juergen Spitzmueller
c8abe0cf7b Move environment-split from Edit to Insert, as requested. 2017-12-30 17:54:09 +01:00
Juergen Spitzmueller
612536305b Don't show append function where it does not make sense. 2017-12-30 17:04:10 +01:00
Juergen Spitzmueller
5c704b5dd1 Revert "Fix environment-split when at pos 0 of a frame title."
This reverts commit 1ff34a973d.
2017-12-30 16:26:20 +01:00
Juergen Spitzmueller
1ff34a973d Fix environment-split when at pos 0 of a frame title.
This introduces a force argument to argument-insert that inserts
arguments even if they are already there. We need this here in order
to prevent DEPM.
2017-12-30 12:50:48 +01:00
Juergen Spitzmueller
27901b3a06 Fix environment-split previous problem spotted by Joel
Special case: append from the separator paragraph.
2017-12-30 11:54:37 +01:00
Richard Heck
d188a36fc2 Fix bug #10835.
VCS InsetInfos were broken by the switch at 2e934fc5f8 to using
updateBuffer to handle them. But we do not really want to go through
that routine in a clone, not for those insets, whose contents we
want to be the same as in the original Buffer.

Also fixes some issues noted in discussion of this bug: Failure to
update after context menu switch; failure to re-calculate shortcuts,
which can change.
2017-12-29 16:09:15 -05:00
Richard Heck
60cb7a1683 Minor code simplification. 2017-12-29 16:00:58 -05:00
Richard Heck
a765f465da Fix problem with BibTeX error reporting.
We only want to abort this process if the process was killed.
Also fix some style issues.
2017-12-29 11:12:17 -05:00
Juergen Spitzmueller
3a4b233dbd Properly implement IsTocCaption for Arguments in standard TOC
Fixes: #10631

Candidate for 2.3.x.
2017-12-29 11:51:24 +01:00
Juergen Spitzmueller
f3b89e4c72 Add IsAutoNestedBy
This is complementary to AutoNests: Styles can determine which other
style should auto-nest them. This is particularly useful for modules
that add new styles which should be auto-nested in a given context.
2017-12-29 10:36:03 +01:00
Juergen Spitzmueller
d6fb2abbea Some AutoNest polishment.
* Rename Nests to AutoNests
* Do it when changing from any style
2017-12-29 10:03:00 +01:00
Juergen Spitzmueller
8c56e89240 EndNests in Layout::write() 2017-12-28 17:56:48 +01:00
Juergen Spitzmueller
99ecc6e2c9 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.
2017-12-28 17:44:54 +01:00
Juergen Spitzmueller
87a6c75d9d Introduce environment-split before
This one prepends the new environment rather than appending it.

Easy way to add a new beamer frame before the current one.
2017-12-28 14:17:40 +01:00
Juergen Spitzmueller
2907160fff Introduce environment-split previous
This one checks for an environment in the previous paragraph (outside
the nesting scope).
2017-12-28 12:28:01 +01:00
Juergen Spitzmueller
dfaa4e9466 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.
2017-12-27 15:43:40 +01:00
Juergen Spitzmueller
87960e3dd8 Open intitle command explicitly also for passthru. 2017-12-27 11:49:54 +01:00
Juergen Spitzmueller
a2f886d526 Use TeXOnePar for the inpreamble layouts
This considers paragraph language and spacing (and simplifies the code)
2017-12-26 13:11:00 +01:00
Juergen Spitzmueller
e55e9c842f Fix inpreamble styles. 2017-12-26 11:40:58 +01:00
Richard Heck
61b1a20185 Fix crash after cancellation code.
I thought we didn't use clones when exporting from the command line.
We probably shouldn't.
2017-12-25 13:07:58 -05:00
Juergen Spitzmueller
69f41b54b8 Improve error msg 2017-12-25 12:22:45 +01:00
Juergen Spitzmueller
54846d2d93 Prevent to paste uncodable characters into verbatim
Since we now have proper encoding here, we can set this restriction.
2017-12-24 17:14:05 +01:00
Juergen Spitzmueller
931f87f508 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
2017-12-24 17:10:42 +01:00