Gcc STL debugging feature asserts when swapping an object with itself. This happens in some cases with math grids that have only one column.
A quick review of other uses of swap() in the code base did not reveal any other dubious case.
Fixes bug #9902.
At d449e7e6 it has been decided that submenus are going to be displayed even if
all their items are disabled. Here we make an exception for OptSubmenus.
Example of submenu no longer shown: Insert > Insert Regexp
Example of submenu always shown: Edit > Math > Limit Type, Macro Definition
\output_changes is now output at a distance from \tracking_changes.
Since both parameters can be seen as per-user preferences, they can cause
undesirable merge conflicts, in a multi-author setting, were it treated as a
single block by the version control system, as was the case before this patch.
After d5a5fbb8, as indicated in the commit log, it remained to make sure that
the sub-menus of the navigation menu showing the TOCs are generated in a delayed
fashion, to avoid corner cases regarding performance when documents have very
lengthy tocs (e.g. in a document with 1000 sections it takes a few hundreds
milliseconds for the menu to be refreshed). But this idea actually requires
substantial changes to the way menus are computed, so it is not for now.
In the meanwhile, I reintroduce a max size for menus, after which it is cut
off. This differs from the one that I removed at d5a5fbb8 in two ways: 1) if
there are more items than the max size, then we still show something instead of
nothing, 2) we allow ourselves to rely on qt's scrollable menus and therefore
allow bigger menus than before the above commit. The philosophy is that it is
better to show something than nothing, that it's better to show a scrollable
menu than to cut the menu to fit the screen, and that beyond a certain size the
scrollable menu becomes useless anyways.
It is a bad idea to have a QObject variable that oulives the main QApplication object. See for example:
https://www.ics.com/designpatterns/book/globals.html
Here the QTextLayout object was static to the anonymous namespace getTextLayout function, and got destroyed after the freetype renderer had been disposed of by QApplication.
This causes segmentation faults when quitting LyX on some systems.
This patch moves the cache together with other GuiFontMetrics caches. It means that one will have one such QTextLayout per font type, but this will not change much.
Preliminary work for addressing #7790. Thanks to Richard for providing initial
files this is based on.
Adding to TextClass:
OutlinerName <string> <string>
(the second string is translated)
e.g.:
OutlinerName thm "Definitions & Theorems"
Adding to Layout:
AddToToc <string> (default "", means no)
IsTocCaption <bool> (default 0)
e.g.:
AddToToc thm
IsTocCaption 1
Adding to InsetLayout:
AddToToc <string> (default "", means no)
IsTocCaption <bool> (default 0)
e.g.:
AddToToc literate
Adding to inset arguments:
IsTocCaption <bool> (default 0)
The active/inactive status of hfills was not checked in numberOfHFills.
The code is reorganized a bit, but the important part is the change in the above function.
Part of bug #9870.
This crude caching mecanism is useful in the particular case of a screen with many misspelling dotted lines. In this case, it is necessary to build a QTextLayout in order to know where to put the start/end of the spell line. Since rows typically contains text snippets longer than a word, we may be in a situation where the same QTextLayout is constructed repeatedly.
This commit is useful in this particular use case, and should not be costly in other cases. A better fix would be to remember the QTextLayout associated to each row element. This is a bit more work, so this fix should be sufficient for now.
Additionally, do not paint misspelled marks when painting is disabled.
Fixes bug #9890.
Although af8ba5e0fixed#9321, it broke a valid use case that was
reported by a user at #9785. Hopefully we can come up with a better
fix for #9321.
This reverts commit af8ba5e069.
exist. This will allow for a proper fix for bug #8796, though that may or may
not get fixed before 2.2.0.
Also, change the InStyle tag to ModifyStyle, per a suggestion of Jurgen's.
(http://mid.gmane.org/565E17DD.7090008@clear.net.nz)
Fix the pilcrow and the cross in the outliner for Windows and old Ubuntus.
The thin space after the cross is based on aesthetics (in Ubuntu at least) after
trying both with and without a normal space. A thin space is already used for
display in BiblioInfo.cpp, so I presume it is safe.
Ideally, I prefer ❌ (CROSS MARK), whose description fits the purpose, over ✖
(HEAVY MULTIPLICATION X), which looks too bold in the UI. Whereas ✕
(MULTIPLICATION X, successfully tested in Windows by Andrew) looks too dim. But
❌ (CROSS MARK) is next to ❎ (NEGATIVE SQUARED CROSS MARK) so it might be as
problematic as the latter.
Do not output the cross on the author name in the toc of tracked changes.
Previews are now generated when previews are turned on in
preferences. This change ensures that when users activate previews
for the first time, they are not confused by no previews showing up
(a restart of LyX or a triggering of each individual preview would
be required).
There was a previously attempted fix for #9507 at 390ae054 which was
reverted at 358745d0 for performance reasons: it updated previews
after every preference change and updating previews is costly (even
if the cache signals there are no changes needed).
This implementation is consistent with what we do for updating the
system fonts in preferences.