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 /include/oox | |
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 'include/oox')
-rw-r--r-- | include/oox/drawingml/diagram/diagram.hxx | 10 | ||||
-rw-r--r-- | include/oox/drawingml/shape.hxx | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/oox/drawingml/diagram/diagram.hxx b/include/oox/drawingml/diagram/diagram.hxx index a449014e4be9..a5f69b4d56bd 100644 --- a/include/oox/drawingml/diagram/diagram.hxx +++ b/include/oox/drawingml/diagram/diagram.hxx @@ -23,13 +23,16 @@ #include <rtl/ustring.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/drawingml/drawingmltypes.hxx> +#include <svx/svdobj.hxx> -#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/xml/dom/XDocument.hpp> namespace oox { namespace drawingml { +class DiagramData; +typedef std::shared_ptr<DiagramData> DiagramDataPtr; + /** load diagram data, and put resulting graphic into shape This method loads the diagram data fragments from the given paths, @@ -45,14 +48,13 @@ void loadDiagram( ShapePtr const & pShape, const oox::core::Relations& rRelations ); void loadDiagram(ShapePtr const& pShape, - const css::uno::Reference<css::xml::dom::XDocument>& dataDom, + DiagramDataPtr pDiagramData, const css::uno::Reference<css::xml::dom::XDocument>& layoutDom, const css::uno::Reference<css::xml::dom::XDocument>& styleDom, const css::uno::Reference<css::xml::dom::XDocument>& colorDom, core::XmlFilterBase& rFilter); -OOX_DLLPUBLIC void reloadDiagram(css::uno::Reference<css::drawing::XShape>& rXShape, - core::XmlFilterBase& rFilter); +OOX_DLLPUBLIC void reloadDiagram(SdrObject* pObj, core::XmlFilterBase& rFilter); } } diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 5aa6f00318a8..d55e92ae5058 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -77,6 +77,9 @@ struct ShapeStyleRef typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap; +class DiagramData; +typedef std::shared_ptr<DiagramData> DiagramDataPtr; + /** Additional information for a chart embedded in a drawing shape. */ struct ChartShapeInfo { @@ -202,6 +205,7 @@ public: const css::uno::Sequence<css::beans::PropertyValue> & getDiagramDoms() { return maDiagramDoms; } void setDiagramDoms(const css::uno::Sequence<css::beans::PropertyValue>& rDiagramDoms) { maDiagramDoms = rDiagramDoms; } + void setDiagramData(const DiagramDataPtr& pDiagramData) { mpDiagramData = pDiagramData; } css::uno::Sequence< css::uno::Sequence< css::uno::Any > >resolveRelationshipsOfTypeFromOfficeDoc( core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType ); void setLinkedTxbxAttributes(const LinkedTxbxAttr& rhs){ maLinkedTxbxAttr = rhs; }; @@ -352,6 +356,7 @@ private: bool mbHasLinkedTxbx; // this text box has linked text box ? css::uno::Sequence<css::beans::PropertyValue> maDiagramDoms; + DiagramDataPtr mpDiagramData; /// Z-Order. sal_Int32 mnZOrder = 0; |