summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-02 11:33:24 +0000
committerAndras Timar <andras.timar@collabora.com>2018-03-06 21:57:32 +0100
commit8187f7aa413e7ef7b377eea2b057d336bf256867 (patch)
tree053fe5ce065a852ce2a0dd46e472ca4c9c49b49f
parentofz#6656 -1 isn't a good flag for all elements filled (diff)
downloadcore-distro/collabora/cd-5.3.tar.gz
core-distro/collabora/cd-5.3.zip
forcepoint #17 nTextBreak is an index into pKernArray of len rInf.GetLen() distro/collabora/cd-5.3
Change-Id: I3afeaf987cc5e75362560165fea7230904530933 Reviewed-on: https://gerrit.libreoffice.org/50630 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c21fbf68da2b1ac0da3668f9494f9a8f5c4322c8)
-rw-r--r--sw/source/core/txtnode/fntcache.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index e333d4680358..6b9547c00621 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2367,9 +2367,8 @@ sal_Int32 SwFont::GetTextBreak( SwDrawTextInfo& rInf, long nTextWidth )
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
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 );
}
delete[] pKernArray;