summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/fntcache.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-02 11:33:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-02 16:48:19 +0100
commit5fd0c2328f8c78a1f63a38156d15ebdf8d9b4590 (patch)
treee33402f49ebf7b87ba7038c6f42534c9d0475a21 /sw/source/core/txtnode/fntcache.cxx
parent01f3d84963fc6ff96c50179bdf67c6888da7bf01 (diff)
forcepoint #17 nTextBreak is an index into pKernArray of len rInf.GetLen()
Change-Id: I3afeaf987cc5e75362560165fea7230904530933 Reviewed-on: https://gerrit.libreoffice.org/50628 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/txtnode/fntcache.cxx')
-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 599452c0b5a3..842c91002989 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2347,9 +2347,8 @@ sal_Int32 SwFont::GetTextBreak( SwDrawTextInfo const & 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();