diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-06-05 16:28:53 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-06-05 23:20:38 +0200 |
commit | 3a874f1c80c37e8b35666e1d73161ff762eb7e4c (patch) | |
tree | 1612df2e043979a60eb24ce6143dcbf5defc678d /include | |
parent | c3ce652b4a2a5891fa5664a0ad0ee8cb14aef908 (diff) |
tdf#111522 svx: fix crash with view1 doing text edit and view2 doing sdr undo
If one view has an active text edit, then current code doesn't handle
manipulating the undo text outside the text edit, so avoid problems by
simply not adding an undo action to the undo stack for shape creation or
move.
Other actions might want to do the same in the future: check for
CanDoSdrUndo() before calling SdrUndoFactory member functions.
[ Found no existing test suite similar to CppunitTest_sw_uiwriter, so
added one. ]
Change-Id: I3a364bf4fe6f9b0c13aa07283681b1045368cf7a
Reviewed-on: https://gerrit.libreoffice.org/73558
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdedtv.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index af60deaac0f6..0305b7fb144c 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -185,6 +185,12 @@ public: void SetUndoComment(const OUString& rComment, const OUString& rObjDescr) { mpModel->SetUndoComment(rComment,rObjDescr); } bool IsUndoEnabled() const; + /** + * Checks if this or other views have an active text edit, in which case object undos are not + * created. + */ + bool CanDoSdrUndo() const; + std::vector< std::unique_ptr<SdrUndoAction> > CreateConnectorUndo( SdrObject& rO ); void AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> > ); |