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:43:01 +0100
commit17fb4196146f168c4e08b895bfb079533cb71574 (patch)
tree58074d0dbd1845b316c8a6a5ff67269cd3774e4f
parent71f90c9a52077f9d1bf55b3ffe818333153ac6ab (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 104a657d1242..f2b2ed9acebf 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 );
}