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 15:08:26 +0100 |
commit | 7a7116f2f570eb2d3bdc681a357046391efe9857 (patch) | |
tree | ea48d6ba6e8934739b03348900bf186d0c8a3d1c /sw/source/core | |
parent | 731aa4b4b93bea443c2a44a37fa6289aeb84a873 (diff) |
forcepoint #17 nTextBreak is an index into pKernArray of len rInf.GetLen()
Change-Id: I3afeaf987cc5e75362560165fea7230904530933
Reviewed-on: https://gerrit.libreoffice.org/50629
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/core')
-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 fbb4ee5f4951..a7484a5ac4a7 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(); |