summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-02-25 22:06:18 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-25 22:10:28 +0100
commit3e6a0b6d04722d43a1fc8d3745b5e79b7ced90eb (patch)
tree51ef9e845ef590d31740076db8837fb5988b7fb6 /sw
parentfb781bbf66ad95f52552c36f40d11551aebe97c4 (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.cxx4
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();