diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-02 11:33:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-02 14:06:48 +0100 |
commit | c21fbf68da2b1ac0da3668f9494f9a8f5c4322c8 (patch) | |
tree | 26634aca50609460f09262b740a5f856a559955d /sw | |
parent | 88b1ca64c0cdb426025b246618e7e9e880c286d8 (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
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(); |