[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - vcl/source

Caolán McNamara caolanm at redhat.com
Wed Apr 8 04:41:07 PDT 2015


 vcl/source/gdi/sallayout.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 784ff3f0765eb94d025ef789f15ef10f51b8cc15
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 2 16:29:53 2015 +0100

    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/15119
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index c30a99a..87df81f 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1250,19 +1250,20 @@ 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 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;


More information about the Libreoffice-commits mailing list