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

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


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

New commits:
commit 598329f0450df98672ef30fc0f08aa718b8f3fcd
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/15121
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 20a0ff6..ee06017 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;


More information about the Libreoffice-commits mailing list