Kaydet (Commit) 86f16bd9 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Thorsten Behrens

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
(cherry picked from commit 109a573a)
üst 0bd65104
......@@ -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 )
......
......@@ -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 );
}
......
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