summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-02 16:29:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-02 16:30:41 +0100
commitb1030f75d3e47719ca63ec518f1da75196bead1a (patch)
treedb384e7d95511db1f77a78fc88dcae502fed450a
parent44b3e56bb4a4df59f53447c4ca4d8e02fe926206 (diff)
Resolves: tdf#86399 don't clobber cluster start caret pos
with other cluster element bounds Change-Id: I2cc976eb6a0ef42a2678be80637c7220e2247921
-rw-r--r--vcl/source/gdi/sallayout.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 15883f4e7e0e..f3481cf2b438 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1300,18 +1300,19 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth )
void GenericSalLayout::GetCaretPositions( int nMaxIndex, long* 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 pGlyphIter = m_GlyphItems.begin(), pGlyphIterEnd = m_GlyphItems.end(); pGlyphIter != pGlyphIterEnd; ++pGlyphIter )
{
- nXPos = pGlyphIter->maLinearPos.X();
+ long nXPos = pGlyphIter->maLinearPos.X();
long nXRight = nXPos + pGlyphIter->mnOrigWidth;
int n = pGlyphIter->mnCharPos;
int nCurrIdx = 2 * (n - mnMinCharPos);
+ // tdf#86399 if this is not the start of a cluster, don't overwrite the caret bounds of the cluster start
+ if (!pGlyphIter->IsClusterStart() && pCaretXArray[nCurrIdx] != -1)
+ continue;
if( !pGlyphIter->IsRTLGlyph() )
{
// normal positions for LTR case