[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Wed Mar 21 15:28:22 UTC 2018


 sw/source/core/frmedt/feshview.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 655d7340536ed2847d1da873b141d8776f791d12
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 21 14:08:49 2018 +0000

    Resolves: tdf#116429 unwanted extra step in undo insert shape
    
    Change-Id: I23065275baa60a09f2a3c15513e3f2b8160e2bf0
    Reviewed-on: https://gerrit.libreoffice.org/51706
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index abdecbf05016..c1aa0935a071 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2002,6 +2002,14 @@ bool SwFEShell::ImpEndCreate()
     }
     else
     {
+        if (rSdrObj.GetName().isEmpty())
+        {
+            bool bRestore = GetDoc()->GetIDocumentUndoRedo().DoesDrawUndo();
+            GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
+            rSdrObj.SetName(GetUniqueShapeName());
+            GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(bRestore);
+        }
+
         Point aRelNullPt;
         if( OBJ_CAPTION == nIdent )
             aRelNullPt = static_cast<SdrCaptionObj&>(rSdrObj).GetTailPos();
@@ -2057,9 +2065,6 @@ bool SwFEShell::ImpEndCreate()
             pAnch = pTmp;
         }
 
-        if (rSdrObj.GetName().isEmpty())
-            rSdrObj.SetName(GetUniqueShapeName());
-
         pContact->ConnectToLayout();
 
         // mark object at frame the object is inserted at.


More information about the Libreoffice-commits mailing list