summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-11 19:07:00 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-11 22:20:14 +0100
commit42e4d237692a10aaecabbc3499d14d3860d93478 (patch)
tree1adbd10e7fd6c52fcaa079f8ab1708a8af8b0d05 /sw
parentb436bbf16a324439ad864465bfd9120c03a02f38 (diff)
ooxml: Preserve color transformations for shape theme colors
Colors can have modifiers like in the following example: <a:schemeClr val="accent6"> <a:lumMod val="40000"/> <a:lumOff val="60000"/> </a:schemeClr> In the case of RGB colors, the transformations are merged within the RGB color itself on import, so there's no need to preserve the original transformations, but that's necessary in the case of scheme colors. Slightly modified an existing unit test to check this feature too. Change-Id: I3a03a56f2b633f283c392e54842b326bd4df316b
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docxbin18703 -> 18757 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx15
2 files changed, 13 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx
index 74db64e7f95a..134f629fb63d 100644
--- a/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx
+++ b/sw/qa/extras/ooxmlexport/data/shape-theme-preservation.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 26b2fe6097c9..232c6e8b88f1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2608,6 +2608,17 @@ DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.d
"/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:schemeClr",
"val", "accent3");
+ // check color transformations applied to theme colors have been preserved
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumMod",
+ "val", "40000");
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumOff",
+ "val", "60000");
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:schemeClr/a:lumMod",
+ "val", "50000");
+
// check direct color assignments have been preserved
OUString sFillColor = getXPath(pXmlDocument,
"/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:srgbClr",
@@ -2636,10 +2647,10 @@ DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.d
// check colors are properly applied to shapes on import
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape1, "FillColor"));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0xf79646), getProperty<sal_Int32>(xShape2, "FillColor"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfcd5b5), getProperty<sal_Int32>(xShape2, "FillColor"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), getProperty<sal_Int32>(xShape3, "FillColor"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x3a5f8b), getProperty<sal_Int32>(xShape1, "LineColor"));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(xShape2, "LineColor"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f6228), getProperty<sal_Int32>(xShape2, "LineColor"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(xShape3, "LineColor"));
// check line properties are properly applied to shapes on import