diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-25 18:04:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-26 11:44:32 +0100 |
commit | e18392a8b48c696e9dc40383fd98f5b325763856 (patch) | |
tree | bf1a3d11ac32864ed4fd034e15b991d5e2b2bb49 /svx/source/svdraw | |
parent | a3ac2bdfa475fa34172e08d1ec30114d4cd63da1 (diff) |
tdf#132368 svx: empty the interop grab-bag on ending text edit
Regression from commit aafaf1f55fa413ad49d4556cf7c0a713dd206ae4 (PPTX
export: save SmartArt as diagram instead of group of shapes,
2019-03-13), the idea of interop grab-bag was to carry additional
information around as long as the object is not changed.
However, actual clearing of the grab-bag was never implemented, do this
when editing shape text.
An alternative would be to do this in SdrObject::SetChanged(), but
Writer sets the layer of SdrObjects during layout (when the import
filter is already finished and undo is enabled), so that would mean loss
of the smartart metadata for DOCX.
(cherry picked from commit a01ae07740e5c311fcc37f2ac2e2a0a2a1935920)
Conflicts:
svx/qa/unit/svdraw.cxx
Change-Id: I9ab205b4ef84169f4b5a16b86fe9a152e3370a6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111596
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 51209c92ef43..d69897077c6b 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1766,6 +1766,26 @@ void SdrObject::SetOutlinerParaObject(std::unique_ptr<OutlinerParaObject> pTextO if (GetCurrentBoundRect()!=aBoundRect0) { SendUserCall(SdrUserCallType::Resize,aBoundRect0); } + + if (getSdrModelFromSdrObject().IsUndoEnabled()) + { + // Don't do this during import. + SdrObject* pTopGroupObj = nullptr; + if (getParentSdrObjectFromSdrObject()) + { + pTopGroupObj = getParentSdrObjectFromSdrObject(); + while (pTopGroupObj->getParentSdrObjectFromSdrObject()) + { + pTopGroupObj = pTopGroupObj->getParentSdrObjectFromSdrObject(); + } + } + if (pTopGroupObj) + { + // A shape was modified, which is in a group shape. Empty the group shape's grab-bag, + // which potentially contains the old text of the shapes in case of diagrams. + pTopGroupObj->SetGrabBagItem(uno::makeAny(uno::Sequence<beans::PropertyValue>())); + } + } } void SdrObject::NbcSetOutlinerParaObject(std::unique_ptr<OutlinerParaObject> /*pTextObject*/) |