tdf#130629 Don't add object insert undo twice

Change-Id: I074afd4397b6fc4631bd00655de56b8a154d7dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105955
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index ee81434..767e4e7 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -3137,7 +3137,12 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect
        }
        SdrPageView* pPageView = pDrawView->GetSdrPageView();
        SdrCreateView::SetupObjLayer(pPageView, pDrawView->GetActiveLayer(), pObj);
        // switch undo off or this combined with ImpEndCreate will cause two undos
        // see comment made in SwFEShell::EndCreate (we create our own undo-object!)
        const bool bUndo(GetDoc()->GetIDocumentUndoRedo().DoesUndo());
        GetDoc()->GetIDocumentUndoRedo().DoUndo(false);
        pDrawView->InsertObjectAtView(pObj, *pPageView);
        GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
    }
    ImpEndCreate();
}