diff options
author | Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com> | 2019-07-22 15:04:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-05 09:52:00 +0200 |
commit | 8a029e4a39d9afda5334bc546338645241f656d6 (patch) | |
tree | a6b1770cb1c5a2ec5a36dc5e33f3bfd71a418b4f /svx | |
parent | f0390929d3e71ab434f9ce8d88c2dc2f4cc0ea6e (diff) |
SmartArt: store diagram data model in SdrObject
It will allow modifying loaded diagram and exporting it. This data is used for
regenerating diagram instead of parsing xml fragment every time.
Also provided an interface for UI that can be extended to show, add and remove
nodes from data model.
It is stored as SdrObject field because diagram top-level shape is group shape.
Item set doesn't exist for them and storing data in child shapes is not
possible here because children are removed and recreated on every diagram
reload.
Change-Id: I84e5ec955f638b254fef9ef9d1731ca7938982b7
Reviewed-on: https://gerrit.libreoffice.org/76121
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 65e8492145fe..3439b50ac48e 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -210,6 +210,8 @@ struct SdrObject::Impl boost::optional<double> mnRelativeHeight; sal_Int16 meRelativeHeightRelation; + std::shared_ptr<DiagramDataInterface> mpDiagramData; + Impl() : meRelativeWidthRelation(text::RelOrientation::PAGE_FRAME), meRelativeHeightRelation(text::RelOrientation::PAGE_FRAME) {} @@ -558,6 +560,16 @@ sal_Int16 SdrObject::GetRelativeHeightRelation() const return mpImpl->meRelativeHeightRelation; } +void SdrObject::SetDiagramData(std::shared_ptr<DiagramDataInterface> pDiagramData) +{ + mpImpl->mpDiagramData = pDiagramData; +} + +std::shared_ptr<DiagramDataInterface> SdrObject::GetDiagramData() const +{ + return mpImpl->mpDiagramData; +} + SfxItemPool& SdrObject::GetObjectItemPool() const { return getSdrModelFromSdrObject().GetItemPool(); |