This generalises the new use of TocBuilder (97e8101) to listings and wraps and
removes some duplicate code.
Make sure that we will never write an empty float type again in the future
(#9760)
We introduce TocBuilder for building TOCs that take into account both float
insets and their captions.
* Floats without caption are shown with their content.
* Floats with a caption are shown with their caption, but clicking the entry now
correctly moves to the float and not to the caption.
* Subsequent captions produce additional entries in the TOC.
* Figures and subfigures are correctly ordered in the outliner.
* New TOC "senseless" for captions appearing alone (a bit like broken references
are still displayed in the menu and outliner).
* Disable LFUN_CAPTION_INSERT if there is already a caption in a listing
Known issues:
* Inconsistent output for includes located inside floats
* We should record the end of the float in addition of the beginning for a more
accurate cursor -> outliner entry conversion
(#9762)
* fixes a bug where this was already the expected behaviour of
math-subscript and math-superscript but failed.
* corrects the behaviour where if there is \newcommand in the
selection, then a corresponding macro template is introduced
instead of a math inset.
* fixes a bug where math-display, math-subscript and math-supscript
would also introduce such a macro template in a way unrelated to
their function. Now it only happens with math-mode without
arguments.
* fixes a bug where a text that does not denote a macro definition,
e.g. "aaa\newcommandaaa", would produce \invalidmacro.
These were all found by cppcheck. Even in constructors that are there "only
because of std containers" the class should be initialized correctly. You can
never know whether such an object does not get used, and then a nice crash
caused by dereferencing a NULL-pointer is better than undefined behaviour.
The old code produced crashes with gcc5 caused by calling the copy
constructor (see https://bugzilla.redhat.com/show_bug.cgi?id=1260976).
This has been filed as gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67557
It is currently being marked as invalid (they claim the code is not valid and
produces undefined behaviour), but I don't think that this is correct.
Fortunately i does not matter for us whether the old code was valid or not,
since the new version is easier to understand and works with all compilers.
Base classes with virtual methods should have a virtual destructor.
See Scott Meyers, Effective C++ item 7: Declare destructors virtual in
polymorphic base classes.
Fix bugs #6501 and #7359.
* Selection highlighting has been broken since a conflict with
reverse-search was repaired (at 00a62b7c), is now fixed.
* The selection highlighting was not accurate, for LaTeX formats (in
full source view), and meaningless, for non LaTeX formats.
* fix regression at cc00b9aa: force_getcontent_ was always true
therefore the code to detect changes in the generated source was
dead. The consequence is that the source view would jump to the
beginning at each updateView() even if no change occurred. Cc00b9aa
was meant to fix#5600, which I cannot reproduce with the new
implementation.
* Various improvements:
* When the position-to-line conversion is unavailable (LyXHTML, LyX
source, etc.) we focus on the first difference instead.
* Get some space around the cursor
* Respect the scrollbars
* Highlight with QTextEdit::ExtraSelections instead of cursor
selection (the latter used to break syntax highlighting of the
TeX code... which was not so much of an issue before because the
wrong part was selected)
Known issues:
* The highlighting is off by one line in very last paragraph of a
document. This appears to be a bug in TexRow.cpp.
* The highlighting is off for any kind of inset. This could be
solved by adapting TexRow so that it accepts CursorSlices as
and argument for the conversion to line number. (this is bug
#4725)
Fix bug #9493. The source panel was very slow with auto-update on. Now
we use a timer that ensures that the source is generated only at
rest. The delay is short or long depending on whether we show the
source of a paragraph or the whole source.
When using -std=c++11, the cygwin compiler automatically defines
__STRICT_ANSI__ which is used as a guard for not declaring essential
unix standard calls such as setenv, popen, etc. As a result,
compilation stops with errors such as "xxxx has not been declared".
By undefining the guard, compilation succeeds and lyx works Ok.
In order to adjust the path of an included file, when deciding
whether the document was moved or not, it is not sufficient
comparing the paths because the document could have been accessed
through a symbolic link.
Compiler that are known to support C++11 (gcc >= 4.3 and clang) are
now used in this mode by default. It is still possible to override
this choice using --(en|dis)able-cxx11.
Moreover, c++11 mode is detected from the compiler itself, not from
the use of --enable-cxx11. This allows to support compilers other
than gcc or clang.
Update INSTALL file accordingly and clean it a little bit.
This was a regression of 0c093a6264. The crash was found by the tex2lyx
test case test-insets.tex: Running lyx -f main -e pdflatex test-insets.lyx.lyx
did crash. This is not a real fix, but will do for now since previews are not
needed in command line mode (I wonder why they are generated at all?) In the
long term, we need theApp() to return a console application in commandline
mode to eliminate the existing sifferences between export from GUI and
commandline.