Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sd / qa / unit / export-tests-ooxml1.cxx
blob17a5ce94cbf621b1f34bfe756b11c2402c19eebd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #include <officecfg/Office/Common.hxx>
11 #include "sdmodeltestbase.hxx"
12 #include <Outliner.hxx>
13 #include <editeng/eeitem.hxx>
14 #include <editeng/editobj.hxx>
15 #include <editeng/fhgtitem.hxx>
16 #include <editeng/escapementitem.hxx>
17 #include <editeng/colritem.hxx>
18 #include <editeng/fontitem.hxx>
19 #include <editeng/wghtitem.hxx>
20 #include <editeng/numitem.hxx>
21 #include <editeng/postitem.hxx>
23 #include <oox/drawingml/drawingmltypes.hxx>
25 #include <svx/svdoashp.hxx>
26 #include <svx/svdogrp.hxx>
27 #include <svx/xflclit.hxx>
28 #include <svx/xlineit0.hxx>
29 #include <svx/sdooitm.hxx>
30 #include <svx/sdmetitm.hxx>
32 #include <com/sun/star/awt/FontDescriptor.hpp>
33 #include <com/sun/star/drawing/FillStyle.hpp>
34 #include <com/sun/star/drawing/LineDash.hpp>
35 #include <com/sun/star/text/WritingMode2.hpp>
36 #include <com/sun/star/table/BorderLine2.hpp>
37 #include <com/sun/star/table/XMergeableCell.hpp>
39 #include <docmodel/uno/UnoGradientTools.hxx>
40 #include <svx/svdotable.hxx>
41 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
42 #include <rtl/uri.hxx>
43 #include <vcl/filter/PngImageReader.hxx>
45 using namespace css;
47 class SdOOXMLExportTest1 : public SdModelTestBase
49 public:
50 SdOOXMLExportTest1()
51 : SdModelTestBase("/sd/qa/unit/data/")
56 namespace
58 template <typename ItemValue, typename ItemType>
59 void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId)
61 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
62 const EditTextObject& aEdit = pObj->GetOutlinerParaObject()->GetTextObject();
63 std::vector<EECharAttrib> rLst;
64 aEdit.GetCharAttribs(0, rLst);
65 for (std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it)
67 const ItemType* pAttrib = dynamic_cast<const ItemType*>((*it).pAttr);
68 if (pAttrib && pAttrib->Which() == nId)
70 CPPUNIT_ASSERT_EQUAL(nVal, static_cast<ItemValue>(pAttrib->GetValue()));
76 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf152335)
78 createSdImpressDoc("pptx/tdf152335.pptx");
79 save("Impress Office Open XML");
81 xmlDocUniquePtr pXmlDocTheme = parseExport("ppt/theme/theme1.xml");
82 assertXPathChildren(
83 pXmlDocTheme, "/a:theme/a:themeElements/a:fmtScheme/a:effectStyleLst/a:effectStyle[3]", 1);
86 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149803)
88 createSdImpressDoc("pptx/tdf149803.pptx");
89 save("Impress Office Open XML");
91 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
92 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp", "useBgFill", "1");
95 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149311)
97 createSdImpressDoc("odp/tdf149311.odp");
98 save("Impress Office Open XML");
100 xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels");
102 assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
103 "slide2.xml");
106 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149128)
108 createSdImpressDoc("odp/tdf149128.odp");
109 save("Impress Office Open XML");
111 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
112 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id",
113 "42");
114 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx",
115 "0");
116 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id",
117 "43");
118 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx",
119 "2");
122 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf66228)
124 createSdImpressDoc("odp/tdf66228.odp");
125 save("Impress Office Open XML");
127 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
128 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst",
129 "bentConnector3");
132 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf147919)
134 createSdImpressDoc("odp/tdf147919.odp");
135 save("Impress Office Open XML");
137 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
138 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst",
139 "bentConnector2");
141 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name",
142 "adj1");
143 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom", "prst",
144 "bentConnector3");
146 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "flipH", "1");
147 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "rot", "16200000");
148 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
149 "name", "adj1");
150 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
151 "name", "adj2");
152 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom", "prst",
153 "bentConnector4");
155 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipH", "1");
156 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipV", "1");
157 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "rot", "10800000");
158 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
159 "name", "adj1");
160 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
161 "name", "adj2");
162 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[3]",
163 "name", "adj3");
164 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom", "prst",
165 "bentConnector5");
167 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm", "flipH", "1");
168 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm", "rot", "16200000");
169 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:prstGeom", "prst",
170 "curvedConnector2");
172 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "flipH", "1");
173 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "rot", "16200000");
174 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom/a:avLst/a:gd", "name",
175 "adj1");
176 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom", "prst",
177 "curvedConnector3");
179 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipH", "1");
180 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipV", "1");
181 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "rot", "10800000");
182 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
183 "name", "adj1");
184 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
185 "name", "adj2");
186 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom", "prst",
187 "curvedConnector4");
189 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "flipV", "1");
190 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "rot", "16200000");
191 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
192 "name", "adj1");
193 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
194 "name", "adj2");
195 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[3]",
196 "name", "adj3");
197 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom", "prst",
198 "curvedConnector5");
201 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf130165)
203 createSdImpressDoc("pptx/tdf146223.pptx");
204 save("Impress Office Open XML");
206 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
207 assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0");
210 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124781)
212 createSdImpressDoc("odp/tdf124781.odp");
213 save("Impress Office Open XML");
215 xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml");
216 assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r[2]/a:rPr", "baseline",
217 "33000");
219 xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml");
220 assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r[2]/a:rPr", "baseline",
221 "-8000");
224 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf144914)
226 createSdImpressDoc("pptx/tdf144616.pptx");
227 save("Impress Office Open XML");
229 xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml");
230 assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
231 "ppaction://hlinkshowjump?jump=firstslide");
233 xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml");
234 assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
235 "ppaction://hlinkshowjump?jump=lastslide");
237 xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide1.xml");
238 assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
239 "ppaction://hlinkshowjump?jump=nextslide");
241 xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide1.xml");
242 assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
243 "ppaction://hlinkshowjump?jump=previousslide");
245 xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide1.xml");
246 assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
247 "ppaction://hlinksldjump");
248 xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide1.xml.rels");
249 assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
250 "slide2.xml");
252 xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide1.xml");
253 assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action",
254 "ppaction://hlinkshowjump?jump=endshow");
256 xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide1.xml");
257 assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr/a:hlinkClick", "id",
258 "rId2");
259 xmlDocUniquePtr pRelsDoc7 = parseExport("ppt/slides/_rels/slide1.xml.rels");
260 assertXPath(pRelsDoc7, "/rels:Relationships/rels:Relationship[@Id='rId2']", "Target",
261 "http://www.example.com/");
264 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124232)
266 createSdImpressDoc("pptx/tdf141704.pptx");
267 save("Impress Office Open XML");
269 xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml");
270 assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
271 "ppaction://hlinkshowjump?jump=lastslide");
273 xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide2.xml");
274 assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
275 "ppaction://hlinkshowjump?jump=nextslide");
277 xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide3.xml");
278 assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
279 "ppaction://hlinkshowjump?jump=previousslide");
281 xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide4.xml");
282 assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "id",
283 "rId1");
284 xmlDocUniquePtr pRelsDoc4 = parseExport("ppt/slides/_rels/slide4.xml.rels");
285 assertXPath(pRelsDoc4, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
286 "http://www.example.com/");
288 xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide5.xml");
289 assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
290 "ppaction://hlinksldjump");
291 xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide5.xml.rels");
292 assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
293 "slide6.xml");
295 xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide6.xml");
296 assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
297 "ppaction://hlinkshowjump?jump=endshow");
299 xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide7.xml");
300 assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
301 "ppaction://hlinkshowjump?jump=firstslide");
304 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143624)
306 createSdImpressDoc("pptx/tdf143624.pptx");
307 save("Impress Office Open XML");
309 xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml");
311 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "useTimings", "0");
313 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
316 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf142648)
318 createSdImpressDoc("pptx/tdf142648.pptx");
320 uno::Reference<drawing::XDrawPagesSupplier> xDPS(mxComponent, uno::UNO_QUERY_THROW);
321 uno::Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
322 uno::Reference<drawing::XDrawPage> xDrawPage;
323 xDrawPages->getByIndex(0) >>= xDrawPage;
324 uno::Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW);
325 xNamed->setName("#Slide 1");
327 save("Impress Office Open XML");
329 xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide2.xml.rels");
331 assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
332 "slide1.xml");
335 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf47365)
337 createSdImpressDoc("pptx/loopNoPause.pptx");
338 save("Impress Office Open XML");
340 xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml");
342 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "loop", "1");
344 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
347 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125071)
349 createSdImpressDoc("pptx/tdf125071.pptx");
350 save("Impress Office Open XML");
352 xmlDocUniquePtr pXmlDoc = parseExport("ppt/presentation.xml");
354 assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[1]", "name", "Custom1");
355 assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[2]", "name", "Custom2");
358 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf54037)
360 createSdImpressDoc("pptx/tdf54037.pptx");
361 save("Impress Office Open XML");
363 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
364 xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels");
366 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r/a:rPr/a:hlinkClick",
367 "action", "ppaction://hlinksldjump");
369 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r/a:rPr/a:hlinkClick",
370 "action", "ppaction://hlinkshowjump?jump=nextslide");
372 assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
373 "slide2.xml");
376 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127237)
378 createSdImpressDoc("pptx/tdf127237.pptx");
379 saveAndReload("impress8");
381 const SdrPage* pPage = GetPage(1);
382 CPPUNIT_ASSERT(pPage != nullptr);
384 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
385 CPPUNIT_ASSERT(pTableObj != nullptr);
386 uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
388 Color nFillColor;
389 uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 0),
390 uno::UNO_QUERY_THROW);
391 xCell->getPropertyValue("FillColor") >>= nFillColor;
392 CPPUNIT_ASSERT_EQUAL(Color(0x0070C0), nFillColor);
395 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc887230)
397 createSdImpressDoc("pptx/bnc887230.pptx");
398 saveAndReload("Impress Office Open XML");
400 const SdrPage* pPage = GetPage(1);
402 const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(0));
403 // Without the fix in place, this test would have failed with
404 //- Expected: 255
405 //- Actual : 13421823
406 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
409 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_1)
411 createSdImpressDoc("pptx/bnc870233_1.pptx");
412 saveAndReload("Impress Office Open XML");
414 const SdrPage* pPage = GetPage(1);
416 // The problem was all shapes had the same font (the last parsed font attributes overwrote all previous ones)
418 // First shape has red, bold font
420 const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(0));
421 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xff0000), EE_CHAR_COLOR);
422 checkFontAttributes<FontWeight, SvxWeightItem>(pObj, WEIGHT_BOLD, EE_CHAR_WEIGHT);
425 // Second shape has blue, italic font
427 const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(1));
428 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
429 checkFontAttributes<FontItalic, SvxPostureItem>(pObj, ITALIC_NORMAL, EE_CHAR_ITALIC);
433 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_2)
435 createSdImpressDoc("pptx/bnc870233_2.pptx");
436 saveAndReload("Impress Office Open XML");
438 const SdrPage* pPage = GetPage(1);
440 // The problem was in some SmartArts font color was wrong
442 // First smart art has blue font color (direct formatting)
444 const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
445 CPPUNIT_ASSERT(pObjGroup);
446 const SdrTextObj* pObj = DynCastSdrTextObj(pObjGroup->GetSubList()->GetObj(1));
447 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
450 // Second smart art has "dk2" font color (style)
452 const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(1));
453 CPPUNIT_ASSERT(pObjGroup);
454 const SdrTextObj* pObj = DynCastSdrTextObj(pObjGroup->GetSubList()->GetObj(1));
455 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x1f497d), EE_CHAR_COLOR);
458 // Third smart art has white font color (style)
460 const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(2));
461 CPPUNIT_ASSERT(pObjGroup);
462 const SdrTextObj* pObj = DynCastSdrTextObj(pObjGroup->GetSubList()->GetObj(1));
463 checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xffffff), EE_CHAR_COLOR);
467 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390_4)
469 bool bPassed = false;
470 createSdImpressDoc("n828390_4.odp");
472 saveAndReload("Impress Office Open XML");
474 const SdrPage* pPage = GetPage(1);
476 std::vector<EECharAttrib> rLst;
477 SdrObject* pObj = pPage->GetObj(0);
478 SdrTextObj* pTxtObj = DynCastSdrTextObj(pObj);
479 CPPUNIT_ASSERT(pTxtObj);
480 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
481 aEdit.GetCharAttribs(0, rLst);
482 for (std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend();
483 ++it)
485 const SvxFontHeightItem* pFontHeight
486 = dynamic_cast<const SvxFontHeightItem*>((*it).pAttr);
487 if (pFontHeight && (*it).nStart == 18)
488 CPPUNIT_ASSERT_EQUAL_MESSAGE("Font height is wrong", static_cast<sal_uInt32>(1129),
489 pFontHeight->GetHeight());
490 const SvxFontItem* pFont = dynamic_cast<const SvxFontItem*>((*it).pAttr);
491 if (pFont)
493 CPPUNIT_ASSERT_EQUAL_MESSAGE("Font is wrong", OUString("Arial"),
494 pFont->GetFamilyName());
495 bPassed = true;
497 const SvxWeightItem* pWeight = dynamic_cast<const SvxWeightItem*>((*it).pAttr);
498 if (pWeight && (*it).nStart == 18)
499 CPPUNIT_ASSERT_EQUAL_MESSAGE("Font Weight is wrong", WEIGHT_BOLD,
500 pWeight->GetWeight());
503 CPPUNIT_ASSERT(bPassed);
506 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390_5)
508 createSdImpressDoc("n828390_5.odp");
510 saveAndReload("Impress Office Open XML");
512 const SdrPage* pPage = GetPage(1);
514 SdrObject* pObj = pPage->GetObj(0);
515 SdrTextObj* pTxtObj = DynCastSdrTextObj(pObj);
516 CPPUNIT_ASSERT(pTxtObj);
517 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
518 const SvxNumBulletItem& rNumFmt = aEdit.GetParaAttribs(3).Get(EE_PARA_NUMBULLET);
519 CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's relative size is wrong!", sal_uInt16(75),
520 rNumFmt.GetNumRule().GetLevel(1).GetBulletRelSize()); // != 25
524 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testLostPlaceholders)
526 createSdImpressDoc("pptx/LostPlaceholder.odp");
528 SdXImpressDocument* pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
529 CPPUNIT_ASSERT(pXImpressDocument);
530 SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
531 CPPUNIT_ASSERT(pDoc);
532 auto pPage = pDoc->GetPage(1);
533 CPPUNIT_ASSERT(pPage);
534 auto pObj = pPage->GetObj(1);
535 CPPUNIT_ASSERT(pObj);
536 uno::Reference<drawing::XShape> xShp(pObj->getUnoShape(), uno::UNO_QUERY);
537 CPPUNIT_ASSERT(xShp);
539 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!",
540 OUString(u"com.sun.star.presentation.OutlinerShape"),
541 xShp->getShapeType());
542 uno::Reference<beans::XPropertySet> xShpProps(xShp, uno::UNO_QUERY);
543 // Without the fix in place there will be the following error:
544 // Expected: com.sun.star.presentation.OutlinerShape
545 // Actual: com.sun.star.drawing.CustomShape
547 CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true,
548 xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
549 // Without the fix in place this will the following:
550 // Expected: true
551 // Actual: false
554 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testPlaceholderFillAndOutlineExport)
556 createSdImpressDoc("pptx/LostPlaceholderFill.odp");
558 uno::Any aFillStyle;
559 uno::Any aFillColor;
560 uno::Any aLineStyle;
561 uno::Any aLineColor;
563 for (int i = 1; i <= 2; i++)
565 SdXImpressDocument* pXImpressDocument
566 = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
567 CPPUNIT_ASSERT(pXImpressDocument);
568 SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
569 CPPUNIT_ASSERT(pDoc);
570 auto pPage = pDoc->GetPage(1);
571 CPPUNIT_ASSERT(pPage);
572 auto pObj = pPage->GetObj(1);
573 CPPUNIT_ASSERT(pObj);
575 uno::Reference<drawing::XShape> xShp(pObj->getUnoShape(), uno::UNO_QUERY);
576 CPPUNIT_ASSERT(xShp);
578 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!",
579 OUString(u"com.sun.star.presentation.OutlinerShape"),
580 xShp->getShapeType());
581 uno::Reference<beans::XPropertySet> xShpProps(xShp, uno::UNO_QUERY);
582 CPPUNIT_ASSERT_EQUAL_MESSAGE(
583 "It must be a placeholder!", true,
584 xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
586 if (i == 1)
588 aFillStyle = xShpProps->getPropertyValue("FillStyle");
589 aFillColor = xShpProps->getPropertyValue("FillColor");
591 aLineStyle = xShpProps->getPropertyValue("LineStyle");
592 aLineColor = xShpProps->getPropertyValue("LineColor");
594 saveAndReload("Impress Office Open XML");
595 continue;
597 else
599 CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillstyle has not been exported!",
600 aFillStyle, xShpProps->getPropertyValue("FillStyle"));
601 CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillcolor has not been exported!",
602 aFillColor, xShpProps->getPropertyValue("FillColor"));
604 CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linestyle has not been exported!",
605 aLineStyle, xShpProps->getPropertyValue("LineStyle"));
606 CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linecolor has not been exported!",
607 aLineColor, xShpProps->getPropertyValue("LineColor"));
608 break;
613 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo71961)
615 createSdImpressDoc("fdo71961.odp");
617 saveAndReload("Impress Office Open XML");
618 const SdrPage* pPage = GetPage(1);
620 // Export to .pptx changes all text frames to custom shape objects, which obey TextWordWrap property
621 // (which is false for text frames otherwise and is ignored). Check that frames that should wrap still do.
622 auto pTxtObj = pPage->GetObj(1);
623 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
624 CPPUNIT_ASSERT_EQUAL(OUString("Text to be always wrapped"),
625 pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
626 CPPUNIT_ASSERT_EQUAL(true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
628 pTxtObj = dynamic_cast<SdrObjCustomShape*>(pPage->GetObj(2));
629 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
630 CPPUNIT_ASSERT_EQUAL(OUString("Custom shape non-wrapped text"),
631 pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
632 CPPUNIT_ASSERT_EQUAL(false, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
634 pTxtObj = dynamic_cast<SdrObjCustomShape*>(pPage->GetObj(3));
635 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
636 CPPUNIT_ASSERT_EQUAL(OUString("Custom shape wrapped text"),
637 pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
638 CPPUNIT_ASSERT_EQUAL(true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
641 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390)
643 bool bPassed = false;
644 createSdImpressDoc("pptx/n828390.pptx");
646 saveAndReload("Impress Office Open XML");
648 const SdrPage* pPage = GetPage(1);
650 std::vector<EECharAttrib> rLst;
651 // Get the object
652 SdrObject* pObj = pPage->GetObj(0);
653 SdrTextObj* pTxtObj = DynCastSdrTextObj(pObj);
654 CPPUNIT_ASSERT(pTxtObj);
655 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
656 aEdit.GetCharAttribs(0, rLst);
657 bPassed = std::any_of(rLst.rbegin(), rLst.rend(), [](const EECharAttrib& rCharAttr) {
658 const SvxEscapementItem* pFontEscapement
659 = dynamic_cast<const SvxEscapementItem*>(rCharAttr.pAttr);
660 return pFontEscapement && (pFontEscapement->GetEsc() == -25);
663 CPPUNIT_ASSERT_MESSAGE("Subscript not exported properly", bPassed);
666 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc880763)
668 createSdImpressDoc("pptx/bnc880763.pptx");
669 saveAndReload("Impress Office Open XML");
671 const SdrPage* pPage = GetPage(1);
673 // Check z-order of the two shapes, use background color to identify them
674 // First object in the background has blue background color
675 const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
676 CPPUNIT_ASSERT(pObjGroup);
677 const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1);
678 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
679 CPPUNIT_ASSERT_EQUAL(
680 Color(0x0000ff),
681 (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
683 // Second object at the front has green background color
684 pObj = pPage->GetObj(1);
685 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
686 CPPUNIT_ASSERT_EQUAL(
687 Color(0x00ff00),
688 (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
691 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc862510_5)
693 createSdImpressDoc("pptx/bnc862510_5.pptx");
694 saveAndReload("Impress Office Open XML");
696 const SdrPage* pPage = GetPage(1);
698 // Same as testBnc870237, but here we check the horizontal spacing
699 const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
700 CPPUNIT_ASSERT(pObjGroup);
701 const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(2);
702 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
703 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST).GetValue());
704 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST).GetValue());
705 CPPUNIT_ASSERT_EQUAL(sal_Int32(7510), pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST).GetValue());
706 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST).GetValue());
709 // In numbering a bullet could be defined as empty (no character).
710 // When exporting to OOXML make sure that the bullet is ignored and
711 // not written into the file.
712 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc822347_EmptyBullet)
714 createSdImpressDoc("bnc822347_EmptyBullet.odp");
715 saveAndReload("Impress Office Open XML");
717 SdXImpressDocument* pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
718 CPPUNIT_ASSERT(pXImpressDocument);
719 SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
720 SdrOutliner* pOutliner = pDoc->GetInternalOutliner();
721 const SdrPage* pPage = pDoc->GetPage(1);
722 SdrObject* pObject = pPage->GetObj(0);
723 SdrTextObj* pTextObject = DynCastSdrTextObj(pObject);
724 CPPUNIT_ASSERT(pTextObject);
726 OutlinerParaObject* pOutlinerParagraphObject = pTextObject->GetOutlinerParaObject();
727 const EditTextObject& aEdit = pOutlinerParagraphObject->GetTextObject();
729 OUString sText = aEdit.GetText(0);
730 CPPUNIT_ASSERT_EQUAL(OUString("M3 Feature Test"), sText);
732 pOutliner->SetText(*pOutlinerParagraphObject);
733 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pOutliner->GetParagraphCount());
735 const sal_Int16 nDepth = pOutliner->GetDepth(0);
737 CPPUNIT_ASSERT_EQUAL(sal_Int16(-1),
738 nDepth); // depth >= 0 means that the paragraph has bullets enabled
741 //Bullets not having any text following them are not getting exported to pptx correctly.
742 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo90607)
744 createSdImpressDoc("fdo90607.pptx");
745 saveAndReload("Impress Office Open XML");
747 const SdrPage* pPage = GetPage(1);
748 SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(1));
749 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
750 OutlinerParaObject* pOutlinerParagraphObject = pTxtObj->GetOutlinerParaObject();
751 const sal_Int16 nDepth = pOutlinerParagraphObject->GetDepth(0);
752 CPPUNIT_ASSERT_MESSAGE("not equal", nDepth != -1);
755 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo83751)
757 createSdImpressDoc("pptx/fdo83751.pptx");
758 saveAndReload("Impress Office Open XML");
760 uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(
761 mxComponent, uno::UNO_QUERY);
762 uno::Reference<document::XDocumentProperties> xProps
763 = xDocumentPropertiesSupplier->getDocumentProperties();
764 uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(),
765 uno::UNO_QUERY);
766 OUString propValue;
767 xUDProps->getPropertyValue("Testing") >>= propValue;
768 CPPUNIT_ASSERT_EQUAL(OUString("Document"), propValue);
771 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo79731)
773 createSdImpressDoc("fdo79731.odp");
774 saveAndReload("Impress Office Open XML");
775 SdXImpressDocument* pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
776 CPPUNIT_ASSERT(pXImpressDocument);
777 SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
778 CPPUNIT_ASSERT(pDoc);
781 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellFillProperties)
783 // Load the original file
784 createSdImpressDoc("odp/Table_with_Cell_Fill.odp");
786 // Export the document and import again for a check
787 saveAndReload("Impress Office Open XML");
789 const SdrPage* pPage = GetPage(1);
791 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
792 CPPUNIT_ASSERT(pTableObj);
793 uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
794 uno::Reference<beans::XPropertySet> xCell;
796 // Test Solid fill color
797 Color nColor;
798 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
799 xCell->getPropertyValue("FillColor") >>= nColor;
800 CPPUNIT_ASSERT_EQUAL(Color(0x66ffff), nColor);
802 // Test Picture fill type for cell
803 drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
804 xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
805 xCell->getPropertyValue("FillStyle") >>= aFillStyle;
806 CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_BITMAP), static_cast<int>(aFillStyle));
808 // Test Gradient fill type for cell
809 xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
810 xCell->getPropertyValue("FillStyle") >>= aFillStyle;
811 CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(aFillStyle));
814 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletStartNumber)
816 createSdImpressDoc("pptx/n90255.pptx");
817 saveAndReload("Impress Office Open XML");
819 const SdrPage* pPage = GetPage(1);
820 SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(0));
821 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
822 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
823 const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
824 CPPUNIT_ASSERT(pNumFmt);
825 CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's start number is wrong!", sal_Int16(3),
826 sal_Int16(pNumFmt->GetNumRule().GetLevel(0).GetStart()));
829 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testLineStyle)
831 createSdImpressDoc("pptx/lineStyle.pptx");
832 saveAndReload("Impress Office Open XML");
834 const SdrPage* pPage = GetPage(1);
835 SdrObject const* pShape = pPage->GetObj(0);
836 CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr);
838 const XLineStyleItem& rStyleItem = pShape->GetMergedItem(XATTR_LINESTYLE);
839 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", int(drawing::LineStyle_SOLID),
840 static_cast<int>(rStyleItem.GetValue()));
843 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134862)
845 createSdImpressDoc("pptx/tdf134862.pptx");
846 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
848 uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xShape));
849 uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
851 sal_Int16 nWritingMode = 0;
852 xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
854 // Without the fix in place, this test would have failed here
855 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB,
856 nWritingMode);
858 saveAndReload("Impress Office Open XML");
860 xShape.set(getShapeFromPage(0, 0));
862 xParagraph.set(getParagraphFromShape(0, xShape));
863 xPropSet.set(xParagraph, uno::UNO_QUERY_THROW);
865 nWritingMode = 0;
866 xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
867 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB,
868 nWritingMode);
871 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRightToLeftParaghraph)
873 createSdImpressDoc("pptx/rightToLeftParagraph.pptx");
875 saveAndReload("Impress Office Open XML");
876 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
878 // Get first paragraph
879 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
880 uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
882 sal_Int16 nWritingMode = 0;
883 xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
884 CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB,
885 nWritingMode);
888 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTextboxWithHyperlink)
890 createSdImpressDoc("pptx/hyperlinktest.pptx");
892 saveAndReload("Impress Office Open XML");
893 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
895 // Get first paragraph
896 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
898 // first chunk of text
899 uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
900 uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
902 uno::Reference<text::XTextField> xField;
903 xPropSet->getPropertyValue("TextField") >>= xField;
904 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
906 xPropSet.set(xField, uno::UNO_QUERY);
907 OUString aURL;
908 xPropSet->getPropertyValue("URL") >>= aURL;
909 CPPUNIT_ASSERT_EQUAL_MESSAGE("URLs don't match", OUString("http://www.xkcd.com/"), aURL);
912 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf136911)
914 createSdImpressDoc("ppt/tdf136911.ppt");
916 saveAndReload("Impress Office Open XML");
917 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
919 // Get second paragraph
920 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
922 // first chunk of text
923 uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
924 uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
926 uno::Reference<text::XTextField> xField;
927 xPropSet->getPropertyValue("TextField") >>= xField;
928 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
930 xPropSet.set(xField, uno::UNO_QUERY);
931 OUString aURL;
932 xPropSet->getPropertyValue("URL") >>= aURL;
933 CPPUNIT_ASSERT_EQUAL_MESSAGE("URLs don't match", OUString("http://google.com"), aURL);
936 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletColor)
938 createSdImpressDoc("pptx/bulletColor.pptx");
940 saveAndReload("Impress Office Open XML");
942 const SdrPage* pPage = GetPage(1);
944 SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(0));
945 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
947 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
948 const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
949 CPPUNIT_ASSERT(pNumFmt);
950 CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's color is wrong!", Color(0xff0000),
951 pNumFmt->GetNumRule().GetLevel(0).GetBulletColor());
954 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletCharAndFont)
956 createSdImpressDoc("odp/bulletCharAndFont.odp");
957 saveAndReload("Impress Office Open XML");
959 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
960 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
961 uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
963 uno::Reference<container::XIndexAccess> xLevels(xPropSet->getPropertyValue("NumberingRules"),
964 uno::UNO_QUERY);
965 uno::Sequence<beans::PropertyValue> aProps;
966 xLevels->getByIndex(0) >>= aProps; // 1st level
967 OUString sBulletChar(u'\xf06c');
968 for (beans::PropertyValue const& rProp : std::as_const(aProps))
970 if (rProp.Name == "BulletChar")
971 CPPUNIT_ASSERT_EQUAL_MESSAGE("BulletChar incorrect.", sBulletChar,
972 rProp.Value.get<OUString>());
973 if (rProp.Name == "BulletFont")
975 awt::FontDescriptor aFontDescriptor;
976 rProp.Value >>= aFontDescriptor;
977 CPPUNIT_ASSERT_EQUAL_MESSAGE("BulletFont incorrect.", OUString("Wingdings"),
978 aFontDescriptor.Name);
983 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletMarginAndIndentation)
985 createSdImpressDoc("pptx/bulletMarginAndIndent.pptx");
986 saveAndReload("Impress Office Open XML");
988 const SdrPage* pPage = GetPage(1);
990 SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(0));
991 CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
993 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
994 const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
995 CPPUNIT_ASSERT(pNumFmt);
997 CPPUNIT_ASSERT_EQUAL_MESSAGE(
998 "Bullet's left margin is wrong!", sal_Int32(1000),
999 pNumFmt->GetNumRule().GetLevel(0).GetAbsLSpace()); // left margin is 0.79 cm
1000 CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's indentation is wrong!", sal_Int32(-1000),
1001 pNumFmt->GetNumRule().GetLevel(0).GetFirstLineOffset());
1004 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testParaMarginAndindentation)
1006 createSdImpressDoc("pptx/paraMarginAndIndentation.pptx");
1008 saveAndReload("Impress Office Open XML");
1009 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
1011 // Get first paragraph
1012 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
1013 uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
1015 sal_Int32 nParaLeftMargin = 0;
1016 xPropSet->getPropertyValue("ParaLeftMargin") >>= nParaLeftMargin;
1017 CPPUNIT_ASSERT_EQUAL(sal_uInt32(1000), sal_uInt32(nParaLeftMargin));
1019 sal_Int32 nParaFirstLineIndent = 0;
1020 xPropSet->getPropertyValue("ParaFirstLineIndent") >>= nParaFirstLineIndent;
1021 CPPUNIT_ASSERT_EQUAL(sal_Int32(-1270), nParaFirstLineIndent);
1024 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCellLeftAndRightMargin)
1026 createSdImpressDoc("pptx/n90223.pptx");
1027 saveAndReload("Impress Office Open XML");
1028 sal_Int32 nLeftMargin, nRightMargin;
1030 const SdrPage* pPage = GetPage(1);
1032 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
1033 CPPUNIT_ASSERT(pTableObj);
1035 uno::Reference<css::table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
1036 uno::Reference<css::table::XMergeableCell> xCell(xTable->getCellByPosition(0, 0),
1037 uno::UNO_QUERY_THROW);
1038 uno::Reference<beans::XPropertySet> xCellPropSet(xCell, uno::UNO_QUERY_THROW);
1040 uno::Any aLeftMargin = xCellPropSet->getPropertyValue("TextLeftDistance");
1041 CPPUNIT_ASSERT(aLeftMargin >>= nLeftMargin);
1043 uno::Any aRightMargin = xCellPropSet->getPropertyValue("TextRightDistance");
1044 CPPUNIT_ASSERT(aRightMargin >>= nRightMargin);
1046 // Convert values to EMU
1047 nLeftMargin = oox::drawingml::convertHmmToEmu(nLeftMargin);
1048 nRightMargin = oox::drawingml::convertHmmToEmu(nRightMargin);
1050 CPPUNIT_ASSERT_EQUAL(sal_Int32(45720), nLeftMargin);
1051 CPPUNIT_ASSERT_EQUAL(sal_Int32(45720), nRightMargin);
1054 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testMergedCells)
1056 createSdImpressDoc("odp/cellspan.odp");
1057 saveAndReload("Impress Office Open XML");
1058 const SdrPage* pPage = GetPage(1);
1060 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
1062 CPPUNIT_ASSERT(pTableObj);
1063 uno::Reference<table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
1064 uno::Reference<text::XTextRange> xText1(xTable->getCellByPosition(3, 0), uno::UNO_QUERY_THROW);
1065 CPPUNIT_ASSERT_EQUAL(OUString("0,3"), xText1->getString());
1067 uno::Reference<text::XTextRange> xText2(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
1068 CPPUNIT_ASSERT_EQUAL(OUString("2,3"), xText2->getString());
1071 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellBorder)
1073 createSdImpressDoc("pptx/n90190.pptx");
1074 saveAndReload("Impress Office Open XML");
1076 const SdrPage* pPage = GetPage(1);
1078 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
1079 CPPUNIT_ASSERT(pTableObj);
1081 table::BorderLine2 aBorderLine;
1083 uno::Reference<table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
1084 uno::Reference<css::table::XMergeableCell> xCell(xTable->getCellByPosition(0, 0),
1085 uno::UNO_QUERY_THROW);
1086 uno::Reference<beans::XPropertySet> xCellPropSet(xCell, uno::UNO_QUERY_THROW);
1088 xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine;
1089 // While importing the table cell border line width, it converts EMU->Hmm then divided result by 2.
1090 // To get original value of LineWidth need to multiple by 2.
1091 sal_Int32 nLeftBorder = aBorderLine.LineWidth * 2;
1092 nLeftBorder = oox::drawingml::convertHmmToEmu(nLeftBorder);
1093 CPPUNIT_ASSERT(nLeftBorder);
1094 CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
1096 xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine;
1097 sal_Int32 nRightBorder = aBorderLine.LineWidth * 2;
1098 nRightBorder = oox::drawingml::convertHmmToEmu(nRightBorder);
1099 CPPUNIT_ASSERT(nRightBorder);
1100 CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, aBorderLine.Color));
1102 xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine;
1103 sal_Int32 nTopBorder = aBorderLine.LineWidth * 2;
1104 nTopBorder = oox::drawingml::convertHmmToEmu(nTopBorder);
1105 CPPUNIT_ASSERT(nTopBorder);
1106 CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
1108 xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
1109 sal_Int32 nBottomBorder = aBorderLine.LineWidth * 2;
1110 nBottomBorder = oox::drawingml::convertHmmToEmu(nBottomBorder);
1111 CPPUNIT_ASSERT(nBottomBorder);
1112 CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
1115 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf111884)
1117 createSdImpressDoc("pptx/tdf111884.pptx");
1118 saveAndReload("Impress Office Open XML");
1120 const SdrPage* pPage = GetPage(1);
1121 SdrObject const* pShape = pPage->GetObj(2);
1122 CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr);
1124 // must be a group shape
1125 CPPUNIT_ASSERT_EQUAL(SdrObjKind::Group, pShape->GetObjIdentifier());
1128 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf112633)
1130 // Load document and export it to a temporary file
1131 createSdImpressDoc("pptx/tdf112633.pptx");
1132 save("Impress Office Open XML");
1134 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1135 xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels");
1137 // Check image with artistic effect exists in the slide
1138 assertXPath(pXmlDoc,
1139 "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/"
1140 "a14:imgLayer/a14:imgEffect/a14:artisticPencilGrayscale",
1141 "pencilSize", "80");
1143 // Check there is a relation with the .wdp file that contains the backed up image
1144 OUString sEmbedId1 = getXPath(pXmlDoc,
1145 "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/"
1146 "a:ext/a14:imgProps/a14:imgLayer",
1147 "embed");
1148 OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']";
1149 assertXPath(pRelsDoc, OUStringToOString(sXmlPath, RTL_TEXTENCODING_UTF8), "Target",
1150 "../media/hdphoto1.wdp");
1152 // Check the .wdp file exists
1153 uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
1154 = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
1155 maTempFile.GetURL());
1156 CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("ppt/media/hdphoto1.wdp")));
1159 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128952)
1161 createSdImpressDoc("pptx/tdf128952.pptx");
1162 save("Impress Office Open XML");
1164 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1166 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "x", "360");
1167 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "y", "-360");
1168 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cx", "1919880");
1169 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cy", "1462680");
1172 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127090)
1174 createSdImpressDoc("pptx/tdf127090.odp");
1175 save("Impress Office Open XML");
1177 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1179 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr", "rot", "-5400000");
1182 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomXml)
1184 // Load document and export it to a temporary file
1185 createSdImpressDoc("pptx/customxml.pptx");
1186 save("Impress Office Open XML");
1188 xmlDocUniquePtr pXmlDoc = parseExport("customXml/item1.xml");
1189 CPPUNIT_ASSERT(pXmlDoc);
1190 xmlDocUniquePtr pRelsDoc = parseExport("customXml/_rels/item1.xml.rels");
1191 CPPUNIT_ASSERT(pRelsDoc);
1193 // Check there is a relation to itemProps1.xml.
1194 assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship", 1);
1195 assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
1196 "itemProps1.xml");
1198 std::unique_ptr<SvStream> pStream = parseExportStream(maTempFile.GetURL(), "ddp/ddpfile.xen");
1199 CPPUNIT_ASSERT(pStream);
1202 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf94238)
1204 // Load document and export it to a temporary file.
1205 createSdImpressDoc("pptx/tdf94238.pptx");
1206 save("Impress Office Open XML");
1207 uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
1208 CPPUNIT_ASSERT(xDoc.is());
1210 uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
1211 CPPUNIT_ASSERT(xPage.is());
1213 uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
1214 CPPUNIT_ASSERT(xShape.is());
1216 awt::Gradient2 aGradient;
1217 CPPUNIT_ASSERT(xShape->getPropertyValue("FillGradient") >>= aGradient);
1219 // Without the accompanying fix in place, this test would have failed with
1220 // the following details:
1221 // - aGradient.Style was awt::GradientStyle_ELLIPTICAL
1222 // - aGradient.YOffset was 70
1223 // - aGradient.Border was 0
1224 CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_RADIAL, aGradient.Style);
1225 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(100), aGradient.YOffset);
1226 // MCGR: 39->0 no border needed anymore with ooxml import
1227 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), aGradient.Border);
1229 // MCGR: Use the completely imported gradient to check for correctness
1230 const basegfx::BColorStops aColorStops
1231 = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
1233 // Without the accompanying fix in place, this test would have failed with
1234 // 'Expected: 0, Actual : 10592673', i.e. the start color of the gradient
1235 // was incorrect.
1236 CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
1237 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
1238 CPPUNIT_ASSERT_EQUAL(aColorStops[0].getStopColor(), basegfx::BColor(0.0, 0.0, 0.0));
1239 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 0.39000000000000001));
1240 CPPUNIT_ASSERT_EQUAL(aColorStops[1].getStopColor(), basegfx::BColor(0.0, 0.0, 0.0));
1241 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 1.0));
1242 CPPUNIT_ASSERT_EQUAL(
1243 aColorStops[2].getStopColor(),
1244 basegfx::BColor(0.54509803921568623, 0.54509803921568623, 0.54509803921568623));
1247 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testPictureTransparency)
1249 // Load document and export it to a temporary file.
1250 createSdImpressDoc("odp/image_transparency.odp");
1251 save("Impress Office Open XML");
1252 uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
1253 CPPUNIT_ASSERT(xDoc.is());
1255 uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
1256 CPPUNIT_ASSERT(xPage.is());
1258 uno::Reference<beans::XPropertySet> xGraphicShape(getShape(0, xPage));
1259 CPPUNIT_ASSERT(xGraphicShape.is());
1261 sal_Int16 nTransparency = 0;
1262 CPPUNIT_ASSERT(xGraphicShape->getPropertyValue("Transparency") >>= nTransparency);
1263 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(51), nTransparency);
1266 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125554)
1268 createSdImpressDoc("pptx/tdf125554.pptx");
1269 saveAndReload("Impress Office Open XML");
1271 uno::Reference<beans::XPropertySet> xShape = getShapeFromPage(0, 0);
1272 uno::Any aFillTransparenceGradientName
1273 = xShape->getPropertyValue("FillTransparenceGradientName");
1274 CPPUNIT_ASSERT(aFillTransparenceGradientName.has<OUString>());
1275 // Without the accompanying fix in place, this test would have failed, i.e. the transparency of
1276 // the shape has no gradient, so it looked like a solid fill instead of a gradient fill.
1277 CPPUNIT_ASSERT(!aFillTransparenceGradientName.get<OUString>().isEmpty());
1280 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRoundtripOwnLineStyles)
1282 // Load odp document and read the LineDash values.
1283 createSdImpressDoc("odp/LineStylesOwn.odp");
1284 uno::Reference<drawing::XDrawPagesSupplier> xDocodp(mxComponent, uno::UNO_QUERY);
1285 CPPUNIT_ASSERT(xDocodp.is());
1286 uno::Reference<drawing::XDrawPage> xPageodp(xDocodp->getDrawPages()->getByIndex(0),
1287 uno::UNO_QUERY);
1288 CPPUNIT_ASSERT(xPageodp.is());
1289 drawing::LineDash aLineDashodp[10];
1290 for (sal_uInt16 i = 0; i < 10; i++)
1292 uno::Reference<beans::XPropertySet> xShapeodp(getShape(i, xPageodp));
1293 CPPUNIT_ASSERT(xShapeodp.is());
1294 xShapeodp->getPropertyValue("LineDash") >>= aLineDashodp[i];
1297 // Save to pptx, reload and compare the LineDash values
1298 save("Impress Office Open XML");
1299 uno::Reference<drawing::XDrawPagesSupplier> xDocpptx(mxComponent, uno::UNO_QUERY);
1300 CPPUNIT_ASSERT(xDocpptx.is());
1301 uno::Reference<drawing::XDrawPage> xPagepptx(xDocpptx->getDrawPages()->getByIndex(0),
1302 uno::UNO_QUERY);
1303 CPPUNIT_ASSERT(xPagepptx.is());
1305 for (sal_uInt16 i = 0; i < 10; i++)
1307 drawing::LineDash aLineDashpptx;
1308 uno::Reference<beans::XPropertySet> xShapepptx(getShape(i, xPagepptx));
1309 CPPUNIT_ASSERT(xShapepptx.is());
1310 xShapepptx->getPropertyValue("LineDash") >>= aLineDashpptx;
1311 bool bIsSameLineDash = (aLineDashodp[i].Style == aLineDashpptx.Style
1312 && aLineDashodp[i].Dots == aLineDashpptx.Dots
1313 && aLineDashodp[i].DotLen == aLineDashpptx.DotLen
1314 && aLineDashodp[i].Dashes == aLineDashpptx.Dashes
1315 && aLineDashodp[i].DashLen == aLineDashpptx.DashLen
1316 && aLineDashodp[i].Distance == aLineDashpptx.Distance);
1317 CPPUNIT_ASSERT_MESSAGE("LineDash differ", bIsSameLineDash);
1321 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRoundtripPrstDash)
1323 // load and save document, compare prstDash values in saved document with original.
1324 createSdImpressDoc("pptx/presetDashDot.pptx");
1325 save("Impress Office Open XML");
1327 const OUString sOriginal[]
1328 = { "dash", "dashDot", "dot", "lgDash", "lgDashDot",
1329 "lgDashDotDot", "sysDash", "sysDashDot", "sysDashDotDot", "sysDot" };
1330 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1331 const OString sStart = "/p:sld/p:cSld/p:spTree/p:sp[";
1332 const OString sEnd = "]/p:spPr/a:ln/a:prstDash";
1333 for (sal_uInt16 i = 0; i < 10; i++)
1335 OString sXmlPath = sStart + OString::number(i + 1) + sEnd;
1336 OUString sResaved = getXPath(pXmlDoc, sXmlPath, "val");
1337 CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong prstDash", sOriginal[i], sResaved);
1340 // tdf#126746: Make sure that dash-dot pattern starts with the longer dash, as defined in OOXML
1341 // Make sure Style is drawing::DashStyle_RECTRELATIVE
1342 uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
1343 CPPUNIT_ASSERT(xDoc.is());
1344 uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
1345 CPPUNIT_ASSERT(xPage.is());
1346 for (sal_uInt16 i = 0; i < 10; i++)
1348 drawing::LineDash aLineDash;
1349 uno::Reference<beans::XPropertySet> xShape(getShape(i, xPage));
1350 CPPUNIT_ASSERT(xShape.is());
1351 xShape->getPropertyValue("LineDash") >>= aLineDash;
1352 CPPUNIT_ASSERT_MESSAGE("First dash is short", aLineDash.DotLen >= aLineDash.DashLen);
1353 bool bIsRectRelative = aLineDash.Style == drawing::DashStyle_RECTRELATIVE;
1354 CPPUNIT_ASSERT_MESSAGE("not RECTRELATIVE", bIsRectRelative);
1358 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testDashOnHairline)
1360 // load and save document, make sure the custDash has 11 child elements.
1361 createSdImpressDoc("odp/tdf127267DashOnHairline.odp");
1362 save("Impress Office Open XML");
1364 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1365 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds", 11);
1368 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationNonMediaShape)
1370 createSdImpressDoc("pptx/narration-non-media-shape.pptx");
1371 // Without the accompanying fix in place, this test would have failed,
1372 // beans::UnknownPropertyException was thrown.
1373 saveAndReload("Impress Office Open XML");
1376 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomshapeBitmapfillSrcrect)
1378 createSdImpressDoc("pptx/customshape-bitmapfill-srcrect.pptx");
1379 save("Impress Office Open XML");
1381 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1383 // tdf#132680
1384 // We are preventing the side effect of DOCX improvement to PPTX case.
1385 // Without the accompanying fix in place, this test would have failed with:
1386 // - Expected: 1
1387 // - Actual : 0
1388 // - XPath '/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect' number of nodes is incorrect
1389 // i.e. <a:srcRect> was exported as <a:fillRect> in <a:stretch>, which made part of the image
1390 // invisible.
1392 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect");
1394 // tdf#134210
1395 // Original values of attribute of l and r in xml files: <a:srcRect l="4393" r="4393"/>
1396 // No core feature for handling this. We add support to import filter. We crop the bitmap
1397 // physically during import and shouldn't export the l r t b attributes anymore. In the
1398 // future if we add core feature to LibreOffice, we should change the control value with
1399 // 4393.
1401 assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "l");
1402 assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "r");
1403 assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "t");
1404 assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "b");
1407 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkBitmapFill)
1409 createSdImpressDoc("odp/tdf100348_FontworkBitmapFill.odp");
1410 save("Impress Office Open XML");
1412 // Make sure the fontwork shape has a blip bitmap fill and a colored outline.
1413 // Without the patch, fill and outline were black.
1414 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1415 const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
1416 assertXPath(pXmlDoc, sPathStart + "/a:blipFill/a:blip", 1);
1417 assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val", "ffbf00");
1420 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkGradientGlow)
1422 createSdImpressDoc("odp/tdf100348_FontworkGradientGlow.odp");
1423 save("Impress Office Open XML");
1425 // Make sure the fontwork shape has a gradient fill and a colored glow.
1426 // Without the patch, fill was black and no glow applied.
1427 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1428 const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
1429 assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "8d281e");
1430 assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad", "63360");
1431 assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow/a:srgbClr", "val", "ff4500");
1434 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345FullTransparentGradient)
1436 createSdImpressDoc("odp/tdf128345_FullTransparentGradient.odp");
1437 save("Impress Office Open XML");
1439 // Make sure the shape has no fill. Without the patch, fill was solid red.
1440 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1441 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill");
1444 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientLinear)
1446 createSdImpressDoc("odp/tdf128345_GradientLinear.odp");
1447 save("Impress Office Open XML");
1449 // Make sure the shape has a lin fill. Without the patch, fill was solid red.
1450 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1451 const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
1452 assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang", "3600000");
1453 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
1454 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos", "25000");
1455 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000");
1456 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "20000");
1457 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos", "100000");
1458 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val", "ff0000");
1459 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "80000");
1462 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientRadial)
1464 createSdImpressDoc("odp/tdf128345_GradientRadial.odp");
1465 save("Impress Office Open XML");
1467 // Make sure the shape has transparency. In OOXML alpha means 'opacity' with default
1468 // 100000 for full opak, so only the full transparency with val 0 should be written.
1469 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1470 const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
1471 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
1472 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000");
1473 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", 0);
1474 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val", "ffffff");
1475 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "0");
1478 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientAxial)
1480 // Without the patch, symmetric linear gradient with full transparence outside and
1481 // full opak in the middle were imported as full transparent.
1482 createSdImpressDoc("odp/tdf128345_GradientAxial.odp");
1483 saveAndReload("Impress Office Open XML");
1484 uno::Reference<beans::XPropertySet> xShapePropSet(getShapeFromPage(0, 0));
1486 awt::Gradient2 aTransparenceGradient;
1487 xShapePropSet->getPropertyValue("FillTransparenceGradient") >>= aTransparenceGradient;
1489 // MCGR: Use the completely imported gradient to check for correctness
1490 const basegfx::BColorStops aColorStops
1491 = model::gradient::getColorStopsFromUno(aTransparenceGradient.ColorStops);
1493 CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
1494 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
1495 CPPUNIT_ASSERT_EQUAL(aColorStops[0].getStopColor(), basegfx::BColor(1.0, 1.0, 1.0));
1496 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 0.5));
1497 CPPUNIT_ASSERT_EQUAL(aColorStops[1].getStopColor(), basegfx::BColor(0.0, 0.0, 0.0));
1498 CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 1.0));
1499 CPPUNIT_ASSERT_EQUAL(aColorStops[2].getStopColor(), basegfx::BColor(1.0, 1.0, 1.0));
1500 CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aTransparenceGradient.Style);
1503 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134969TransparencyOnColorGradient)
1505 createSdImpressDoc("odp/tdf134969_TransparencyOnColorGradient.odp");
1506 save("Impress Office Open XML");
1508 // Make sure the shape has a transparency in gradient stops.
1509 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1510 const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
1511 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
1512 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000");
1513 assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "60000");
1516 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testArcTo)
1518 createSdImpressDoc("pptx/arc-validiert.pptx");
1519 save("Impress Office Open XML");
1521 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1522 const OString sPath("//a:custGeom/a:pathLst/a:path/a:arcTo");
1523 assertXPath(pXmlDoc, sPath, "wR", "3");
1524 assertXPath(pXmlDoc, sPath, "hR", "3");
1525 assertXPath(pXmlDoc, sPath, "stAng", "1800000");
1526 assertXPath(pXmlDoc, sPath, "swAng", "2700000");
1529 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType)
1531 createSdImpressDoc("pptx/narration.pptx");
1532 save("Impress Office Open XML");
1533 xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
1534 // Without the accompanying fix in place, this test would have failed with:
1535 // - Expected: audio/mp4
1536 // - Actual : application/vnd.sun.star.media
1537 // i.e. the mime type of the narration was incorrect.
1538 assertXPath(pXmlDoc,
1539 "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/media1.m4a']",
1540 "ContentType", "audio/mp4");
1542 // Check if the bitmap of the media shape is exported correctly.
1543 xmlDocUniquePtr pSlideDoc = parseExport("ppt/slides/slide1.xml");
1544 OUString aImageId
1545 = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip", "embed");
1546 xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels");
1547 OUString aImagePath = "/rels:Relationships/rels:Relationship[@Id='" + aImageId + "']";
1548 // Something like ../media/image2.png.
1549 OUString aImageStreamName = getXPath(pRelsDoc, aImagePath.toUtf8(), "Target");
1550 OUString aImageAbsName = rtl::Uri::convertRelToAbs("file:///ppt/slides/", aImageStreamName);
1551 // Something like ppt/media/image2.png.
1552 OUString aImageRelName;
1553 CPPUNIT_ASSERT(aImageAbsName.startsWith("file:///", &aImageRelName));
1554 std::unique_ptr<SvStream> pImageStream = parseExportStream(maTempFile.GetURL(), aImageRelName);
1555 vcl::PngImageReader aReader(*pImageStream);
1556 BitmapEx aBitmapEx = aReader.read();
1557 // Without the accompanying fix in place, this test would have failed with:
1558 // - Expected: 256
1559 // - Actual : 120
1560 // i.e. the bitmap of the narration was lost, some default placeholder was exported instead.
1561 CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(256), aBitmapEx.GetSizePixel().Height());
1563 // Without the accompanying fix in place, this test would have failed with:
1564 // - Expected: 1
1565 // - Actual : 0
1566 // i.e. p:blipFill was missing its a:stretch child element, so the shape was invisible.
1567 assertXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:stretch/a:fillRect", 1);
1569 // Without the accompanying fix in place, this test would have failed with:
1570 // - ... no attribute 'cmd' exist
1571 // i.e. '<p:cmd type="call">' was written instead of '<p:cmd type="call" cmd="playFrom(0.0)">'.
1572 assertXPath(pSlideDoc, "//p:cmd", "cmd", "playFrom(0.0)");
1574 // Without the accompanying fix in place, this test would have failed with:
1575 // - Expected: 1
1576 // - Actual : 0
1577 // i.e. <p:childTnLst> had no <p:audio> children, the whole audio animation node was lost.
1578 assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", 1);
1580 // Without the accompanying fix in place, this test would have failed with:
1581 // - ... no attribute 'showWhenStopped' exist
1582 // i.e. <p:cMediaNode> had the default visibility -> bitmap was visible during slideshow.
1583 assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", "showWhenStopped", "0");
1585 // Without the accompanying fix in place, this test would have failed with:
1586 // - ... no attribute 'isNarration' exist
1587 // i.e. <p:audio> was not a narration -> could not mass-remove narrations on the UI.
1588 assertXPath(pSlideDoc, "//p:childTnLst/p:audio", "isNarration", "1");
1591 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316)
1593 createSdImpressDoc("odp/tdf150316.odp");
1594 save("Impress Office Open XML");
1596 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1597 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:pPr", "indent", "-343080");
1600 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D)
1602 createSdImpressDoc("pptx/tdf140865Wordart3D.pptx");
1603 save("Impress Office Open XML");
1604 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1606 // without the fix in place a:sp3d was lost on round trip, and so extrusion was lost.
1607 constexpr OStringLiteral sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr");
1608 assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "extrusionH", "342900");
1609 assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "contourW", "12700");
1610 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "w", "114300");
1611 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "h", "38100");
1612 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "prst", "softRound");
1613 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelB", "h", "152400");
1614 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:extrusionClr/a:srgbClr", "val", "990000");
1615 assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:contourClr/a:srgbClr", "val", "009876");
1618 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124457)
1620 createSdImpressDoc("pptx/tdf124457.pptx");
1621 save("Impress Office Open XML");
1623 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1625 assertXPath(pXmlDoc,
1626 "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/"
1627 "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[1]/p:cTn",
1628 "repeatCount", "3000");
1630 assertXPath(pXmlDoc,
1631 "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/"
1632 "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[2]/p:cTn",
1633 "repeatCount", "indefinite");
1636 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143126)
1638 createSdImpressDoc("pptx/tdf143126.pptx");
1639 save("Impress Office Open XML");
1641 xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml");
1643 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
1644 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2");
1645 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3");
1648 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143129)
1650 createSdImpressDoc("pptx/tdf143129.pptx");
1651 save("Impress Office Open XML");
1653 xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml");
1655 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
1656 assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0");
1659 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf118045)
1661 createSdImpressDoc("odp/tdf118045.odp");
1662 save("Impress Office Open XML");
1664 xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml");
1665 assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct", "val",
1666 "110000");
1669 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675)
1671 createSdImpressDoc("pptx/tdf137675.pptx");
1672 save("Impress Office Open XML");
1674 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1675 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill",
1676 "none");
1679 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf151134)
1681 createSdImpressDoc("pptx/tdf151134.odp");
1682 save("Impress Office Open XML");
1684 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
1685 assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", "lIns", "91440");
1688 CPPUNIT_PLUGIN_IMPLEMENT();
1690 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */