Kaydet (Commit) 109a573a authored tarafından Michael Stahl's avatar Michael Stahl

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
üst e7283ebe
...@@ -2127,9 +2127,8 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint) ...@@ -2127,9 +2127,8 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
if( IsIdxInside( nPos, nLen ) ) if( IsIdxInside( nPos, nLen ) )
{ {
// We need to reformat anyways, even if the invalidated // We need to reformat anyways, even if the invalidated
// area is NULL. // range is empty.
// E.g.: empty line, set 14 pt! // E.g.: empty line, set 14 pt!
// if( !nLen ) nLen = 1;
// FootnoteNumbers need to be formatted // FootnoteNumbers need to be formatted
if( !nLen ) if( !nLen )
......
...@@ -3253,10 +3253,7 @@ bool SwpHints::TryInsertHint( ...@@ -3253,10 +3253,7 @@ bool SwpHints::TryInsertHint(
// ... and notify listeners // ... and notify listeners
if ( rNode.HasWriterListeners() ) if ( rNode.HasWriterListeners() )
{ {
SwUpdateAttr aHint( SwUpdateAttr aHint(nHtStart, nHintEnd, nWhich);
nHtStart,
nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd,
nWhich);
rNode.ModifyNotification( nullptr, &aHint ); rNode.ModifyNotification( nullptr, &aHint );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment