Commit Graph

23526 Commits

Author SHA1 Message Date
Enrico Forestieri
c4aca5705b Correctly distinguish ERT macros from predefined ones such as \alpha 2016-09-16 02:15:52 +02:00
Enrico Forestieri
a26e75cd8a Correctly distinguish LyX macros from those defined in ERT
At this time the MacroData of a macro is still uninitialized,
so the macro() method always returns null.
2016-09-16 00:43:04 +02:00
Enrico Forestieri
364e8d6692 Avoid inserting spurious \text insets in mathed
This amends 5cdbaf51.
2016-09-16 00:37:04 +02:00
Enrico Forestieri
1b7dea5c2f Do not prematurely close \ensuremath or \lyxmathsym on export 2016-09-16 00:32:35 +02:00
Enrico Forestieri
e36a8903d7 Really fix the problem with not updated macros
Revert to the strategy used at 8f86ee74 but not using mathedWordList
because it may be still uninitialized at load time. Instead, use the
globalMacros method for getting the same info.
There was a thinko at 8ec91e80, because globalMacros always returns
null for user defined macros.
2016-09-15 02:39:30 +02:00
Jean-Marc Lasgouttes
9313f8565b Set window title before stting modified state
Fixes message "QWidget::setWindowModified: The window title does not
contain a '[*]' placeholder" when opening a non-existent file.
2016-09-14 22:37:06 +02:00
Juergen Spitzmueller
c0a425a319 Move wrap check for simple search/replace to lyxfind
This gets rid of some dirty dispatch tricks and fixes wrap-around
on replace and in the spellchecker

Fixes: #10378
2016-09-14 10:23:39 +02:00
Enrico Forestieri
72cf7c8f1f Partly revert the bits of 8f86ee74 that are not necessary anymore after 8ec91e80 2016-09-14 02:51:56 +02:00
Enrico Forestieri
8ec91e804a Make sure not to use a pointer that may be bogus
It may happen that mathedWordList is not still updated at load time,
so we would still be using a bogus pointer. Better fetching the
necessary info from the global macro table.
2016-09-14 02:27:18 +02:00
Günter Milde
f2a263e334 tex2lyx: Remove "textglobfall" hack.
tex2lyx tests for TIPA (test-inset-*) resulted in {End} in ERT after fixing lib/unicodesymbols.
Should be fine now.
2016-09-13 22:23:53 +02:00
Enrico Forestieri
8f86ee74cd Make sure that math macros are updated at export time.
The math macros system is quite complex. Macros are updated during
metrics calculation, so a missing update is very likely to cause a
crash. This commit tries to assure that they are updated at export
time, which also happens when the table of contents is updated.
Moreover, in order to circumvent a possible missing update, when
a math macro is detected we try to avoid using the sym_ member
of the MacroData class, as it may contain bogus values.
2016-09-13 08:02:02 +02:00
Günter Milde
99eeb29e58 tex2lyx test: make box-color-*.tex sample compilable
Load required package textcomp.
Replace call to non-existent packages textcyr and textgreek with the backup definition of the commands as done by LyX export.
Do not load marvosym (clash with pifont) (LyX does not load the package either).
Remove invalid command \\ascii.
2016-09-12 11:46:30 +02:00
Kornel Benko
e78e58a7de Cmake build: Shuffle code around. 2016-09-12 11:04:14 +02:00
Enrico Forestieri
a24033ff0e Ensure consistency
On export, a macro defined in ERT (or not defined at all) is left
in the same environment it is entered. So, don't explicitly insert
it in an ensuremath environment when it is entered in a textmode one.
2016-09-12 07:55:38 +02:00
Enrico Forestieri
615c733844 Make sure a pointer is valid before using it 2016-09-12 05:15:00 +02:00
Scott Kostyshak
d3c63f97c4 Update tex2lyx test reference after 754cb3d1
From Günter [1]:

  the difference is the textcommand for ETB which changed from
  {\ascii\ETB} to

  0x21a8 "\\ETB"                    "ascii" "force=utf8" # UP DOWN
  ARROW WITH BASE

  because the former resulted in

  l.513 \ascii
              \ETB{}
  ! Undefined control sequence.

