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.
The hotshot module used there only works for Python 2.
BTW the profiling turned out not be necessary.
As a case in point Python 3.13 is twice as fast as Python 3.6 when using
lyx2lyx. Not only that but Python 3 is almost 10 times faster than using
Python 2 for this particular case.
There was a merge conflict, and it looks like I didn't fix it right.
I had set the author of that commit to Alexander, but for some
reason it didn't stick?
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().
Recent versions of qmake complain loudly when the locale
does not explicitley specify the utf8 codeset. Specifically,
the configure script exports LC_ALL=C and that implies the
ascii codeset. Previously, this was silently changed to utf8,
whereas now we get a warning for each qmake invocation.
So, explicitly set utf8 before calling qmake.
This extends the support of qmake to Qt5. Currently, the other
configuration methods are tried if qmake fails, but a message is
printed.
A nice goal would be to get rid of those legacy methods (pkg-config,
plain autoconf-style), if this proves possible.
The functions were selected from the parser files where document is
always defined.
The only case was this code was used was on document.warning.
Since our documents are well formed this code was never active and thus
the reason why we did not saw this before.
One possible solution to assure that these type of errors do not occur
is to make the convention that all the functions in lyx2lyx_tools have
as the first argument document.
# ambiguous-variable-name (E741)
Derived from the **pycodestyle** linter.
## What it does
Checks for the use of the characters 'l', 'O', or 'I' as variable names.
## Why is this bad?
In some fonts, these characters are indistinguishable from the
numerals one and zero. When tempted to use 'l', use 'L' instead.
## Reason to ignore in LyX?
With appropriated fonts that is not an issue. In our case we just use
the 'l', in particular in the context of iterators: 'i', 'j', 'k', 'l'.