Kaydet (Commit) 3e6a0b6d authored tarafından Michael Stahl's avatar Michael Stahl

fdo#61428: SwTxtNode::ReplaceText: brown paperbag fix

Fix the optimization to return only if both replacement and replaced
strings are empty.
(regression from b6d45f26)

Change-Id: I984fb151a5ac3e6eb8d03f854ad6a3df88f96000
üst fb781bbf
...@@ -3350,9 +3350,9 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, ...@@ -3350,9 +3350,9 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
"SwTxtNode::ReplaceText: node text with insertion > TXTNODE_MAX."); "SwTxtNode::ReplaceText: node text with insertion > TXTNODE_MAX.");
OUString const sInserted( OUString const sInserted(
(nOverflow > 0) ? rStr.Copy(0, rStr.Len() - nOverflow) : rStr); (nOverflow > 0) ? rStr.Copy(0, rStr.Len() - nOverflow) : rStr);
if (sInserted.isEmpty()) if (sInserted.isEmpty() && 0 == nDelLen)
{ {
return; return; // nothing to do
} }
const xub_StrLen nStartPos = rStart.GetIndex(); const xub_StrLen nStartPos = rStart.GetIndex();
......
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