summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-07-27 20:37:54 +0200
committerMichael Stahl <mstahl@redhat.com>2017-07-27 22:08:06 +0200
commit5989c5722a9ce424803d8fb7858ad98c10d0601d (patch)
treebc3935bc55d178cb2aecf14e33d30f3233109ae7 /sw
parente488c8d9eb85bd0d8d250f9839e11357418ebc84 (diff)
sw: assert that index is valid in SwFntObj::DrawText()
If nCnt = 0 the only thing that will happen is an infinite loop. Change-Id: I23c5d0ff9d36fbfb3eabc93476fe3ca1c558f91c
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 97f2ad1c8c39..29ddcabedee1 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1531,7 +1531,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
sal_Int32 nCnt = rInf.GetText().getLength();
if ( nCnt < rInf.GetIdx() )
- nCnt = 0;
+ assert(false); // layout bug, not handled below
else
nCnt = nCnt - rInf.GetIdx();
nCnt = std::min<sal_Int32>( nCnt, rInf.GetLen() );