summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdedtv1.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-10-07 16:48:46 +0200
committerTomaž Vajngerl <quikee@gmail.com>2021-11-12 14:08:08 +0100
commit723db12abd7c238e11dab0271516b6f4415e52eb (patch)
treeb61726c403a558caf81691db11f5bd3a33227ba4 /svx/source/svdraw/svdedtv1.cxx
parent567f8d111701c288671440b6f75d67a57be43ff5 (diff)
svx: Don't end text edit mode for all views
This allows multiple views to not disturb each other editing inside a impress document. With the ending of text edit for all views still enabled, one view can cancel other views text editing just by moving or resizing a unrelated shape in the document. To make this possible we also need a view-local undo manager for the text edit mode, which is independent of the document undo manager. When the text edit mode ends, all the changes will be added as one change to the document undo stack. This prevents any conflicts in the undo stack that could be made when 2 views are editing the same document at the same time. This also adds the test for the new use case and changes the existing tests to reflect the change. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123220 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit c175c1dc19d0edc8ca66e39f0b4b8af04e3d6c87) Change-Id: I04edb4f91d7e111a490c946f7121cbca75f818d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125070 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source/svdraw/svdedtv1.cxx')
-rw-r--r--svx/source/svdraw/svdedtv1.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 830ef238c590..21a0830bbd1a 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -99,7 +99,7 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditPosSize));
}
@@ -190,7 +190,7 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr(SvxResId(STR_EditMove));
if (bCopy)
aStr += SvxResId(STR_EditWithCopy);
@@ -223,7 +223,7 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, cons
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditResize)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -258,7 +258,7 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditResize));
}
@@ -319,7 +319,7 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditRotate)};
if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
BegUndo(aStr);
@@ -376,7 +376,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr;
Point aDif(rRef2-rRef1);
if (aDif.X()==0)
@@ -476,7 +476,7 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, b
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditShear)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -592,7 +592,7 @@ void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookM
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -666,7 +666,7 @@ void SdrEditView::DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon&
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditDistort)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -1111,7 +1111,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
}
@@ -1291,7 +1291,7 @@ void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRe
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr;
if (pStyleSheet!=nullptr)
aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
@@ -1859,7 +1859,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr(GetDescriptionOfMarkedObjects());
if (eHor==SdrHorAlign::NONE)
{