Commit Graph

23501 Commits

Author SHA1 Message Date
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
Richard Heck
0c1dd609f3 Debugging code. 2016-08-04 22:00:24 -04:00
Richard Heck
0a603c5d0e We don't need to crash here, but can try to continue in release
mode.
2016-08-04 22:00:18 -04:00
Richard Heck
f15c4159aa Special characters should be output to the TOC. 2016-08-04 21:09:32 -04:00
Richard Heck
8d65a6d277 Fix bug #10320.
Layout::write needs to allow for the possility that the name of the
style may contain a space. It seems sufficient just always to quote it.
2016-08-04 17:45:40 -04:00
Jean-Marc Lasgouttes
63cf3297f8 Let InsetSpecialChar draw its background when necessary
This is the same fix as in 9940acc5 for auote inset and math macro template.
2016-08-04 23:21:33 +02:00
Guillaume Munch
0e672fed21 Partially revert "Replace static with thread_local when used for caching"
As noticed by Stephan, clang on Mac is nowhere near to support thread_local for
some reason:
http://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports

It does not look realistic to me to provide a configure-based alternative. The
solution is to not use thread_local until it is reasonably supported on
Mac. According to sources, this means requiring Xcode >= 8.

This reverts commit 82d4f1a446 partially.
2016-08-04 13:39:27 +01:00
Juergen Spitzmueller
90f6eb01a4 Include all [scr]article styles in beamer article layouts.
File format change. On format reversion, we need to put some extra code
in the local layout that emulates the 2.3 behavior.
Simply Input'ing the respective layouts is unfortunately not enough,
due to the insertion order.

See #9977
2016-08-04 11:42:06 +02:00
Juergen Spitzmueller
b9b9ad3f9e Correct backends() allocation with japanese encoding
Fixes error introduced by ad9887da9c.
2016-08-04 10:01:06 +02:00
Scott Kostyshak
52ae8fb22b Activate LyX window after reverse search (#10196)
"lyxclient -g" now calls the just implemented lyx-activate (see
previous commit) after server-goto-file-row. This allows the PDF
viewer to switch to LyX after executing a reverse search.
2016-08-04 01:46:15 -04:00