diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-02-25 22:06:18 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-02-25 22:10:28 +0100 |
commit | 3e6a0b6d04722d43a1fc8d3745b5e79b7ced90eb (patch) | |
tree | 51ef9e845ef590d31740076db8837fb5988b7fb6 /sw | |
parent | fb781bbf66ad95f52552c36f40d11551aebe97c4 (diff) |
fdo#61428: SwTxtNode::ReplaceText: brown paperbag fix
Fix the optimization to return only if both replacement and replaced
strings are empty.
(regression from b6d45f26ea5bcc848737921b59a16253eb1d8587)
Change-Id: I984fb151a5ac3e6eb8d03f854ad6a3df88f96000
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 421d09ea5868..0070f9e7167c 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3350,9 +3350,9 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, "SwTxtNode::ReplaceText: node text with insertion > TXTNODE_MAX."); OUString const sInserted( (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(); |