diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2022-04-13 17:17:35 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2022-04-14 11:02:19 +0200 |
commit | edadfb564f1334887df473f9bc05dab6b1e7ef9d (patch) | |
tree | fc27269595b33ca64a0c01c0c804c2be785a647c /include/svx/diagram | |
parent | 16bbd139d6a54c47e4fd4a034dbcc238a75f2097 (diff) |
Advanced Diagram support: Secure properties at Diagram ModelData
Additionally to the Text/Attributes already saved/secured after
Diagram import, secure more data that is part of the Diagram
ModelData. This is about attributes (e.g. FillStyle/LineStyle,
TextAttributes, ...) in UNO API formt that will be secured/
attached to the Diagram ModelData in it's
svx::diagram::Point structure.
This is done for all those entries for which a XShape will/
would be incarnated, thus associated to entries that will
get a visualization, including the BackgroundObject.
From that data, at re-creation time, the attributes can be
re-applied to the re-created XShape(s), also after changes
to the Diagram Model Data (e.g. Add/Remove).
This is - besides the already added securing of the Style/
Theme - a 2nd method for lossless re-creation. For the
BackgroundObject - if it has FillStyles - it is even the
only method to secure that data and thus necessary for that
case. The selection of atributes that gets secured is minimal
for now and may/need to be extended for existing cases
accordingly.
Change-Id: Ie9b72b9b9135113cf858d57fe6cd8622d736c4a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132976
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include/svx/diagram')
-rw-r--r-- | include/svx/diagram/datamodel.hxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/svx/diagram/datamodel.hxx b/include/svx/diagram/datamodel.hxx index c42a3d26a115..686835ee378f 100644 --- a/include/svx/diagram/datamodel.hxx +++ b/include/svx/diagram/datamodel.hxx @@ -29,8 +29,8 @@ #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/xml/dom/XDocument.hpp> +#include <com/sun/star/drawing/XShape.hpp> namespace svx::diagram { @@ -83,11 +83,21 @@ struct SVXCORE_DLLPUBLIC TextBody OUString msText; // attributes from TextBody::getTextProperties() - css::uno::Sequence< css::beans::PropertyValue > maTextProps; + std::vector< std::pair< OUString, css::uno::Any >> maTextProps; }; typedef std::shared_ptr< TextBody > TextBodyPtr; +/** Styles for a Point (FillStyle/LineStyle/...) + */ +struct SVXCORE_DLLPUBLIC PointStyle +{ + // attributes (LineStyle/FillStyle/...) + std::vector< std::pair< OUString, css::uno::Any >> maProperties; +}; + +typedef std::shared_ptr< PointStyle > PointStylePtr; + /** A point */ struct SVXCORE_DLLPUBLIC Point @@ -95,6 +105,7 @@ struct SVXCORE_DLLPUBLIC Point Point(); TextBodyPtr msTextBody; + PointStylePtr msPointStylePtr; OUString msCnxId; OUString msModelId; @@ -136,6 +147,9 @@ struct SVXCORE_DLLPUBLIC Point bool mbCustomVerticalFlip; bool mbCustomText; bool mbIsPlaceholder; + + void securePropertiesFromXShape(const css::uno::Reference< css::drawing::XShape >& rXShape); + void restorePropertiesToXShape(const css::uno::Reference< css::drawing::XShape >& rXShape) const; }; typedef std::vector< Point > Points; |