The problem was that, if we killed export when some graphic was
being converted, or some external template was being handled, it
would only cancel that process, and then it would just continue.
To deal with that, we need to do a few things:
1. Modify the return values for some of the Converters routines,
and similarly the routines for external templates, so we can
tell when something has been canceled.
2. Throw an exception from InsetGraphics or InsetExternal when this
has happened during export, but ONLY when the Buffer is a clone.
We shouldn't be able to 'cancel' export when we're, say, generating
code for the preview pane, but this keeps us on the safe side..
The exception then has to be caught, obviously, back in the export
routines in Buffer.
Probably Coverity will be unhappy about something here, but I'll
deal with that problem as it arises.
This commit follows 8d2b121e and is not expected to change
functionality (e.g., I confirmed that the cases of #7330 and #11106
are still fixed). The advantages of this refactoring are the
following:
- Remove some preprocessor directives:
processingThreadFinished() is only called in the case that
EXPORT_in_THREAD is 1, so by moving some code up in the call list,
the directives are not needed.
- If errors() is called when there is no error, there will not be unexpected
behavior (e.g., as was the case before 8d2b121e).
Note that errors() is still only called by the code touched by this commit
if there is an error, but that is for efficiency and readability.
- The "from_master" argument now has a constant meaning. Before, it
could be the case that "from_master" was set to false but that the
master's error dialog was shown.
This allows (some) verbatim contents in macros, such as \url's with
specific chars (#, % etc.) in section headings or footnotes (#449)
or comments in captions (#9313).
The mentioned two bugs are fixed by this commit.
Note that the implementation is still rather basic and might need
extension for other cases.
This is mandatory for some features (such as bookmarks,pdfusetitle)
to work, and only a handful of drivers can be auto-detected by hyperref.
Fixes: #6418
If a master document is compiled and has errors, and then a child is
compiled without error, the errors from the master compilation were
shown.
The setup of the relevant code is the following:
processingThreadFinished() calls errors(). errors() makes the
assumption that if it is called, there must have been an error
somewhere.
The logic of the setup is the following:
processingThreadFinished() knows whether there was an error on
the most recent preview/export, although it doesn't know whether
the error is from master or child (i.e. does not know whether the
user was compiling the child, or whether master-buffer-view was
called). Inside error(), if there is no error in the child, it is
assumed the error is from master.
For the above logic to work, errors() should only be called if there
was an error.
This commit fixes#11106 and preserves the fix to #7330.
The original use case for this bug is entering an overset inset when
there is a selection. The expected result was to have the selection
pasted in main text, but the result was to have it in the cell.
Insets already have idxFirst() that is able to set cursor to the
"entry" cell of an inset. This patch introduces firstIdx(), which is
the index of this cell and uses it in idxFirst() (idem for
lastIdx/idxLast).
As a consequence, several instances of idxFirst/idxLast can be removed.
Now for the real fix: the two places where the cell in which selection
is inserted seem to be:
* Cursor::macroModeClose
* Cursor::handleNest
These two methods are changed to insert material in the entry cell
instead of cell 0.
idxFirst/Last methods are added to InsetMathRoot and InsetMathStackrel
so that the natural entry point is the nucleus of those insets.
Finallly, a typo is fixed in InsetMathNest::edit() where enter_front
computation was incorrect.
Replace CHECK_CXX_SOURCE_COMPILES() with TRY_COMPILE()
Discarding the link-stage mimics the behaviour used by automake.
Now the testsource is compiled regardless if hunspell
is external or not.
The compile test for 3rdparty hunspell is omitted,
because the macro check_cxx_source_compiles() tries also to link.
But at the time of the check, the required library is not there.
A function that returns a vector<string> will lead to a crash if the
main code and the library have not been compiled with the same
stdlib-debug state. See for example:
https://stackoverflow.com/questions/4764048/stl-and-release-debug-library-mess
This is fixed by introducing a new variable STDLIB_DEBUG that contains
the flags that trigger the debug mode (autoconf only for now).
This will allow to go forward with bug #10547.