The display of partially-selected word is now done in a new Painter::text method
which displays the string twice with different clip settings. This allows to
catter for the case where Color_selectiontext is not black.
Morover, the code that uses unicode override characters to force the
direction of a string is moved to lstrings.h.
Fixes: #9116
Do not cut strings at separators in RowPainter when text is not
justified. This speeds-up painting by reducing the number of strings
to draw.
Do also a modest cleanup of paintChar (remove dubious optimization).
Instead of relying on character range (Hebrew or Arabic) or character
direction, use RLO unicode character (Right-to-Left override) to force
painting in the direction indicated by the current font. This should
be as close as we can to the old LyX behavior (and requires less
code).
If this code works as intended, it will be possible to remove a lot of
code from Encodings.cpp.
We rely on Qt built-in unicode support for handling Arabic and Hebrew
compose characters. This allows to avoid to use our homegrown
machinery.
This should provide a nice speedup at a low cost and
will eventually allow us to get rid of:
* most of our Arabic/Hebrew machinery in Encodings.cpp,
* Paragraph::transformChar,
* and probably more.
The horizontal position of the inset was not taken in account.
The rounding is not always the same as with the old code, but this
is not really important.
Additional changes:
* improve debug output of rows
* remove Bidi& argument of the RowPainter constructor, since it is always
an empty Bifi that is passed. This means that the Bidi class is not
used at all any more in TextMetrics.cpp. The only remaining user is
RowPainter.
Use proper font everywhere for end-of-par marker
Fix getColumnNearX for RTL text and for centered/right-justified paragraphs.
Let computeRowMetrics update the row width.
each failure.
There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:
Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525: // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345: // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403: // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143: // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83: // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92: // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303: // LASSERT: Why would this fail?
Text.cpp:995: // LASSERT: Is it safe to continue here?
When an InsetText is deleted, all lines in the inset are painted as
deleted. This status should be restored afterwards. If not, insets will be
painted in the wrong color afterwards (e.g. tables).
resetFontEdit(). The former is used for on-screen and export formatting,
and the latter is used for interactive editing.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37761 a592a061-630c-0410-9148-cb99ea01b6c8
Fixes the regression introduces in r36630. I already fixed this, but forgot to commit apparently.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36848 a592a061-630c-0410-9148-cb99ea01b6c8