Make sure to properly nest \begin{lang} and \end{lang} tags even
when no language package is selected. In this case, LyX assumes
that babel is being used, so the language names might be wrong
if the user arranged for using polyglossia in the preamble.
Nevertheless, we assure that the produced output is syntactically
correct, so that by adding proper preamble code a correct output
is still possible.
As it was, the comparison buffer was sharing a DocumentClass with
the buffer from which the document settings are taken.
(cherry picked from commit f9835d054d7aac5830ec6bb5a3537c2b4fa2d269)
It seems that the internal Qt5 caching does not work well here,
especially in the case of ancient Hebrew documents.
(cherry picked from commit 5354c64b273eac7b869ca44436db7088d8c73bb4)
When an inset wants to use the whole available width, it is necessary
to take into account that some of this width may already be taken by
the end-of-paragraph (pilcrow) marker.
Fixes bug #10537.
(cherry picked from commit 91f3b21e42c7b3b2028ec8f66460440e9ddadcbf)
getPosNearX, which is the only user of x2pos, should always return the
nearest position.
In editXY, there is a need to return the position where the inset
stands, but it is done using checkInsetHit.
Fixes part of bug #10569.
(cherry picked from commit 8769c0fb750a8c46e6f053c5f73b3991393dcd73)
(cherry picked from commit 20696ecb7ee335dedcc8a1b0d24e4cc56736d81f)
The code that looks whether neighbor block has a different direction
should look to the left or to the right depending on the direction of
the current block.
Fixes part of bug #10569
(cherry picked from commit e3d252cd6256b32745b93c0cb0fd5170f448f91c)
Instead of using complicated (and wrong) code, it is better to use
getPosNearX here.
Also simplify the code by removing temporary variables.
Fixes part of #10569.
(cherry picked from commit 6a0c1c65734e0f25eb4fcbfb8926c98b77117c29)
With RtL text, the method can be non-monotonic wrt x value (which is a
Qt bug). To work around this, we check whether positions adjacent to
those returned by xToCursor look better. Depending on whether the new
x position is too small or too large, we look backward or forward for
a better solution.
The performance is probably not great, but this is only needed for
user interactions, so the performance penalty should not be a problem.
Fixes part of #10569.
(cherry picked from commit da590925cd6749587b9f500ecdaa457e34bc0f4a)
the previous commit changed the LyX logo to be in English but that broke the PDF bookmark text and also the TOC. The solution is to use the real logo and a short title with \texorpdfstring