Commit Graph

23510 Commits

Author SHA1 Message Date
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
Jean-Marc Lasgouttes
4ddad2f6cd Remove horizontal spacing around previews
This concerns the preview version of InsetPreview and InsetIPA.

Fixes bug #10304.
2016-08-19 15:01:18 +02:00
Jean-Marc Lasgouttes
e7a33cacf1 Simplify menus when there is only one caption type
This removes the submenu indirection in Insert and the type changer in
contextual menu. Interestingly, the code was there, but it did not
work at all.
2016-08-19 14:07:08 +02:00
Kornel Benko
3c9d5d3cda Cmake build: Add verbose variable to some dummy_functions.cpp 2016-08-19 11:15:10 +02:00
Scott Kostyshak
0b1cf1330d Warn in GUI when mixing Title and InTitle layouts
Since we process layouts sequentially, we export LaTeX code for the
title once we arrive to a layout that has InTitle false. If the
document then later has a layout with InTitle true, we do not
(currently) go back to add it to the title and just output it
in-place. We previously warned with LYXERR0, but since this can
cause missing or unexpected output we now warn in the GUI.

For more information, see the following lyx-devel thread:
https://www.mail-archive.com/search?l=mid&q=a65ae226-d3bd-8fc5-a93b-7bb23f1cda82%40lyx.org
2016-08-18 18:06:04 -04:00
Enrico Forestieri
fb46b3a1ee Fix exit code from runCommand on Windows
On Windows, runCommand has never returned the exit code of the
spawned process but the result of correctly closing the input handle.

Fixes #10327
2016-08-17 22:58:13 +02:00
Enrico Forestieri
2a371bb4b3 Add verbose option
Using the option -v (--verbose) all spawned commands are print
on the terminal. Note that this was done by default on previous
versions.
2016-08-17 22:32:14 +02:00
Jean-Marc Lasgouttes
6e88c0062c Use proper QPalette::NoRole enum value instead of our own 2016-08-17 12:10:25 +02:00
Jean-Marc Lasgouttes
e194c9ce27 A more radical approach to inset background painting
Now by default all insets paint their own background when needed. This
means that 63cf3297 and part of 9940acc5 can be reverted.

To avoid extra painting, background drawing is disabled for
InsetCommand and InsetCollapsable. These insets draw background as
part of their normal drawing activity.

This will avoid drawing artifacts with InsetNewpage, InsetVSpace and
probably some others.
2016-08-17 12:05:00 +02:00
Jean-Marc Lasgouttes
6f82f51cbe A PainterInfo variable should be named `pi'. 2016-08-16 14:31:20 +02:00
Guillaume Munch
5ded0d002d Assertions when doing Export As... (#10321)
Fix assertion with gcc 6: The comparison function must be a strict weak
orderings and not give x < x.

Fix assertion when a custom exportable document format is given a non-ASCII
name. Use qt_ to be consistent with the rest of the code.

Use Qt's locale-aware comparison for appropriate sorting.
2016-08-15 13:23:29 +01:00
Enrico Forestieri
f323a64fc3 Adapt code to comment 2016-08-15 03:22:01 +02:00
Enrico Forestieri
7113fb669d Correct comment
According to C++11 rules, static locals are thread safe for
the first-time initialization.

See also:
http://stackoverflow.com/questions/12302057/c11-safe-double-checked-locking-for-lazy-initialization-possible
2016-08-13 17:43:03 +02:00
Scott Kostyshak
c949268da7 Improve a layout LYXERR0 message
The name of the layout is now included in an error message about
layouts. This will help with finding the root issue of several
documents we have.
2016-08-08 23:44:27 -04:00
Richard Heck
20328c4a44 Update tex2lyx tests. 2016-08-08 16:47:33 -04:00
Enrico Forestieri
41e409f8f7 Use std::call_once only if it is actually available 2016-08-07 04:58:41 +02:00
Richard Heck
3be23d18b6 Fix XHTML export of German Additional Features manual.
There was an oddity in the manual that exposed a problem with the
test for the "special case" of an inset all by itself in a pargraph.
If a font change is applied to that inset, we still need to open the
paragraph.
2016-08-04 22:43:17 -04:00