summaryrefslogtreecommitdiff
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 16:44:50 +0100
commit54ac8cf00820ae17f25251f16989485f4271cbe7 (patch)
treedd31ac562ed776c45302f181ddeb7ea200f1592b
parent9445d4e67e28ab09e4a1d3d5d19585200ccd547a (diff)
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@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;