summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-01-16 10:27:46 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-01-18 14:51:43 +0100
commitbc0a9076aa43a0782bcf81e55d3f84f6af0f68e8 (patch)
tree909a71cd59e868368d6e6ae8277823aee75b2685 /include
parent15e01d90b92a84cba538940614ea30df401a9976 (diff)
ooxml: Preserve shape theme attribute for solid fill
Users can select the fill color for a shape among the theme-defined colors. This results in the following XML: <wps:spPr> ... <a:solidFill> <a:schemeClr val="accent2"/> </a:solidFill> ... </wps:spPr> Now we store both the original fill color and the name of the theme-defined color, if it exists, on the import phase. They are put into the InteropGrabBag of the shape with the names OriginalSolidFillClr and SpPrSolidFillSchemeClr. Additionally, we needed to to store the decoded theme color inside StyleFillRef. On the export phase we have to take into account several combinations of factors: * If the final color for the shape fill is different from the original color, we must ignore any theme attributes and write the new color. * If the fill color is unchanged and some theme color exists, we must write the theme color. * If the fill color is unchanged and no theme color exists, we must check if the original color matches the style-defined color. If it does, we must not write any <a:solidFill> tag. * Otherwise we must write the <a:solidFill> tag with the RGB color. The method putPropertiesToGrabBag was added to the Shape object for convenience. The data files for some /sd/qa/ unit tests were updated to reflect the new properties inside the Shape InteropGrabBag. Change-Id: If0915c5442872a8acab0a8a081f60c89c97277bd
Diffstat (limited to 'include')
-rw-r--r--include/oox/drawingml/shape.hxx2
-rw-r--r--include/oox/export/drawingml.hxx1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 01cc1e97710b..c1618ba69133 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -219,6 +219,8 @@ protected:
void putPropertyToGrabBag(
const ::com::sun::star::beans::PropertyValue& pProperty );
+ void putPropertiesToGrabBag(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProperties );
std::vector< ShapePtr > maChildren; // only used for group shapes
com::sun::star::awt::Size maChSize; // only used for group shapes
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 2de1ba0187ee..65ae6f3d1281 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -118,6 +118,7 @@ public:
void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID );
void WriteSolidFill( sal_uInt32 nColor );
+ void WriteSolidFill( OUString sSchemeName );
void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString sURLPropName, sal_Int32 nXmlNamespace );