summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-09-23 17:38:33 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-09-24 10:15:30 +0200
commit9ec2c77046901fdacca77753052b54c81e6bc82c (patch)
tree8cd334fcc4d411dedc55f2082654477737b768ee /sw
parent8684de9aae185ff340adc63ec8f1e5207e6e8cec (diff)
tdf#127652 sw_redlinehide: don't set invalid SwTextFrame offsets
The obvious problem here is that if a deletion spans multiple text frames, the offset of the 2nd one must not be reduced lower than the start position of the deletion; apparently this fixes the subsequent crashes with stale text portions having now invalid indexes into the string. (regression from 0acde7514e666fc04805fd36503bd174162336ca) Change-Id: Iaf9e2c5ca06ed36dc0e8611891d19c22f7661d34 Reviewed-on: https://gerrit.libreoffice.org/79421 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/txtfrm.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index a6264530a96b..b18d64c22ecf 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1871,7 +1871,8 @@ static void lcl_ModifyOfst(SwTextFrame & rFrame,
assert(nLen != TextFrameIndex(COMPLETE_STRING));
if (rFrame.IsFollow() && nPos < rFrame.GetOfst())
{
- rFrame.ManipOfst( std::max(TextFrameIndex(0), op(rFrame.GetOfst(), nLen)) );
+ rFrame.ManipOfst( std::max(nPos, op(rFrame.GetOfst(), nLen)) );
+ assert(sal_Int32(rFrame.GetOfst()) <= rFrame.GetText().getLength());
}
}