summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-23 16:25:02 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-23 21:10:11 +0100
commit2e4fbdf192ec9468ddbd0fcfe2e36d4db1e36837 (patch)
tree88714b2572e8ac8f7578c8b45b92e95501d0cf59
parent5de977a4ca344c4c3f288951504f58937fe64124 (diff)
tdf#138428 don't record SetName("ScPostIt") in undo
Change-Id: Iae87db47907078282e48035ad7892dbf52942e53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106432 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/source/core/data/postit.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 9ccb6c31a8f5..92221fe87430 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -382,9 +382,17 @@ void ScCaptionCreator::CreateCaption( bool bShown, bool bTailFront )
*mrDoc.GetDrawLayer(), // TTTT should ret a ref?
aTextRect,
aTailPos));
+
// tdf#114956 a way to recognize that this SdrCaption is for a ScPostit in
// SdrTextObj::AdjustTextFrameWidthAndHeight
+ SdrModel& rModel = mxCaption->getSdrModelFromSdrObject();
+ const bool bUndoEnabled = rModel.IsUndoEnabled();
+ if (bUndoEnabled)
+ rModel.EnableUndo(false);
mxCaption->SetName("ScPostIt");
+ if (bUndoEnabled)
+ rModel.EnableUndo(true);
+
// basic caption settings
ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
}