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

New commits:
commit 655d7340536ed2847d1da873b141d8776f791d12
Author: Caolán McNamara <caol...@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 <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@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.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to