Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include <swmodeltestbase.hxx>
11 :
12 : #if !defined(WNT)
13 :
14 : #include <string>
15 :
16 18 : class Test : public SwModelTestBase
17 : {
18 : public:
19 18 : Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {}
20 :
21 : protected:
22 : /**
23 : * Blacklist handling
24 : */
25 9 : bool mustTestImportOf(const char* filename) const SAL_OVERRIDE {
26 : // If the testcase is stored in some other format, it's pointless to test.
27 9 : return (OString(filename).endsWith(".docx"));
28 : }
29 : };
30 :
31 : #if 1
32 : #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
33 :
34 : // For testing during development of a tast, you want to use
35 : // DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0
36 : // Of course, don't forget to set back to #if 1 when you are done :-)
37 : #else
38 : #define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
39 :
40 : #undef DECLARE_OOXMLEXPORT_TEST
41 : #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled()
42 : #endif
43 :
44 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_GlowShadowReflection, "TextEffects_Glow_Shadow_Reflection.docx")
45 : {
46 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
47 2 : if (!pXmlDoc)
48 3 : return;
49 :
50 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow", "rad").match("63500"));
51 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr", "val").match("00B0F0"));
52 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr/w14:alpha", "val").match("60000"));
53 :
54 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow", "rad").match("228600"));
55 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr", "val").match("accent6"));
56 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:alpha", "val").match("60000"));
57 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:satMod", "val").match("175000"));
58 :
59 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "blurRad").match("63500"));
60 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dist").match("0"));
61 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dir").match("1800000"));
62 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sx").match("100000"));
63 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sy").match("-30000"));
64 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "kx").match("-800400"));
65 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "ky").match("0"));
66 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "algn").match("bl"));
67 :
68 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr", "val").match("accent3"));
69 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:alpha", "val").match("38000"));
70 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:lumMod", "val").match("75000"));
71 :
72 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "blurRad").match("190500"));
73 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dist").match("190500"));
74 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dir").match("3000000"));
75 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sx").match("100000"));
76 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sy").match("100000"));
77 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "kx").match("0"));
78 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "ky").match("0"));
79 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "algn").match("ctr"));
80 :
81 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr", "val").match("FF0000"));
82 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr/w14:alpha", "val").match("10000"));
83 :
84 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "blurRad").match("6350"));
85 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stA").match("60000"));
86 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stPos").match("0"));
87 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endA").match("900"));
88 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endPos").match("60000"));
89 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dist").match("60007"));
90 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dir").match("5400000"));
91 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "fadeDir").match("5400000"));
92 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sx").match("100000"));
93 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sy").match("-100000"));
94 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "kx").match("0"));
95 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "ky").match("0"));
96 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "algn").match("bl"));
97 :
98 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "blurRad").match("6350"));
99 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stA").match("55000"));
100 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stPos").match("0"));
101 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endA").match("300"));
102 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endPos").match("45500"));
103 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dist").match("0"));
104 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dir").match("5400000"));
105 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "fadeDir").match("5400000"));
106 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sx").match("100000"));
107 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sy").match("-100000"));
108 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "kx").match("0"));
109 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "ky").match("0"));
110 1 : CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "algn").match("bl"));
111 : }
112 :
113 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_TextOutline, "TextEffects_TextOutline.docx")
114 : {
115 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
116 2 : if (!pXmlDoc)
117 3 : return;
118 :
119 : // Paragraph 1
120 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "w", "50800");
121 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
122 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "dbl");
123 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
124 :
125 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "70000");
126 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr", "val", "92D050");
127 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:alpha", "val", "30000");
128 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumMod", "val", "75000");
129 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumOff", "val", "25000");
130 :
131 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "30000");
132 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1");
133 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:alpha", "val", "55000");
134 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "40000");
135 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "60000");
136 :
137 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "0");
138 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]/w14:srgbClr", "val", "0070C0");
139 :
140 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]", "pos", "100000");
141 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]/w14:schemeClr", "val", "accent4");
142 :
143 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "ang", "3600000");
144 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "scaled", "0");
145 :
146 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "dash");
147 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:miter", "lim", "0");
148 :
149 : // Paragraph 2
150 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "w", "9525");
151 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
152 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng");
153 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
154 :
155 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:solidFill/w14:srgbClr", "val", "FF0000");
156 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid");
157 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1);
158 :
159 : // Paragraph 3
160 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "w", "9525");
161 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
162 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng");
163 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
164 :
165 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:noFill", 1);
166 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid");
167 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1);
168 : }
169 :
170 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_TextFill, "TextEffects_TextFill.docx")
171 : {
172 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
173 2 : if (!pXmlDoc)
174 3 : return;
175 : // Paragraph 1 has no textFill
176 :
177 : // Paragraph 2
178 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textFill/w14:noFill", 1);
179 :
180 : // Paragraph 3
181 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill", 1);
182 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr", "val", "accent1");
183 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:alpha", "val", "5000");
184 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "40000");
185 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumOff", "val", "60000");
186 :
187 : // Paragraph 4
188 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill", 1);
189 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0");
190 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1");
191 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "5000");
192 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "67000");
193 :
194 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "50000");
195 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr", "val", "00B0F0");
196 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:alpha", "val", "10000");
197 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:lumMod", "val", "80000");
198 :
199 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000");
200 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1");
201 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:alpha", "val", "15000");
202 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000");
203 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val", "40000");
204 :
205 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "ang", "16200000");
206 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "scaled", "0");
207 : }
208 :
209 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing, "TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx")
210 : {
211 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
212 2 : if (!pXmlDoc)
213 3 : return;
214 :
215 : // Paragraph 1 - w14:props3d
216 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", 1);
217 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "extrusionH", "63500");
218 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "contourW", "25400");
219 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "prstMaterial", "softEdge");
220 :
221 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "w", "38100");
222 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "h", "38100");
223 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "prst", "relaxedInset");
224 :
225 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "w", "69850");
226 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "h", "38100");
227 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "prst", "cross");
228 :
229 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr", 1);
230 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr", "val", "accent2");
231 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000");
232 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000");
233 :
234 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr", 1);
235 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr/w14:srgbClr", "val", "92D050");
236 :
237 : // Paragraph 2 - w14:ligatures
238 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", 1);
239 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", "val", "standard");
240 :
241 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", 1);
242 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", "val", "standardContextual");
243 :
244 : // Paragraph 3 - w14:numFurm and w14:numSpacing
245 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", 1);
246 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", "val", "lining");
247 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", 1);
248 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", "val", "tabular");
249 :
250 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", 1);
251 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", "val", "oldStyle");
252 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", 1);
253 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", "val", "proportional");
254 : }
255 :
256 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_StylisticSets_CntxtAlts, "TextEffects_StylisticSets_CntxtAlts.docx")
257 : {
258 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
259 2 : if (!pXmlDoc)
260 3 : return;
261 :
262 : // Paragraph 1 - w14:stylisticSets
263 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", 1);
264 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "4");
265 :
266 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", 1);
267 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "2");
268 :
269 : // Paragraph 1 - w14:cntxtAlts
270 1 : assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:cntxtAlts", 1);
271 :
272 : }
273 :
274 14 : DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.docx")
275 : {
276 2 : xmlDocPtr pXmlDocument = parseExport("word/document.xml");
277 2 : if (!pXmlDocument)
278 1 : return;
279 :
280 1 : assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14");
281 :
282 1 : xmlDocPtr pXmlStyles = parseExport("word/styles.xml");
283 1 : if (!pXmlStyles)
284 0 : return;
285 :
286 1 : assertXPath(pXmlStyles, "/w:styles", "Ignorable", "w14");
287 : }
288 :
289 14 : DECLARE_OOXMLEXPORT_TEST(Test_CompatSettingsForW14, "TextEffects_StylisticSets_CntxtAlts.docx")
290 : {
291 2 : xmlDocPtr pXmlDoc = parseExport("word/settings.xml");
292 2 : if (!pXmlDoc)
293 3 : return;
294 :
295 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting", 5);
296 :
297 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode");
298 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word");
299 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "val", "15"); // document was made with Word2013 -> 15
300 :
301 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "name", "overrideTableStyleFontSizeAndJustification");
302 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "uri", "http://schemas.microsoft.com/office/word");
303 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "val", "1");
304 :
305 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "name", "enableOpenTypeFeatures");
306 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "uri", "http://schemas.microsoft.com/office/word");
307 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "val", "1");
308 :
309 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "name", "doNotFlipMirrorIndents");
310 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "uri", "http://schemas.microsoft.com/office/word");
311 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "val", "1");
312 :
313 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "name", "differentiateMultirowTableHeaders");
314 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "uri", "http://schemas.microsoft.com/office/word");
315 1 : assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "val", "1");
316 : }
317 :
318 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_Groupshapes, "TextEffects_Groupshapes.docx")
319 : {
320 2 : xmlDocPtr pXmlDoc = parseExport("word/document.xml");
321 2 : if (!pXmlDoc)
322 3 : return;
323 :
324 1 : std::string sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp";
325 :
326 1 : assertXPath(pXmlDoc, (sPathToWGP + "/wps:wsp").c_str(), 2);
327 :
328 2 : std::string sPathToShapeRunProperties = sPathToWGP + "/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr";
329 :
330 : // Glow
331 2 : std::string sPathGlow = sPathToShapeRunProperties + "/w14:glow";
332 1 : assertXPath(pXmlDoc, (sPathGlow).c_str(), 1);
333 1 : assertXPath(pXmlDoc, (sPathGlow).c_str(), "rad", "127000");
334 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:srgbClr").c_str(), "val", "00B050");
335 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:srgbClr/w14:alpha").c_str(), "val", "60000");
336 :
337 : // Shadow
338 2 : std::string sPathShadow = sPathToShapeRunProperties + "/w14:shadow";
339 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), 1);
340 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "blurRad", "127000");
341 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dist", "787400");
342 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dir", "12720000");
343 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sx", "70000");
344 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sy", "70000");
345 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "kx", "0");
346 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "ky", "0");
347 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "algn", "l");
348 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr").c_str(), "val", "92D050");
349 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr/w14:alpha").c_str(), "val", "40000");
350 :
351 : // Reflection
352 2 : std::string sPathReflection = sPathToShapeRunProperties + "/w14:reflection";
353 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), 1);
354 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "blurRad", "139700");
355 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stA", "47000");
356 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stPos", "0");
357 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endA", "0");
358 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endPos", "85000");
359 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dist", "63500");
360 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dir", "5400000");
361 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "fadeDir", "5400000");
362 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sx", "100000");
363 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sy", "-100000");
364 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "kx", "0");
365 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "ky", "0");
366 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "algn", "bl");
367 :
368 : // TextOutline
369 2 : std::string sPathTextOutline = sPathToShapeRunProperties + "/w14:textOutline";
370 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), 1);
371 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "w", "25400");
372 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cap", "rnd");
373 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cmpd", "sng");
374 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "algn", "ctr");
375 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr").c_str(), "val", "accent2");
376 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha").c_str(), "val", "40000");
377 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
378 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:prstDash").c_str(), "val", "solid");
379 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:round").c_str(), 1);
380 :
381 : // TextFill
382 2 : std::string sPathTextFill = sPathToShapeRunProperties + "/w14:textFill";
383 1 : assertXPath(pXmlDoc, (sPathTextFill).c_str(), 1);
384 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]").c_str(), "pos", "0");
385 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr").c_str(), "val", "accent4");
386 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]").c_str(), "pos", "41000");
387 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr").c_str(), "val", "accent6");
388 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod").c_str(), "val", "60000");
389 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff").c_str(), "val", "40000");
390 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]").c_str(), "pos", "87000");
391 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr").c_str(), "val", "accent5");
392 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod").c_str(), "val", "60000");
393 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff").c_str(), "val", "40000");
394 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:lin").c_str(), "ang", "5400000");
395 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:lin").c_str(), "scaled", "0");
396 :
397 : // Props3D
398 2 : std::string sPathProps3D = sPathToShapeRunProperties + "/w14:props3d";
399 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), 1);
400 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "extrusionH", "63500");
401 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "contourW", "12700");
402 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "prstMaterial", "warmMatte");
403 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "w", "38100");
404 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "h", "38100");
405 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "prst", "circle");
406 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr").c_str(), "val", "accent2");
407 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod").c_str(), "val", "60000");
408 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff").c_str(), "val", "40000");
409 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr").c_str(), "val", "accent4");
410 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
411 :
412 : // Ligatures
413 2 : std::string sPathLigatures = sPathToShapeRunProperties + "/w14:ligatures";
414 1 : assertXPath(pXmlDoc, (sPathLigatures).c_str(), 1);
415 1 : assertXPath(pXmlDoc, (sPathLigatures).c_str(), "val", "standard");
416 :
417 : // NumForm
418 2 : std::string sPathNumForm = sPathToShapeRunProperties + "/w14:numForm";
419 1 : assertXPath(pXmlDoc, (sPathNumForm).c_str(), 1);
420 1 : assertXPath(pXmlDoc, (sPathNumForm).c_str(), "val", "oldStyle");
421 :
422 : // NumSpacing
423 2 : std::string sPathNumSpacing = sPathToShapeRunProperties + "/w14:numSpacing";
424 1 : assertXPath(pXmlDoc, (sPathNumSpacing).c_str(), 1);
425 1 : assertXPath(pXmlDoc, (sPathNumSpacing).c_str(), "val", "tabular");
426 :
427 : // StylisticSets
428 2 : std::string sPathStylisticSets = sPathToShapeRunProperties + "/w14:stylisticSets";
429 1 : assertXPath(pXmlDoc, (sPathStylisticSets).c_str(), 1);
430 2 : assertXPath(pXmlDoc, (sPathStylisticSets+"/w14:styleSet").c_str(), "id", "1");
431 : }
432 :
433 14 : DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_InStyleXml, "TextEffects_InStyle.docx")
434 : {
435 2 : xmlDocPtr pXmlDoc = parseExport("word/styles.xml");
436 2 : if (!pXmlDoc)
437 3 : return;
438 :
439 1 : std::string sPathToCharacterStyle = "/w:styles/w:style[3]";
440 :
441 1 : assertXPath(pXmlDoc, (sPathToCharacterStyle).c_str(), "type", "character");
442 1 : assertXPath(pXmlDoc, (sPathToCharacterStyle).c_str(), "styleId", "TextEffectsStyleChar");
443 1 : assertXPath(pXmlDoc, (sPathToCharacterStyle).c_str(), "customStyle", "1");
444 :
445 : {
446 1 : std::string sPathToRun = sPathToCharacterStyle + "/w:rPr";
447 :
448 : // Glow
449 2 : std::string sPathGlow = sPathToRun + "/w14:glow";
450 1 : assertXPath(pXmlDoc, (sPathGlow).c_str(), "rad", "63500");
451 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr").c_str(), "val", "accent2");
452 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr/w14:alpha").c_str(), "val", "60000");
453 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr/w14:satMod").c_str(), "val", "175000");
454 :
455 : // Shadow
456 2 : std::string sPathShadow = sPathToRun + "/w14:shadow";
457 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "blurRad", "50800");
458 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dist", "38100");
459 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dir", "16200000");
460 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sx", "100000");
461 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sy", "100000");
462 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "kx", "0");
463 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "ky", "0");
464 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "algn", "b");
465 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr").c_str(), "val", "000000");
466 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr/w14:alpha").c_str(), "val", "60000");
467 :
468 : // Reflection
469 2 : std::string sPathReflection = sPathToRun + "/w14:reflection";
470 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "blurRad", "6350");
471 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stA", "50000");
472 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stPos", "0");
473 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endA", "300");
474 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endPos", "50000");
475 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dist", "29997");
476 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dir", "5400000");
477 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "fadeDir", "5400000");
478 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sx", "100000");
479 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sy", "-100000");
480 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "kx", "0");
481 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "ky", "0");
482 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "algn", "bl");
483 :
484 : // TextOutline
485 2 : std::string sPathTextOutline = sPathToRun + "/w14:textOutline";
486 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "w", "25400");
487 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cap", "rnd");
488 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cmpd", "sng");
489 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "algn", "ctr");
490 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr").c_str(), "val", "accent1");
491 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha").c_str(), "val", "40000");
492 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
493 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:prstDash").c_str(), "val", "solid");
494 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:bevel").c_str(), 1);
495 :
496 : // TextFill
497 2 : std::string sPathTextFill = sPathToRun + "/w14:textFill";
498 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]").c_str(), "pos", "0");
499 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr").c_str(), "val", "accent1");
500 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha").c_str(), "val", "10000");
501 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod").c_str(), "val", "40000");
502 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff").c_str(), "val", "60000");
503 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]").c_str(), "pos", "46000");
504 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr").c_str(), "val", "accent1");
505 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod").c_str(), "val", "95000");
506 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff").c_str(), "val", "5000");
507 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]").c_str(), "pos", "100000");
508 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr").c_str(), "val", "accent1");
509 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod").c_str(), "val", "60000");
510 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path").c_str(), "path", "circle");
511 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "b", "-30000");
512 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "r", "50000");
513 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "t", "130000");
514 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "l", "50000");
515 :
516 : // Props3D
517 2 : std::string sPathProps3D = sPathToRun + "/w14:props3d";
518 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "extrusionH", "57150");
519 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "contourW", "12700");
520 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "prstMaterial", "metal");
521 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "w", "38100");
522 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "h", "38100");
523 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "prst", "angle");
524 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "w", "69850");
525 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "h", "69850");
526 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "prst", "divot");
527 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr").c_str(), "val", "accent1");
528 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod").c_str(), "val", "20000");
529 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff").c_str(), "val", "80000");
530 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr").c_str(), "val", "accent1");
531 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
532 :
533 : // Ligatures
534 2 : std::string sPathLigatures = sPathToRun + "/w14:ligatures";
535 1 : assertXPath(pXmlDoc, (sPathLigatures).c_str(), "val", "standard");
536 :
537 : // NumForm
538 2 : std::string sPathNumForm = sPathToRun + "/w14:numForm";
539 1 : assertXPath(pXmlDoc, (sPathNumForm).c_str(), "val", "lining");
540 :
541 : // NumSpacing
542 2 : std::string sPathNumSpacing = sPathToRun + "/w14:numSpacing";
543 1 : assertXPath(pXmlDoc, (sPathNumSpacing).c_str(), "val", "proportional");
544 :
545 : // StylisticSets
546 2 : std::string sPathStylisticSets = sPathToRun + "/w14:stylisticSets";
547 2 : assertXPath(pXmlDoc, (sPathStylisticSets+"/w14:styleSet").c_str(), "id", "1");
548 : }
549 :
550 2 : std::string sPathToParagraphStyle = "/w:styles/w:style[9]";
551 :
552 1 : assertXPath(pXmlDoc, (sPathToParagraphStyle).c_str(), "type", "paragraph");
553 1 : assertXPath(pXmlDoc, (sPathToParagraphStyle).c_str(), "styleId", "TextEffectsStyle");
554 1 : assertXPath(pXmlDoc, (sPathToParagraphStyle).c_str(), "customStyle", "1");
555 :
556 : {
557 1 : std::string sPathToRun = sPathToParagraphStyle + "/w:rPr";
558 :
559 : // Glow
560 2 : std::string sPathGlow = sPathToRun + "/w14:glow";
561 1 : assertXPath(pXmlDoc, (sPathGlow).c_str(), "rad", "63500");
562 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr").c_str(), "val", "accent2");
563 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr/w14:alpha").c_str(), "val", "60000");
564 1 : assertXPath(pXmlDoc, (sPathGlow+"/w14:schemeClr/w14:satMod").c_str(), "val", "175000");
565 :
566 : // Shadow
567 2 : std::string sPathShadow = sPathToRun + "/w14:shadow";
568 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "blurRad", "50800");
569 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dist", "38100");
570 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "dir", "16200000");
571 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sx", "100000");
572 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "sy", "100000");
573 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "kx", "0");
574 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "ky", "0");
575 1 : assertXPath(pXmlDoc, (sPathShadow).c_str(), "algn", "b");
576 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr").c_str(), "val", "000000");
577 1 : assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr/w14:alpha").c_str(), "val", "60000");
578 :
579 : // Reflection
580 2 : std::string sPathReflection = sPathToRun + "/w14:reflection";
581 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "blurRad", "6350");
582 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stA", "50000");
583 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "stPos", "0");
584 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endA", "300");
585 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "endPos", "50000");
586 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dist", "29997");
587 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "dir", "5400000");
588 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "fadeDir", "5400000");
589 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sx", "100000");
590 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "sy", "-100000");
591 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "kx", "0");
592 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "ky", "0");
593 1 : assertXPath(pXmlDoc, (sPathReflection).c_str(), "algn", "bl");
594 :
595 : // TextOutline
596 2 : std::string sPathTextOutline = sPathToRun + "/w14:textOutline";
597 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "w", "25400");
598 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cap", "rnd");
599 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "cmpd", "sng");
600 1 : assertXPath(pXmlDoc, (sPathTextOutline).c_str(), "algn", "ctr");
601 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr").c_str(), "val", "accent1");
602 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha").c_str(), "val", "40000");
603 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
604 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:prstDash").c_str(), "val", "solid");
605 1 : assertXPath(pXmlDoc, (sPathTextOutline+"/w14:bevel").c_str(), 1);
606 :
607 : // TextFill
608 2 : std::string sPathTextFill = sPathToRun + "/w14:textFill";
609 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]").c_str(), "pos", "0");
610 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr").c_str(), "val", "accent1");
611 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha").c_str(), "val", "10000");
612 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod").c_str(), "val", "40000");
613 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff").c_str(), "val", "60000");
614 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]").c_str(), "pos", "46000");
615 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr").c_str(), "val", "accent1");
616 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod").c_str(), "val", "95000");
617 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff").c_str(), "val", "5000");
618 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]").c_str(), "pos", "100000");
619 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr").c_str(), "val", "accent1");
620 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod").c_str(), "val", "60000");
621 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path").c_str(), "path", "circle");
622 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "b", "-30000");
623 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "r", "50000");
624 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "t", "130000");
625 1 : assertXPath(pXmlDoc, (sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect").c_str(), "l", "50000");
626 :
627 : // Props3D
628 2 : std::string sPathProps3D = sPathToRun + "/w14:props3d";
629 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "extrusionH", "57150");
630 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "contourW", "12700");
631 1 : assertXPath(pXmlDoc, (sPathProps3D).c_str(), "prstMaterial", "metal");
632 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "w", "38100");
633 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "h", "38100");
634 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelT").c_str(), "prst", "angle");
635 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "w", "69850");
636 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "h", "69850");
637 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:bevelB").c_str(), "prst", "divot");
638 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr").c_str(), "val", "accent1");
639 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod").c_str(), "val", "20000");
640 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff").c_str(), "val", "80000");
641 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr").c_str(), "val", "accent1");
642 1 : assertXPath(pXmlDoc, (sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod").c_str(), "val", "75000");
643 :
644 : // Ligatures
645 2 : std::string sPathLigatures = sPathToRun + "/w14:ligatures";
646 1 : assertXPath(pXmlDoc, (sPathLigatures).c_str(), "val", "standard");
647 :
648 : // NumForm
649 2 : std::string sPathNumForm = sPathToRun + "/w14:numForm";
650 1 : assertXPath(pXmlDoc, (sPathNumForm).c_str(), "val", "lining");
651 :
652 : // NumSpacing
653 2 : std::string sPathNumSpacing = sPathToRun + "/w14:numSpacing";
654 1 : assertXPath(pXmlDoc, (sPathNumSpacing).c_str(), "val", "proportional");
655 :
656 : // StylisticSets
657 2 : std::string sPathStylisticSets = sPathToRun + "/w14:stylisticSets";
658 2 : assertXPath(pXmlDoc, (sPathStylisticSets+"/w14:styleSet").c_str(), "id", "1");
659 1 : }
660 : }
661 :
662 :
663 : #endif
664 :
665 4 : CPPUNIT_PLUGIN_IMPLEMENT();
666 :
667 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|