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.
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)