[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source

Michael Stahl mstahl at redhat.com
Mon Feb 25 13:19:55 PST 2013


 sw/source/core/txtnode/ndtxt.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3f5361a9402cd6df4da7fb98108ae1906b41edd3
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 25 22:06:18 2013 +0100

    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
    (cherry picked from commit 3e6a0b6d04722d43a1fc8d3745b5e79b7ced90eb)
    Reviewed-on: https://gerrit.libreoffice.org/2407
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ee1dd01..2cc28ae 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3337,9 +3337,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();


More information about the Libreoffice-commits mailing list