diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-01-27 19:32:55 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-01-28 11:00:37 +0100 |
commit | 007f260e0ba31b2449debd0329487679a851cb12 (patch) | |
tree | 1eef9d35b345c75368b41aaf7f7755f24ba622e7 /include/oox | |
parent | f876c8a442977454a29377a703dc1cf630158d00 (diff) |
ooxml: Preserve color transformations in shape style definitions
Color tags like <a:schemeClr> can have children tags that modify the
specified color. These modifications were applied on import time in
the Color object, but they were not preserved.
We added a member to Color object to preserve the unaltered list of
transformations. The method getTransformations() returns that member,
and the methods getColorTransformationName and
getColorTransformationToken were added to transform the tokens into
strings that can be added to an InteropGrabBag and viceversa.
The transformations are added to the Shape InteropGrabBag in the
method Shape::createAndInsert, and they are written back on export
time at DrawingML::WriteStyleProperties.
The data files for some /sd/qa/ unit tests were updated to reflect
the new properties inside the Shape InteropGrabBag.
Change-Id: Ieb164268c3b79f2d9b7ed3a4954b5de3b7a5811c
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/drawingml/color.hxx | 11 | ||||
-rw-r--r-- | include/oox/export/drawingml.hxx | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 481113b364d5..d3cd6a697e64 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -22,6 +22,8 @@ #include <vector> #include <boost/shared_ptr.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/uno/Sequence.hxx> #include <sal/types.h> #include <rtl/instance.hxx> #include <rtl/ustring.hxx> @@ -94,6 +96,13 @@ public: /** Returns the scheme name from the a:schemeClr element for interoperability purposes */ OUString getSchemeName() const { return msSchemeName; } + /** Returns the unaltered list of transformations for interoperability purposes */ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getTransformations() const; + + /** Translates between color transformation tokens and their names */ + static OUString getColorTransformationName( sal_Int32 nElement ); + /** Translates between color transformation token names and the corresponding token */ + static sal_Int32 getColorTransformationToken( OUString sName ); private: /** Internal helper for getColor(). */ @@ -137,6 +146,8 @@ private: sal_Int32 mnAlpha; /// Alpha value (color opacity). OUString msSchemeName; /// Scheme name from the a:schemeClr element for interoperability purposes + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + maInteropTransformations; /// Unaltered list of transformations for interoperability purposes }; typedef boost::shared_ptr< Color > ColorPtr; diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 31c6f20772f4..445e895875fb 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -100,6 +100,7 @@ protected: const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField ); OUString WriteImage( const OUString& rURL ); + void WriteStyleProperties( sal_Int32 nTokenId, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aProperties ); const char* GetComponentDir(); const char* GetRelationCompPrefix(); |