diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-02 16:29:53 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-04-14 15:08:07 +0200 |
commit | 34e53df32f63f3044fbbe9fd3be3774407bb332e (patch) | |
tree | 0aea37ae647ad3d506e89ef6daa78b71a28840b7 /vcl | |
parent | e5db4ed3b4bfd0cca7eabd35e34ed57a5c3bf3a6 (diff) |
Resolves: tdf#86399 don't clobber cluster start caret pos
with other cluster element bounds
(cherry picked from commit b1030f75d3e47719ca63ec518f1da75196bead1a)
Conflicts:
vcl/source/gdi/sallayout.cxx
Change-Id: I2cc976eb6a0ef42a2678be80637c7220e2247921
Reviewed-on: https://gerrit.libreoffice.org/15121
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 20a0ff656e31..ee06017a2f1f 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1251,19 +1251,20 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) void GenericSalLayout::GetCaretPositions( int nMaxIndex, sal_Int32* pCaretXArray ) const { // initialize result array - long nXPos = -1; - int i; - for( i = 0; i < nMaxIndex; ++i ) - pCaretXArray[ i ] = nXPos; + for (int i = 0; i < nMaxIndex; ++i) + pCaretXArray[i] = -1; // calculate caret positions using glyph array for( GlyphVector::const_iterator pG = m_GlyphItems.begin(), pGEnd = m_GlyphItems.end(); pG != pGEnd; ++pG ) { - nXPos = pG->maLinearPos.X(); + long nXPos = pG->maLinearPos.X(); long nXRight = nXPos + pG->mnOrigWidth; int n = pG->mnCharPos; int nCurrIdx = 2 * (n - mnMinCharPos); - if( !pG->IsRTLGlyph() ) + // tdf#86399 if this is not the start of a cluster, don't overwrite the caret bounds of the cluster start + if (!pG->IsClusterStart() && pCaretXArray[nCurrIdx] != -1) + continue; + if (!pG->IsRTLGlyph()) { // normal positions for LTR case pCaretXArray[ nCurrIdx ] = nXPos; |