summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-29 14:50:20 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-01 08:44:46 +0100
commit109a573a644ab7aa760cde30538b1122155adc9f (patch)
tree557d211ae1c47310a5f30aa62e7df5d9dad6f967
parente7283ebe7a2ba9b608a04d1efbe5504f182369a7 (diff)
sw_redlinehide_4a: fix asserts caused by invalid index in SwUpdateAttr
There is no reason for SwpHints::TryInsertHint() to add 1 to the end index of an empty hint, which results in an invalid index when the end of the hint is at the end of the node. The only user of the indexes in SwUpdateAttr is SwTextFrame::SwClientNotify() and it already extends a 0 range to 1. Change-Id: I7355bac931cd8dd390f96d04546d73273f364cda
-rw-r--r--sw/source/core/text/txtfrm.cxx3
-rw-r--r--sw/source/core/txtnode/thints.cxx5
2 files changed, 2 insertions, 6 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index b71e4c4b3863..db6b3d3b28df 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2127,9 +2127,8 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
if( IsIdxInside( nPos, nLen ) )
{
// We need to reformat anyways, even if the invalidated
- // area is NULL.
+ // range is empty.
// E.g.: empty line, set 14 pt!
- // if( !nLen ) nLen = 1;
// FootnoteNumbers need to be formatted
if( !nLen )
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 83aa88513688..1d6860f4d959 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -3253,10 +3253,7 @@ bool SwpHints::TryInsertHint(
// ... and notify listeners
if ( rNode.HasWriterListeners() )
{
- SwUpdateAttr aHint(
- nHtStart,
- nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd,
- nWhich);
+ SwUpdateAttr aHint(nHtStart, nHintEnd, nWhich);
rNode.ModifyNotification( nullptr, &aHint );
}