This code is not necessary anymore after the fix to #13069.
Remove the first QString argument to createView(). Set the autoShow
parameter to false by default and rename createView(id) to
createAndShowView(id) to avoid member function overloading issues.
Remove optional <GEOMETRY> argument of window-new lfun.
Document the removal of the argument in release notes.
Since the platform is selected at run time (e.g. xcb vs. Wayland), it
is not a good idea to decide at compile time what code is run. Another
example is on macOS, where having xcb libraries available will lead to
lauching the Xquartz whenever LyX is running.
With this patch, things are separated:
- the code is run when run-time platform is "xcb".
- the support code is compiled in when xcb header and libraries are
available.
Fixes ticket #13086.
Instead of baking our own support for -geometry command line option on
Windows (Qt only does that for Xcb), use the fact that Qt 5 provides
the equivalent -qwindowgeometry flag.
All we need to do is to replace the -geometry option with -qwindowgeometry.
This is part of the effort in ticket #13086 to get rid of the
compile-time QPA_XCB define.
This is the new(er) babel mechanism to load languages via babel *.ini
files.
Some languages (or varieties) are only supported this way, some work
better with unicode engines this way (for the latter case, we have
BabelProvide 2)
Use raw strings to avoid the following syntax warnings that show up
in LastTest.log after running tex2lyx ctests:
src/tex2lyx/test/runtests.py:135: SyntaxWarning: invalid escape sequence '\o'
if linex[:-1] == '\origin ' + inputdir + '/':
src/tex2lyx/test/runtests.py:136: SyntaxWarning: invalid escape sequence '\o'
lines1[i1] = '\origin ' + outputdir + '/' + "\n"
It turns out that Qt font selection via style name is broken on
Windows (QTBUG-101436). As we use our own style name for discriminating
our math fonts and applying proper kerning, we need a fallback method.
With this commit we check for the family name when the style name does
not match. In computing the kerning we also consider the right bearing
reported by the font instead of the width of the enclosing bounding box,
as this produces better results (see bug 13087).
Fixes#13087.
Avoids hardcoding of insets, and this behavior is possibly useful to
other insets than index and nomencl
We take this on yesterday's layout format change
We now have the functionality via sub-insets, and unexperienced users
are surprised when they don't get a literal !.
The unescaped chars can still be used via ERT.
There are several reasons to do it this way, among which is odd
behavior of the TOC filter if we put anything else there. This also
allows for filtering of the references themsevles in a natural way.
The change, I think, was really an unintended consequence of other
changes connected to showing formatted references in the work area.
The movement to the caption is now done in the LFUN function itself,
as we need the DocIterator in the caption
This greatly simplifies the code in the TocWidget and shifts all the
complexity to the LFUN itself
* par id actually can be 0
* properly move on in the buffer list if paragraph is not found
in the current buffer
* use dit to get label (as this might be in a different buffer)
This allows to insert a cross-reference to headings, figures or tables
by right-clicking on the outliner item.
If the item in question does not have a label yet, it is inserted.
This function checks whether a paragraph (specified by ID) has a label.
If so, it simply inserts a reference to this at cursor position, if
not it inserts a label to that paragraph (pos 0) and then inserts
a reference at cursor position.
Needed to implement #1624 (insert cross references to items that do not
have yet a label)
As with almost everything, this class bakes its own cake also with
multiple indexes. So we need to account for this to produce
compilable output.
Not very nice, but there you go!
Rely on the newly-introduced Buffer::id() to skip statistics
computation if the id is the same as last time. This will reduce the
annoyance of updates triggering at random times.
Take this occasion to clean code up:
- add 'skip' parameter (true by default) to Statistics::update to indicate
that the insets that do not produce output should be skipped.
- use a trailing underscrore for private members
Each buffer now has an id which is increased when it is marked dirty
(or when one of its relatives is marked dirty).
This can be a big win since updateMacros is very expensive.
The statistics code is known to be very slow, because it relies on
DocIterator to go through the buffer.
This commit introduces a new Statistics class that encapsulates the
main code, along a virtual method Inset::updateStatistics() that
allows to fine-tune how counting is done inset by inset.
This is a faithful bug-for-bug reimplementation.
The new code appears to be 3x faster than the old one.
See bug #12929 for a discussion about statistics update woes.
\boxed{} is the only box in LaTeX that contains math. It is amusing
that the example file that we had for ticket #13609 should not have
been a problem since there is no reason to force <mtext> there.
This commit addresses two issues:
1/ the embarassing one: the member SetMode::old_text_level_ was
declared as bool instead of int. This means that is was definitely
not a proper backup variable!
2/ a robustness issue: replace two consecutive test for isTest() by a
boolean veriable that is used twice. This makes sure that <mrow>
cannot be output without the corresponding </mrow>.
Part of bug #13069.
This trivial patch makes scrolling-by-selection smoother by dividing
the step size and the time between steps by 8 when generating
synthetic events in work area.
The scrolling speed is unchanged, but the result is visually better.
Instead of generating code and parsing it to add <mtext>...</mtext> at
the right spots, this commit honors the text mode setting that was
already present in the codebase to generate it automatically.
This is the work of two helper methods in MathMLStream:
* beforeText() notices when the stream is in text mode and that a
<mtext> has not yet been generated. In this case it inserts it, so
that raw text can be emitted afterwards.
* beforeTag() checks whether a <mtext> needs to be closed at this
point, and does it if needed.
To make this work, the code now tracks the nesting level in the
stream, and compares it the what the level was when text mode has been
enabled using the SetMode helper function.
In order to avoid later bugs, member os() that allows to access the
underlying stream of MathMLStream is removed. This required many <<
operators to become friends of MathMLStream.
In InsetMathBox, rename splitAndWrapInMText() to mathmlizeHelper(),
which is not just a method that sets text mode inside a <mrow>
element.
In InsetMathFont and InsetMathHull, the explicit generation of nesting
in <mtext>...</mtext> can be removed now.
Fixes bug #13069.
This is preparatory work for fixing ticket #13069.
Remove direct accesses to the underlying stream of MathMLStream in
InsetMathChar, InsetMathSpecialChar, and in all << operators other
than MathMLStream << docstring. This will allow to add a hook later in
this operator.
Move default values of MathMLStream private members to their definition.
Get rid of line_ member, which is not used.
When using system colors it may happen (on windows 11 in particular)
that the background color is actually translucid. This is not
something we are prepared to handle and it creates ghosts on screen.
The fix is easy: the alpha channel of the colors is set to 255.
Fixes bug #13084.
The recordUndo() call is very wrong, since we may be inserting over a
selection covering several paragraphs (undo itself works at paragraph
granularity).
recordUndoSelection() is the right operation in this case. It is
equivalent to recordUndo() when there is no selection.
Using translateIfPossible with null language does not make sense (and
gives an error on console).
Using translateIfPossible there actually does not make sense at all: it
is only for string from layout files that may already be translated.
We use the buffer language when no language has been specified. It
might have been better to use the GUI language.
A consequence of the commit is that "elsewhere" will be in the po
files and now really translatable ;)
The regex is expensive which is especially noticeable with very long
author lists.
This introduces a case-insensitive subst() variant which is much faster.
In some cases, it might happen that this method is called in cases
where no metrics is know for the current paragraph or where its
position is not set.
Take care of these cases to avoid assertions.
Remove setting of inset positions in the method, but make sure that
updateMetrics(false) is always called to get everything right.
In the new code, updateMetrics(bool) os the method that sets
everything right with minimal effort.
Using SinglePar does not majke sense here since the paragraph is not
modified and it might even not have a position yet.
This fixes a crash in BufferView::singleParUpdate, which is not
prepared (yet) to such situations.
Sometimes quick selection-scrolling could cause a crash because the
position of some paragraphs is not computed. To fix that, in
BufferView::showCursor, make sure that the metrics are always kept
clean using updateMetrics(false), which is lighweight.
As a consequence, the 'update' parameter of showCursor and
scrollDocView is not needed anymore. Its removal is mechanical and
accounts for most of this commit.
The only other significant change is that, when creating synthetic
mouse events and relying on scroll() for small moves, the full metrics
recomputation is replaced by the lighter version.
More work is still to come on this code, but this should be going in
the right direction.
This is one of the places where a dialog is shown (indicating that
some bibtems have been renamed) while the metrics are not up to date.
Then a draw operation can be triggered too early and a crash can ensue.
Use ad-hoc solution for this case and use Buffer::setBusy(). The
Alert::warning helper cannot really do that since it doe snot know the
current buffer.
tabBarClicked() should really only reset focus if a click in a different
TabBarGroup happened. And no need to issue workAreaChanged() again.
This has lead to extra and erroneous focus changes (see #12954)
\cprotect'ed insets do not need forced local font switch; in fact files
with this break in compilation. E.g. a caption with an URL containing
the char '#' and caption text set to a secondary language.
Add a Cursor-less version of Undo::recordUndoBufferParams (we don't
use an optional arument to avoir #includ'ing Cursor.h).
The version with CursorData parameter has been kept for the case of
local dictionary lfuns that have some kind of locality.
Remove Cursor argument to Undo::recordUndoFullBuffer().
The only difference from regular letter is the alignment of
"Send To Address" layout, but it no longer reflect the output
corrctly, probably because LyX revert the alignment of layouts
in RTL context now.
This inset can change dimensions when edited (like macros can).
Therefore Update::SinglePar should be set with editXY() like it is
already set for edit().
With this patch, 3 draw strategies (set in prefs with
\draw_strategy partial|backingstore|full) are available:
- "partial": only draw the parts of text that have changed since last
paint event (default for X11 and windows)
- "backingstore": the same, but drawing happens on an offspring
pixmap; this breaks subpixel rendering (default for Wayland and
macOS)
- "full": the screen is fully redrawn at each paint event and should
therefore always be correct; this is presumably slower but
introducing it will allow to test it.
This would deserve a proper UI eventually.
The code was expecting that all properties were specified
in the argument and not only some. Simply do not process
those properties not specified in the argument.
Reorder the tests so that, when the flag Update::SinglePar has been
specified, it does not take precedence over Update::Force flag.
This fixes the crash with inset-split.
This bug is pretty old, but it was not visible because the grey area
below the document would overwrite it.
It would be better to close the frame at the end of the document, but
this is for later.