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

Caolán McNamara caolanm at redhat.com
Fri Mar 2 13:07:14 UTC 2018


 sw/source/core/txtnode/fntcache.cxx |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit c21fbf68da2b1ac0da3668f9494f9a8f5c4322c8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 2 11:33:24 2018 +0000

    forcepoint #17 nTextBreak is an index into pKernArray of len rInf.GetLen()
    
    Change-Id: I3afeaf987cc5e75362560165fea7230904530933
    Reviewed-on: https://gerrit.libreoffice.org/50630
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index f7b055bccb65..a66494b03587 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2352,9 +2352,8 @@ sal_Int32 SwFont::GetTextBreak( SwDrawTextInfo& rInf, long nTextWidth )
             rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray.get(),
                                             rInf.GetIdx(), rInf.GetLen() );
             long nCurrPos = pKernArray[nTextBreak] + nGridWidthAdd;
-            while( nTextBreak < rInf.GetLen() && nTextWidth >= nCurrPos)
+            while (++nTextBreak < rInf.GetLen() && nTextWidth >= nCurrPos)
             {
-                nTextBreak++;
                 nCurrPos = pKernArray[nTextBreak] + nGridWidthAdd * ( nTextBreak + 1 );
             }
             return nTextBreak + rInf.GetIdx();


More information about the Libreoffice-commits mailing list