[1]
https://www.mail-archive.com/search?l=mid&q=nr48qn%242gb%241%40blaine.gmane.org
2016-09-11 17:52:02 -04:00
Kornel Benko
050d817605 Cmake build: Add qt-svg-lib to be linked with lyx if used QT4.
Probably due to commit 82808fe, there were undefined references
such as e.g. QSvgRenderer::~QSvgRenderer().
2016-09-11 15:34:58 +02:00
Enrico Forestieri
2aa930bbe8 Fix display and export of some latex macros
Fixes #9742.
2016-09-10 18:32:44 +02:00
Enrico Forestieri
cb70946960 Fix bug #9616 2016-09-10 13:36:45 +02:00
Günter Milde
99310b7e3f Fix export of Unicode characters (Unicode blocks <=72)
Fix problems revealed by hand-compiling an examining the test samples in autotests/export/Unicode-characters/:

* new definitions
* fixed definitions
* "force=utf8" when required
* some IPA symbols fail without the "extraipa" package
* fix direction of "textcommaaboveright"
2016-09-10 12:35:51 +02:00
Juergen Spitzmueller
4c27c921f0 Minor amendment to b95262f487
Just for consistency.
2016-09-10 10:32:40 +02:00
Enrico Forestieri
5cdbaf51ee Avoid duplicating mode changing commands 2016-09-10 02:39:57 +02:00
Enrico Forestieri
324651899e Ensure proper mode in mathed
A math-mode command entered in a text-mode environment is wrapped
in an ensuremath inset, as well as a text-mode command entered in a
math-mode environment is wrapped in a text inset. Who doesn't like
the extra insets can always dissolve them and rely on the wrapping
performed on export.
2016-09-10 02:07:47 +02:00
Georg Baum
a6be519a81 Fix data loss with [ in first cell of aligned
If the first character in the first cell of an aligned math environment is
'[', and the environment does not use top or bottom vertical alignment,
then LyX did write the '[' unprotected so that it got misinterpreted as
optional argument, both when reading the .lyx file in LyX and when reading
the .tex file in LaTeX => data loss!
The fix is to output an empty optional argument in this case, which is
interpreted as default alignment both by LyX and LaTeX. It would also be
possible to output \[ in the first cell instead, but this would be more
difficult to implement.
2016-09-08 22:38:33 +02:00
Georg Baum
a931e84e8b Prepare for mutlicolumn lines
The \multicolumn command allows to set vertical lines for individual rows.
These are not yet displayed, but if they are supported one day, the code in
a27ff13663 needs to be adjusted. This change hints at the adjustment.
2016-09-08 22:01:22 +02:00
Jean-Marc Lasgouttes
a27ff13663 Set vertical lines in math arrays correctly on Y axis
This is a fixup to commit 39329935. The two fixes are
* add forgotten offset `y' when drawing the line
* in order to have a continuous vertical line, draw from the offset of
  the previous row.

Fixes bug #10363.
2016-09-08 16:30:25 +02:00
Jean-Marc Lasgouttes
82808fea04 Set window title according to platform UI
The window title is built from the current file name and its
mofidication state. We use our own code instead of the automatic title
bar provided when windowFileName() is set because

1/ Qt does not keep the full path name
2/ Qt does not yield a nice application name

The "read only" and "version control" status are shown in the status bar:

* for read only we use the tab read only emblem (with the right size)
* for version control, we show the name of the backend (using a new
  vcname() method of the backend).

The iconText() of the view is not updated anymore, since this is
deprecated in Qt5.
2016-09-08 15:59:44 +02:00
Juergen Spitzmueller
b95262f487 Sanitize Ref dialog validation.
Fixes: #10376
2016-09-08 15:04:58 +02:00
Georg Baum
646d47ae93 Fix filter filter regex
Now the external material file dialog shows the file types defined in the
template again. Before this fix it did only show "All files (*)".
I don't know what the old syntax was supposed to do or whether it ever worked
with boost::regex, but with std::regex the new one is correct.
2016-09-05 22:49:59 +02:00
Jean-Marc Lasgouttes
72837fec5c Amend commit e194c9ce27
As noted in the log, this commit was a bit radical and needs some
adjustments (which was expected, actually).

Let InsetText do their own background drawing.

Fixes bug #10359.
2016-09-05 11:06:01 +02:00
Juergen Spitzmueller
b5c0694856 Amend 97b9e81cee
\@ifundefined is an If-Then-ELSE construct.
2016-09-04 17:44:47 +02:00
Scott Kostyshak
1a374a931b Exit with error if child exits with error (#10188)
Before, it could have been the case that

  lyx -e pdf2 file.lyx

had exit code 0 even though file.lyx includes a file that exits with
error. If compiled in the GUI a warning was given, but from the
command line exit code it would seem there was no problem. The exit
code for this case is now non-zero and the word "Warning" is now
removed from the message because it should be treated as an error.

An exception is thrown from InsetInclude and is caught in
Buffer::makeLaTeXFile() and added to the error list.

The (similar) use case at #8840 is also fixed by this commit.
2016-09-02 18:24:14 -04:00
Jean-Marc Lasgouttes
da30e38400 Remove unused 'glue' parameter
It was probably useful at some time, but not now.
2016-08-30 17:21:18 +02:00
Jean-Marc Lasgouttes
78ae499355 Remove unused struct members
Interestingly, cppcheck detected that they were not initialized (see
8a047a41), but not that they were unused.
2016-08-30 17:08:49 +02:00
Scott Kostyshak
03684ae05e Improve status check of LFUN_BUFFER_ZOOM_{OUT,IN}
buffer-zoom-out can actually zoom in (by giving a positive number as
the argument), so it should only be disabled at the minimum zoom
level if it is indeed zooming out.

Similarly, buffer-zoom-in can zoom out, so it should be disabled if
the user is at the minimum zoom and it is called to zoom out.

This commit amends 8884c404.
2016-08-30 10:25:45 -04:00
Jean-Marc Lasgouttes
68d825fed8 Amend b583fb26e8
It failed in the case where a selection already existed (the anchor would be wrongly reset).
2016-08-29 12:03:33 +02:00
Guillaume Munch
4d99112056 Action.cpp: replace a reference with a shared_ptr
Replace the member reference to FuncRequest in Action.cpp with a
shared_ptr. Compared to copying the FuncRequest, the shared_ptr has two
advantages:

* Recreating the menu each time creates a lot of new actions, so we avoid a lot
  of copies.

* FuncRequest can remain forward-declared in Action.h.
2016-08-28 22:49:21 +01:00
Guillaume Munch
0779b3c36c Change "Format" into "Formats"
The plural form seems more appropriate and the tag [[output]] is added for
disambiguation (e.g. for the French translation).
2016-08-28 18:26:58 +01:00
Richard Heck
5018e1077b producesOutput() should not be redeclared as producesOutput(bool). 2016-08-28 00:04:02 -04:00
Guillaume Munch
76d0c6759f Trivial clean-up 2016-08-28 02:34:54 +01:00
Guillaume Munch
cb0a4c6639 Fix Unicode use in Format's prettyname
The field prettyname can accept Unicode and therefore must be parsed into a
docstring.

Little simplification of the code on the way.

* For other fields, either a validator should be set to prevent non-ascii input
  in the preferences, or they should be transformed into docstring too.
2016-08-28 01:30:53 +01:00
Guillaume Munch
efbec20320 Fix the compare_locale function by relying on Qt's (#9030) 2016-08-28 01:30:53 +01:00
Juergen Spitzmueller
40d9c6ec48 Implement proper dialog titles in InsetParamsDialogs
Fixes: #10329
2016-08-26 11:35:12 +02:00
Jean-Marc Lasgouttes
2ad52918da Do not set layout for no-op paragraph break
When breaking paragraph in an empty top-level paragraph, nothing
happens on screen but yet there is an undo step because the layout is
reset to what it already was.

Avoid this case.

Fixes bug #10089.
2016-08-24 15:29:17 +02:00
Jean-Marc Lasgouttes
07c7dae367 Move correctly the end of proof marker when row is large
This was a regression from 2.1.x in LtR mode, and it never worked correctly in RtL mode.

Fixes bug #10344.
2016-08-23 17:45:21 +02:00
Jean-Marc Lasgouttes
b583fb26e8 Reset anchor before selecting with S-button1 2016-08-23 12:22:35 +02:00
Jean-Marc Lasgouttes
65b0e84b54 Let M-x give focus to minibuffer when it is already open 2016-08-22 18:20:09 +02:00
Guillaume Munch
193cda6e48 Remove unused variable warning and remove preprocessor switch. 2016-08-22 00:04:30 +01:00
Enrico Forestieri
6adf079796 Quote filenames used for forward-search with SumatraPDF
Single quotes are special to our parser and must be either escaped or
quoted if they are part of a filename, otherwise they are stripped out.

See #10342.
2016-08-21 23:33:01 +02:00
Enrico Forestieri
589f49ff36 Use only one file for dummy implementations 2016-08-20 00:41:04 +02:00