summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-16 09:56:58 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-16 14:11:22 +0200
commitbe415a0f9a65d44d1042b313141f49c617bedd93 (patch)
treeb1aa4442f415ffb70d9f419d0c5f69a2d177237f /sw/qa
parenta5835285068c1b03171b7953c2fea185111f4da2 (diff)
ooxml: Preserve shape effects when there's more than one
Transformed the preservation process of shape effects to be able to store more than one effect. For that we: * Created the Effect struct and added a vector member to the EffectProperties struct. * Changed the shadow effect to use the new Effect struct, EffectShadowProperties struct is preserved because the direction field still has some use but we should remove it. * Changed the structure of the grab bag to store more than one effect. * Modified an existing unit test to check shapes with several effects. Change-Id: I0dd908fa1d9578827c02ef6272fc9e2b914391be
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docxbin22527 -> 23996 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx29
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx
index bd0ac8026f39..f2b91ea45fd7 100644
--- a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx
+++ b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 2ea356247d35..736546a51e46 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1143,6 +1143,35 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
"wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection/*",
0 ); // should not be present
+
+ // 7th shape with several effects: glow, inner shadow and reflection
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow",
+ "rad", "63500");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:schemeClr",
+ "val", "accent2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:schemeClr/*",
+ 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
+ "blurRad", "63500");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
+ "dir", "2700000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr",
+ "val", "000000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha",
+ "val", "50000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
+ "blurRad", "6350");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
+ "stA", "52000");
}
DECLARE_OOXMLEXPORT_TEST(testShape3DEffectPreservation, "shape-3d-effect-preservation.docx")