summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-11-16 08:09:11 -0900
committerAron Budea <aron.budea@collabora.com>2021-02-12 22:28:59 +0100
commita7fc4a7f1be6842b0455a50f74d4869788e6018f (patch)
treea2de6aa690a8f52f6641288310c854710f5a10fd
parent3b7fa9b723bf4377077517b4e09cdba647a26a90 (diff)
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> (cherry picked from commit 5110cca39cc55c8977b81f7b09873e626144b29b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105995 (cherry picked from commit 46d6effe3373a39938bde57b43dc45c4a30ce33f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110834 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--sw/source/core/frmedt/feshview.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 2c6666b024f5..8935aea0c62b 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -3154,7 +3154,12 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
}
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();
}