nss: upgrade to release 3.73
[LibreOffice.git] / sd / qa / unit / export-tests-ooxml2.cxx
blobbf701ac3ecc147e1628e967a362ac305627881e7
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 */
9 #include <officecfg/Office/Common.hxx>
10 #include "sdmodeltestbase.hxx"
11 #include <comphelper/propertysequence.hxx>
12 #include <comphelper/sequence.hxx>
13 #include <editeng/eeitem.hxx>
14 #include <editeng/editobj.hxx>
15 #include <editeng/outlobj.hxx>
16 #include <editeng/numitem.hxx>
17 #include <editeng/unoprnms.hxx>
19 #include <svx/svdotext.hxx>
20 #include <svx/svdomedia.hxx>
21 #include <svx/svdotable.hxx>
22 #include <svx/xlineit0.hxx>
23 #include <svx/xlndsit.hxx>
24 #include <rtl/ustring.hxx>
26 #include <com/sun/star/drawing/XDrawPage.hpp>
27 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
28 #include <com/sun/star/animations/TransitionType.hpp>
29 #include <com/sun/star/animations/TransitionSubType.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/awt/Gradient.hpp>
32 #include <com/sun/star/awt/Rectangle.hpp>
33 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
34 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
35 #include <com/sun/star/drawing/FillStyle.hpp>
36 #include <com/sun/star/style/LineSpacing.hpp>
37 #include <com/sun/star/style/LineSpacingMode.hpp>
38 #include <com/sun/star/frame/XLoadable.hpp>
40 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
42 #include <sdpage.hxx>
43 #include <cfloat>
44 #include <cstdlib>
46 #include <rtl/character.hxx>
48 using namespace css;
49 using namespace css::animations;
51 namespace {
53 bool checkBeginWithNumber(const OUString& rStr)
55 sal_Unicode aChar = (rStr.getLength() > 1) ? rStr[0] : '\0';
56 return aChar == '.' || aChar == '-' || rtl::isAsciiDigit(aChar);
61 #define CPPUNIT_ASSERT_MOTIONPATH(expect, actual) \
62 assertMotionPath(expect, actual, CPPUNIT_SOURCELINE())
64 static void assertMotionPath(const OUString &rStr1, const OUString &rStr2, const CppUnit::SourceLine &rSourceLine)
66 sal_Int32 nIdx1 = 0;
67 sal_Int32 nIdx2 = 0;
69 OString sMessage = OUStringToOString("Motion path values mismatch.\nExpect: " + rStr1 +
70 "\nActual: " + rStr2, RTL_TEXTENCODING_UTF8);
72 while(nIdx1 != -1 && nIdx2 != -1)
74 OUString aToken1 = rStr1.getToken(0, ' ', nIdx1);
75 OUString aToken2 = rStr2.getToken(0, ' ', nIdx2);
77 if (checkBeginWithNumber(aToken1) && checkBeginWithNumber(aToken2))
78 assertDoubleEquals(aToken1.toDouble(), aToken2.toDouble(), DBL_EPSILON, rSourceLine, sMessage.getStr());
79 else
80 assertEquals(aToken1, aToken2, rSourceLine, sMessage.getStr());
82 assertEquals(sal_Int32(-1), nIdx1, rSourceLine, sMessage.getStr());
83 assertEquals(sal_Int32(-1), nIdx2, rSourceLine, sMessage.getStr());
86 class SdOOXMLExportTest2 : public SdModelTestBaseXML
88 public:
89 void testTdf93883();
90 void testTdf91378();
91 void testBnc822341();
92 void testMathObject();
93 void testMathObjectPPT2010();
94 void testTdf119015();
95 void testTdf123090();
96 void testTdf126324();
97 void testTdf119187();
98 void testTdf132472();
99 void testTdf80224();
100 void testExportTransitionsPPTX();
101 void testPresetShapesExport();
102 void testTdf92527();
103 void testDatetimeFieldNumberFormat();
104 void testDatetimeFieldNumberFormatPPTX();
105 void testSlideNumberField();
106 void testSlideNumberFieldPPTX();
107 void testSlideCountField();
108 void testSlideNameField();
109 void testExtFileField();
110 void testAuthorField();
111 void testTdf99224();
112 void testTdf92076();
113 void testTdf59046();
114 void testTdf133502();
115 void testTdf105739();
116 void testPageBitmapWithTransparency();
117 void testPptmContentType();
118 void testTdf111798();
119 void testPptmVBAStream();
120 void testTdf111863();
121 void testTdf111518();
122 void testTdf100387();
123 void testClosingShapesAndLineCaps();
124 void testRotateFlip();
125 void testTdf106867();
126 void testTdf112280();
127 void testTdf112088();
128 void testTdf112333();
129 void testTdf112552();
130 void testTdf112557();
131 void testTdf128049();
132 void testTdf106026();
133 void testTdf112334();
134 void testTdf112089();
135 void testTdf112086();
136 void testTdf112647();
137 void testGroupRotation();
138 void testTdf104788();
139 void testSmartartRotation2();
140 void testTdf91999_rotateShape();
141 void testTdf114845_rotateShape();
142 void testGroupsPosition();
143 void testGroupsRotatedPosition();
144 void testAccentColor();
145 void testThemeColors();
146 void testTdf114848();
147 void testTdf68759();
148 void testTdf127901();
149 void testTdf48735();
150 void testTdf90626();
151 void testTdf107608();
152 void testTdf111786();
153 void testFontScale();
154 void testShapeAutofitPPTX();
155 void testLegacyShapeAutofitPPTX();
156 void testTdf115394();
157 void testTdf115394Zero();
158 void testTdf115005();
159 int testTdf115005_FallBack_Images(bool bAddReplacementImages);
160 void testTdf115005_FallBack_Images_On();
161 void testTdf115005_FallBack_Images_Off();
162 void testTdf118806();
163 void testTdf111789();
164 void testTdf100348_convert_Fontwork2TextWarp();
165 void testTdf1225573_FontWorkScaleX();
166 void testTdf99497_keepAppearanceOfCircleKind();
167 /// SmartArt animated elements
168 void testTdf104792();
169 void testTdf90627();
170 void testTdf104786();
171 void testTdf118783();
172 void testTdf104789();
173 void testOpenDocumentAsReadOnly();
174 void testTdf118835();
175 void testTdf118768();
176 void testTdf118836();
177 void testTdf116350TextEffects();
178 void testTdf128096();
179 void testTdf120573();
180 void testTdf118825();
181 void testTdf119118();
182 void testTdf99213();
183 void testPotxExport();
184 void testTdf44223();
185 void testSmartArtPreserve();
186 void testTdf125346();
187 void testTdf125346_2();
188 void testTdf125360();
189 void testTdf125360_1();
190 void testTdf125360_2();
191 void testTdf125551();
192 void testTdf136830();
193 void testTdf126234();
194 void testTdf126741();
195 void testTdf127372();
196 void testTdf127379();
197 void testTdf98603();
198 void testTdf79082();
199 void testTdf128213();
200 void testTdf129372();
201 void testShapeGlowEffect();
202 void testTdf119087();
203 void testTdf131554();
204 void testTdf132282();
205 void testTdf132201EffectOrder();
206 void testShapeSoftEdgeEffect();
207 void testShapeShadowBlurEffect();
208 void testTdf119223();
209 void testTdf96061_textHighlight();
211 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
213 CPPUNIT_TEST(testTdf93883);
214 CPPUNIT_TEST(testTdf91378);
215 CPPUNIT_TEST(testBnc822341);
216 CPPUNIT_TEST(testMathObject);
217 CPPUNIT_TEST(testMathObjectPPT2010);
218 CPPUNIT_TEST(testTdf119015);
219 CPPUNIT_TEST(testTdf123090);
220 CPPUNIT_TEST(testTdf126324);
221 CPPUNIT_TEST(testTdf119187);
222 CPPUNIT_TEST(testTdf132472);
223 CPPUNIT_TEST(testTdf80224);
224 CPPUNIT_TEST(testExportTransitionsPPTX);
225 CPPUNIT_TEST(testPresetShapesExport);
226 CPPUNIT_TEST(testTdf92527);
227 CPPUNIT_TEST(testDatetimeFieldNumberFormat);
228 CPPUNIT_TEST(testDatetimeFieldNumberFormatPPTX);
229 CPPUNIT_TEST(testSlideNumberField);
230 CPPUNIT_TEST(testSlideNumberFieldPPTX);
231 CPPUNIT_TEST(testSlideCountField);
232 CPPUNIT_TEST(testSlideNameField);
233 CPPUNIT_TEST(testExtFileField);
234 CPPUNIT_TEST(testAuthorField);
235 CPPUNIT_TEST(testTdf99224);
236 CPPUNIT_TEST(testTdf92076);
237 CPPUNIT_TEST(testTdf59046);
238 CPPUNIT_TEST(testTdf133502);
239 CPPUNIT_TEST(testTdf105739);
240 CPPUNIT_TEST(testPageBitmapWithTransparency);
241 CPPUNIT_TEST(testPptmContentType);
242 CPPUNIT_TEST(testTdf111798);
243 CPPUNIT_TEST(testPptmVBAStream);
244 CPPUNIT_TEST(testTdf111863);
245 CPPUNIT_TEST(testTdf111518);
246 CPPUNIT_TEST(testTdf100387);
247 CPPUNIT_TEST(testClosingShapesAndLineCaps);
248 CPPUNIT_TEST(testRotateFlip);
249 CPPUNIT_TEST(testTdf106867);
250 CPPUNIT_TEST(testTdf112280);
251 CPPUNIT_TEST(testTdf112088);
252 CPPUNIT_TEST(testTdf112333);
253 CPPUNIT_TEST(testTdf112552);
254 CPPUNIT_TEST(testTdf112557);
255 CPPUNIT_TEST(testTdf128049);
256 CPPUNIT_TEST(testTdf106026);
257 CPPUNIT_TEST(testTdf112334);
258 CPPUNIT_TEST(testTdf112089);
259 CPPUNIT_TEST(testTdf112086);
260 CPPUNIT_TEST(testTdf112647);
261 CPPUNIT_TEST(testGroupRotation);
262 CPPUNIT_TEST(testTdf104788);
263 CPPUNIT_TEST(testSmartartRotation2);
264 CPPUNIT_TEST(testTdf91999_rotateShape);
265 CPPUNIT_TEST(testTdf114845_rotateShape);
266 CPPUNIT_TEST(testGroupsPosition);
267 CPPUNIT_TEST(testGroupsRotatedPosition);
268 CPPUNIT_TEST(testAccentColor);
269 CPPUNIT_TEST(testThemeColors);
270 CPPUNIT_TEST(testTdf114848);
271 CPPUNIT_TEST(testTdf68759);
272 CPPUNIT_TEST(testTdf127901);
273 CPPUNIT_TEST(testTdf48735);
274 CPPUNIT_TEST(testTdf90626);
275 CPPUNIT_TEST(testTdf107608);
276 CPPUNIT_TEST(testTdf111786);
277 CPPUNIT_TEST(testFontScale);
278 CPPUNIT_TEST(testShapeAutofitPPTX);
279 CPPUNIT_TEST(testLegacyShapeAutofitPPTX);
280 CPPUNIT_TEST(testTdf115394);
281 CPPUNIT_TEST(testTdf115394Zero);
282 CPPUNIT_TEST(testTdf115005);
283 CPPUNIT_TEST(testTdf115005_FallBack_Images_On);
284 CPPUNIT_TEST(testTdf115005_FallBack_Images_Off);
285 CPPUNIT_TEST(testTdf118806);
286 CPPUNIT_TEST(testTdf111789);
287 CPPUNIT_TEST(testTdf100348_convert_Fontwork2TextWarp);
288 CPPUNIT_TEST(testTdf1225573_FontWorkScaleX);
289 CPPUNIT_TEST(testTdf99497_keepAppearanceOfCircleKind);
290 CPPUNIT_TEST(testTdf104792);
291 CPPUNIT_TEST(testTdf90627);
292 CPPUNIT_TEST(testTdf104786);
293 CPPUNIT_TEST(testTdf118783);
294 CPPUNIT_TEST(testTdf104789);
295 CPPUNIT_TEST(testOpenDocumentAsReadOnly);
296 CPPUNIT_TEST(testTdf118835);
297 CPPUNIT_TEST(testTdf118768);
298 CPPUNIT_TEST(testTdf118836);
299 CPPUNIT_TEST(testTdf116350TextEffects);
300 CPPUNIT_TEST(testTdf128096);
301 CPPUNIT_TEST(testTdf120573);
302 CPPUNIT_TEST(testTdf118825);
303 CPPUNIT_TEST(testTdf119118);
304 CPPUNIT_TEST(testTdf99213);
305 CPPUNIT_TEST(testPotxExport);
306 CPPUNIT_TEST(testTdf44223);
307 CPPUNIT_TEST(testSmartArtPreserve);
308 CPPUNIT_TEST(testTdf125346);
309 CPPUNIT_TEST(testTdf125346_2);
310 CPPUNIT_TEST(testTdf125360);
311 CPPUNIT_TEST(testTdf125360_1);
312 CPPUNIT_TEST(testTdf125360_2);
313 CPPUNIT_TEST(testTdf125551);
314 CPPUNIT_TEST(testTdf136830);
315 CPPUNIT_TEST(testTdf126234);
316 CPPUNIT_TEST(testTdf126741);
317 CPPUNIT_TEST(testTdf127372);
318 CPPUNIT_TEST(testTdf127379);
319 CPPUNIT_TEST(testTdf98603);
320 CPPUNIT_TEST(testTdf79082);
321 CPPUNIT_TEST(testTdf128213);
322 CPPUNIT_TEST(testTdf129372);
323 CPPUNIT_TEST(testShapeGlowEffect);
324 CPPUNIT_TEST(testTdf119087);
325 CPPUNIT_TEST(testTdf131554);
326 CPPUNIT_TEST(testTdf132282);
327 CPPUNIT_TEST(testTdf132201EffectOrder);
328 CPPUNIT_TEST(testShapeSoftEdgeEffect);
329 CPPUNIT_TEST(testShapeShadowBlurEffect);
330 CPPUNIT_TEST(testTdf119223);
331 CPPUNIT_TEST(testTdf96061_textHighlight);
333 CPPUNIT_TEST_SUITE_END();
335 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
337 static const struct { char const * pPrefix; char const * pURI; } namespaces[] =
339 // OOXML
340 { "ContentType", "http://schemas.openxmlformats.org/package/2006/content-types" },
341 { "rels", "http://schemas.openxmlformats.org/package/2006/relationships" },
342 { "mc", "http://schemas.openxmlformats.org/markup-compatibility/2006" },
343 { "v", "urn:schemas-microsoft-com:vml" },
344 { "a", "http://schemas.openxmlformats.org/drawingml/2006/main" },
345 { "c", "http://schemas.openxmlformats.org/drawingml/2006/chart" },
346 { "m", "http://schemas.openxmlformats.org/officeDocument/2006/math" },
347 { "pic", "http://schemas.openxmlformats.org/drawingml/2006/picture" },
348 { "wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" },
349 { "p", "http://schemas.openxmlformats.org/presentationml/2006/main" },
350 { "p14", "http://schemas.microsoft.com/office/powerpoint/2010/main" },
351 { "r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships" },
352 { "w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main" },
353 { "a14", "http://schemas.microsoft.com/office/drawing/2010/main" },
354 { "wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" },
355 { "wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" },
356 { "dgm", "http://schemas.openxmlformats.org/drawingml/2006/diagram" },
358 for (size_t i = 0; i < SAL_N_ELEMENTS(namespaces); ++i)
360 xmlXPathRegisterNs(pXmlXPathCtx,
361 reinterpret_cast<xmlChar const *>(namespaces[i].pPrefix),
362 reinterpret_cast<xmlChar const *>(namespaces[i].pURI));
368 void SdOOXMLExportTest2::testTdf93883()
370 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf93883.odp"), ODP);
371 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
372 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
373 uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
374 uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
375 CPPUNIT_ASSERT(!xPropSet->getPropertyValue("NumberingLevel").hasValue());
378 void SdOOXMLExportTest2::testBnc822341()
380 // Check import / export of embedded text document
381 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/bnc822341.odp"), ODP);
382 utl::TempFile tempFile1;
383 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile1 );
385 // Export an LO specific ole object (imported from an ODP document)
387 xmlDocUniquePtr pXmlDocCT = parseExport(tempFile1, "[Content_Types].xml");
388 assertXPath(pXmlDocCT,
389 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.wordprocessingml.document']",
390 "PartName",
391 "/ppt/embeddings/oleObject1.docx");
393 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile1, "ppt/slides/_rels/slide1.xml.rels");
394 assertXPath(pXmlDocRels,
395 "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']",
396 "Type",
397 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
399 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile1, "ppt/slides/slide1.xml");
400 assertXPath(pXmlDocContent,
401 "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj",
402 "progId",
403 "Word.Document.12");
405 const SdrPage *pPage = GetPage( 1, xDocShRef.get() );
407 const SdrObject* pObj = pPage->GetObj(0);
408 CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
409 CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() );
412 utl::TempFile tempFile2;
413 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 );
415 // Export an MS specific ole object (imported from a PPTX document)
417 xmlDocUniquePtr pXmlDocCT = parseExport(tempFile2, "[Content_Types].xml");
418 assertXPath(pXmlDocCT,
419 "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.wordprocessingml.document']",
420 "PartName",
421 "/ppt/embeddings/oleObject1.docx");
423 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile2, "ppt/slides/_rels/slide1.xml.rels");
424 assertXPath(pXmlDocRels,
425 "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']",
426 "Type",
427 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
429 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile2, "ppt/slides/slide1.xml");
430 assertXPath(pXmlDocContent,
431 "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj",
432 "progId",
433 "Word.Document.12");
435 SdDrawDocument *pDoc = xDocShRef->GetDoc();
436 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
437 const SdrPage *pPage = pDoc->GetPage(1);
438 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != nullptr );
440 const SdrObject* pObj = pPage->GetObj(0);
441 CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
442 CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() );
445 xDocShRef->DoClose();
448 void SdOOXMLExportTest2::testMathObject()
450 // Check import / export of math object
451 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/math.odp"), ODP);
452 utl::TempFile tempFile1;
453 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1);
455 // Export an LO specific ole object (imported from an ODP document)
457 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile1, "ppt/slides/slide1.xml");
458 assertXPath(pXmlDocContent,
459 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice",
460 "Requires",
461 "a14");
462 assertXPathContent(pXmlDocContent,
463 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/a14:m/m:oMath/m:r[1]/m:t",
464 "a");
466 const SdrPage *pPage = GetPage(1, xDocShRef);
467 const SdrObject* pObj = pPage->GetObj(0);
468 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
469 CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier());
472 utl::TempFile tempFile2;
473 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 );
475 // Export an MS specific ole object (imported from a PPTX document)
477 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile1, "ppt/slides/slide1.xml");
478 assertXPath(pXmlDocContent,
479 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice",
480 "Requires",
481 "a14");
482 assertXPathContent(pXmlDocContent,
483 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/a14:m/m:oMath/m:r[1]/m:t",
484 "a");
486 const SdrPage *pPage = GetPage(1, xDocShRef);
487 const SdrObject* pObj = pPage->GetObj(0);
488 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
489 CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier());
492 xDocShRef->DoClose();
495 void SdOOXMLExportTest2::testMathObjectPPT2010()
497 // Check import / export of math object
498 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/Math.pptx"), PPTX);
499 utl::TempFile tempFile1;
500 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1);
502 // Export an MS specific ole object (imported from a PPTX document)
504 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile1, "ppt/slides/slide1.xml");
505 assertXPath(pXmlDocContent,
506 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice",
507 "Requires",
508 "a14");
509 assertXPathContent(pXmlDocContent,
510 "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/a14:m/m:oMath/m:sSup/m:e/m:r[1]/m:t",
511 u"\U0001D44E"); // non-BMP char
513 const SdrPage *pPage = GetPage(1, xDocShRef);
514 const SdrObject* pObj = pPage->GetObj(0);
515 CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
516 CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier());
519 xDocShRef->DoClose();
522 void SdOOXMLExportTest2::testTdf119015()
524 ::sd::DrawDocShellRef xDocShRef
525 = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf119015.pptx"), PPTX);
526 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
528 const SdrPage* pPage = GetPage(1, xDocShRef);
530 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
531 CPPUNIT_ASSERT(pTableObj);
532 // The position was previously not properly initialized: (0, 0, 100, 100)
533 CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(6991, 6902), Size(14099, 1999)),
534 pTableObj->GetLogicRect());
535 uno::Reference<table::XTable> xTable(pTableObj->getTable());
537 // Test that we actually have three cells: this threw css.lang.IndexOutOfBoundsException
538 uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
539 uno::UNO_QUERY_THROW);
540 CPPUNIT_ASSERT_EQUAL(OUString("A3"), xTextRange->getString());
542 xDocShRef->DoClose();
545 void SdOOXMLExportTest2::testTdf123090()
547 ::sd::DrawDocShellRef xDocShRef
548 = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf123090.pptx"), PPTX);
549 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
551 const SdrPage* pPage = GetPage(1, xDocShRef);
553 sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
554 CPPUNIT_ASSERT(pTableObj);
556 uno::Reference<table::XTable> xTable(pTableObj->getTable());
558 // Test that we actually have two cells: this threw css.lang.IndexOutOfBoundsException
559 uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
560 uno::UNO_QUERY_THROW);
561 CPPUNIT_ASSERT_EQUAL(OUString("aaa"), xTextRange->getString());
563 sal_Int32 nWidth;
564 uno::Reference< css::table::XTableColumns > xColumns( xTable->getColumns(), uno::UNO_SET_THROW);
565 uno::Reference< beans::XPropertySet > xRefColumn( xColumns->getByIndex(1), uno::UNO_QUERY_THROW );
566 xRefColumn->getPropertyValue( "Width" ) >>= nWidth;
567 CPPUNIT_ASSERT_EQUAL( sal_Int32(9136), nWidth);
569 xDocShRef->DoClose();
572 void SdOOXMLExportTest2::testTdf126324()
574 sd::DrawDocShellRef xDocShRef
575 = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126324.pptx"), PPTX);
576 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
577 uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
578 uno::UNO_QUERY);
579 CPPUNIT_ASSERT(xDoc.is());
580 uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
581 CPPUNIT_ASSERT(xPage.is());
582 uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
583 CPPUNIT_ASSERT(xShape.is());
584 uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY_THROW )->getText();
585 CPPUNIT_ASSERT_EQUAL(OUString("17"), xText->getString());
587 xDocShRef->DoClose();
590 void SdOOXMLExportTest2::testTdf119187()
592 std::vector< sd::DrawDocShellRef > xDocShRef;
593 // load document
594 xDocShRef.push_back(loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf119187.pptx"), PPTX));
595 // load resaved document
596 xDocShRef.push_back(saveAndReload( xDocShRef.at(0).get(), PPTX ));
598 // check documents
599 for (const sd::DrawDocShellRef& xDoc : xDocShRef)
601 // get shape properties
602 const SdrPage* pPage = GetPage(1, xDoc);
603 CPPUNIT_ASSERT(pPage);
604 SdrObject* pObj = pPage->GetObj(0);
605 CPPUNIT_ASSERT(pObj);
606 const sdr::properties::BaseProperties & rProperties = pObj->GetProperties();
608 // check text vertical alignment
609 const SdrTextVertAdjustItem& rSdrTextVertAdjustItem = rProperties.GetItem(SDRATTR_TEXT_VERTADJUST);
610 const SdrTextVertAdjust eTVA = rSdrTextVertAdjustItem.GetValue();
611 CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_TOP, eTVA);
615 void SdOOXMLExportTest2::testTdf132472()
617 sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf132472.pptx"), PPTX );
618 const SdrPage *pPage = GetPage( 1, xDocShRef );
620 sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
621 CPPUNIT_ASSERT( pTableObj );
623 uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
624 uno::Reference< beans::XPropertySet > xCell;
625 Color nColor;
627 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
628 xCell->getPropertyValue("FillColor") >>= nColor;
629 CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), nColor);
631 uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xCell));
632 uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
633 uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY);
634 xPropSet->getPropertyValue("CharColor") >>= nColor;
636 // Without the fix in place, this test would have failed with
637 // - Expected: Color: R:0 G:0 B:0 A:0
638 // - Actual : Color: R:255 G:255 B:255 A:0
639 CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
641 xDocShRef->DoClose();
644 void SdOOXMLExportTest2::testTdf80224()
646 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf80224.odp"), ODP);
647 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
648 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
650 uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
651 uno::Reference< beans::XPropertySet > xPropSet( xParagraph->getStart(), uno::UNO_QUERY_THROW );
653 sal_Int32 nCharColor;
654 xPropSet->getPropertyValue("CharColor") >>= nCharColor;
655 CPPUNIT_ASSERT_EQUAL(sal_Int32(6644396), nCharColor);
656 xDocShRef->DoClose();
659 void SdOOXMLExportTest2::testTdf91378()
662 //Check For Import and Export Both
663 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf91378.pptx"), PPTX);
664 for( sal_uInt32 i=0;i<2;i++)
666 SdDrawDocument *pDoc = xDocShRef->GetDoc();
667 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
668 uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( xDocShRef->GetModel(), uno::UNO_QUERY );
669 uno::Reference<document::XDocumentProperties> xProps = xDocumentPropertiesSupplier->getDocumentProperties();
670 uno::Reference<beans::XPropertySet> xUDProps( xProps->getUserDefinedProperties(), uno::UNO_QUERY );
671 OUString propValue;
672 xUDProps->getPropertyValue("Testing") >>= propValue;
673 CPPUNIT_ASSERT(propValue.isEmpty());
674 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
676 xDocShRef->DoClose();
679 static bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> const & xDoc, sal_Int32 nSlideNumber,
680 sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType,
681 bool bExpectedDirection = true)
683 sal_Int32 nSlideIndex = nSlideNumber - 1;
685 CPPUNIT_ASSERT_MESSAGE("Slide/Page index out of range", nSlideIndex < xDoc->getDrawPages()->getCount());
687 uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(nSlideIndex), uno::UNO_QUERY_THROW);
688 uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
690 sal_Int16 nTransitionType = 0;
691 xPropSet->getPropertyValue("TransitionType") >>= nTransitionType;
693 if (nExpectedTransitionType != nTransitionType)
695 std::cerr << "Transition type: " << nTransitionType << " " << nExpectedTransitionType << std::endl;
696 return false;
699 sal_Int16 nTransitionSubtype = 0;
700 xPropSet->getPropertyValue("TransitionSubtype") >>= nTransitionSubtype;
701 if (nExpectedTransitionSubType != nTransitionSubtype)
703 std::cerr << "Transition Subtype: " << nTransitionSubtype << " " << nExpectedTransitionSubType << std::endl;
704 return false;
707 bool bDirection = false;
708 xPropSet->getPropertyValue("TransitionDirection") >>= bDirection;
710 if (bExpectedDirection != bDirection)
712 std::cerr << "Transition Direction: " << (bExpectedDirection ? "normal" : "reversed")
713 << " " << (bDirection ? "normal" : "reversed") << std::endl;
714 return false;
717 return true;
720 void SdOOXMLExportTest2::testExportTransitionsPPTX()
722 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/AllTransitions.odp"), ODP);
723 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
724 uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
726 // WIPE TRANSITIONS
727 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 01, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM, false));
728 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 02, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT));
729 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 03, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT, false));
730 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 04, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM));
732 // CUT THROUGH BLACK
733 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 31, TransitionType::BARWIPE, TransitionSubType::FADEOVERCOLOR));
735 // COMB
736 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 41, TransitionType::PUSHWIPE, TransitionSubType::COMBHORIZONTAL));
737 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 42, TransitionType::PUSHWIPE, TransitionSubType::COMBVERTICAL));
739 // OUTSIDE TURNING CUBE
740 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 57, TransitionType::MISCSHAPEWIPE, TransitionSubType::CORNERSOUT));
741 // INSIDE TURNING CUBE
742 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 60, TransitionType::MISCSHAPEWIPE, TransitionSubType::CORNERSIN));
744 // FALL
745 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 61, TransitionType::MISCSHAPEWIPE, TransitionSubType::LEFTTORIGHT));
747 // VORTEX
748 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 70, TransitionType::MISCSHAPEWIPE, TransitionSubType::VERTICAL));
750 // RIPPLE
751 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, TransitionType::MISCSHAPEWIPE, TransitionSubType::HORIZONTAL));
753 // GLITTER
754 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 72, TransitionType::MISCSHAPEWIPE, TransitionSubType::DIAMOND));
756 // HONEYCOMB
757 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 73, TransitionType::MISCSHAPEWIPE, TransitionSubType::HEART));
759 // NEWSFLASH
760 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 74, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
762 // OVAL VERTICAL - cannot be exported to PPTX so fallback to circle
763 //CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 76, TransitionType::ELLIPSEWIPE, TransitionSubType::VERTICAL));
764 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 76, TransitionType::ELLIPSEWIPE, TransitionSubType::CIRCLE));
766 xDocShRef->DoClose();
769 void SdOOXMLExportTest2::testPresetShapesExport()
771 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/preset-shapes-export.odp"), ODP);
772 const char *sShapeTypeAndValues[] =
774 "wedgeEllipseCallout",
775 "adj1","val 45310",
776 "adj2","val 97194",
777 "wedgeRoundRectCallout",
778 "adj1","val 46694",
779 "adj2","val 129726",
780 "adj3","val 16667",
781 "wedgeRectCallout",
782 "adj1","val 40037",
783 "adj2","val 111694",
784 "smileyFace",
785 "adj","val -9282",
786 "can",
787 "adj","val 50000",
788 "frame",
789 "adj1","val 10490",
790 "donut",
791 "adj","val 9601",
792 "bevel",
793 "adj","val 42587",
794 "foldedCorner",
795 "adj","val 10750",
796 "verticalScroll",
797 "adj","val 25000",
798 "horizontalScroll",
799 "adj","val 25000",
800 "cube",
801 "adj","val 85129",
802 "bracketPair",
803 "adj","val 50000",
804 "sun",
805 "adj","val 12500",
806 "bracePair",
807 "adj","val 25000",
808 "cloudCallout",
809 "adj1","val 77611",
810 "adj2","val -47819",
811 "borderCallout1",
812 "adj1","val 18750",
813 "adj2","val -8333",
814 "adj3","val 170013",
815 "adj4","val 143972",
816 "borderCallout2",
817 "adj1","val 18750",
818 "adj2","val -8333",
819 "adj3","val 113768",
820 "adj4","val -81930",
821 "adj5","val -22375",
822 "adj6","val -134550",
823 "blockArc",
824 "adj1","val 13020000",
825 "adj2","val 19380000",
826 "adj3","val 3773",
829 utl::TempFile tempFile;
830 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
832 xmlDocUniquePtr pXmlDocCT = parseExport(tempFile, "ppt/slides/slide1.xml");
833 const OString sPattern( "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom[@prst='_T_']/a:avLst/a:gd[_N_]" );
834 const OString sT( "_T_" );
835 const OString sN( "_N_" );
836 const OString sPropertyName("name");
837 const OString sPropertyFmla("fmla");
839 size_t i = 0;
840 while(i < SAL_N_ELEMENTS( sShapeTypeAndValues )) {
841 OString sType( sShapeTypeAndValues[ i++ ] );
842 for ( size_t j = 1 ; i < SAL_N_ELEMENTS( sShapeTypeAndValues ) && OString(sShapeTypeAndValues[i]).startsWith("adj") ; ++j ) {
843 OString sXPath= sPattern.replaceFirst( sT, sType).replaceFirst( sN, OString::number(j) );
844 assertXPath(pXmlDocCT, sXPath, sPropertyName , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) );
845 assertXPath(pXmlDocCT, sXPath, sPropertyFmla , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) );
850 void SdOOXMLExportTest2::testTdf92527()
852 // We draw a diamond in an empty document. A newly created diamond shape does not have
853 // CustomShapeGeometry - Path - Segments property, and previously DrawingML exporter
854 // did not export custom shapes which did not have CustomShapeGeometry - Path - Segments property.
855 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/empty.fodp"), FODG );
856 uno::Reference<css::lang::XMultiServiceFactory> xFactory(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
857 uno::Reference<drawing::XShape> xShape1(xFactory->createInstance("com.sun.star.drawing.CustomShape"), uno::UNO_QUERY);
858 uno::Reference<drawing::XDrawPagesSupplier> xDoc1(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
859 uno::Reference<drawing::XDrawPage> xPage1(xDoc1->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
860 xPage1->add(xShape1);
861 xShape1->setSize(awt::Size(10000, 10000));
862 xShape1->setPosition(awt::Point(1000, 1000));
863 uno::Sequence<beans::PropertyValue> aShapeGeometry(comphelper::InitPropertySequence(
865 {"Type", uno::makeAny(OUString("diamond"))},
866 }));
867 uno::Reference<beans::XPropertySet> xPropertySet1(xShape1, uno::UNO_QUERY);
868 xPropertySet1->setPropertyValue("CustomShapeGeometry", uno::makeAny(aShapeGeometry));
870 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
872 uno::Reference<drawing::XDrawPagesSupplier> xDoc2(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
873 uno::Reference<drawing::XDrawPage> xPage2(xDoc2->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
874 uno::Reference<drawing::XShape> xShape2(xPage2->getByIndex(0), uno::UNO_QUERY_THROW);
875 uno::Reference< beans::XPropertySet > xPropertySet2( xShape2, uno::UNO_QUERY_THROW );
876 uno::Sequence<beans::PropertyValue> aProps;
877 xPropertySet2->getPropertyValue("CustomShapeGeometry") >>= aProps;
878 uno::Sequence<beans::PropertyValue> aPathProps;
879 for (beans::PropertyValue const & rProp : std::as_const(aProps))
881 if (rProp.Name == "Path")
882 aPathProps = rProp.Value.get< uno::Sequence<beans::PropertyValue> >();
884 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates;
885 for (beans::PropertyValue const & rProp : std::as_const(aPathProps))
887 if (rProp.Name == "Coordinates")
888 aCoordinates = rProp.Value.get< uno::Sequence<drawing::EnhancedCustomShapeParameterPair> >();
891 // 5 coordinate pairs, 1 MoveTo, 4 LineTo
892 CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aCoordinates.getLength());
893 xDocShRef->DoClose();
896 namespace {
898 void matchNumberFormat( int nPage, uno::Reference< text::XTextField > const & xField)
900 uno::Reference< beans::XPropertySet > xPropSet( xField, uno::UNO_QUERY_THROW );
901 sal_Int32 nNumFmt;
902 xPropSet->getPropertyValue("NumberFormat") >>= nNumFmt;
903 switch( nPage )
905 case 0: // 13/02/96
906 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(2), nNumFmt);
907 break;
908 case 1: // 13/02/1996
909 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(5), nNumFmt);
910 break;
911 case 2: // 13 February 1996
912 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(3), nNumFmt);
913 break;
914 case 3: // 13:49:38
915 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(2), nNumFmt);
916 break;
917 case 4: // 13:49
918 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(3), nNumFmt);
919 break;
920 case 5: // 01:49 PM
921 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(6), nNumFmt);
922 break;
923 case 6: // 01:49:38 PM
924 CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(7), nNumFmt);
930 void SdOOXMLExportTest2::testDatetimeFieldNumberFormat()
932 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/numfmt.odp"), ODP);
934 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
936 for(sal_uInt16 i = 0; i <= 6; ++i)
938 matchNumberFormat( i, getTextFieldFromPage(0, 0, 0, i, xDocShRef) );
941 xDocShRef->DoClose();
944 void SdOOXMLExportTest2::testDatetimeFieldNumberFormatPPTX()
946 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/numfmt.pptx"), PPTX);
948 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
950 for(sal_uInt16 i = 0; i <= 6; ++i)
952 matchNumberFormat( i, getTextFieldFromPage(0, 0, 0, i, xDocShRef) );
955 xDocShRef->DoClose();
958 void SdOOXMLExportTest2::testSlideNumberField()
960 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidenum_field.odp"), ODP);
962 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
964 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
965 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
967 xDocShRef->DoClose();
970 void SdOOXMLExportTest2::testSlideNumberFieldPPTX()
972 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/slidenum_field.pptx"), PPTX);
974 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
976 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
977 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
979 xDocShRef->DoClose();
982 void SdOOXMLExportTest2::testSlideCountField()
984 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidecount_field.odp"), ODP);
986 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
988 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
989 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
991 xDocShRef->DoClose();
994 void SdOOXMLExportTest2::testSlideNameField()
996 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidename_field.odp"), ODP);
998 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
1000 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
1001 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
1003 xDocShRef->DoClose();
1006 void SdOOXMLExportTest2::testExtFileField()
1008 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/extfile_field.odp"), ODP);
1010 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
1012 for(sal_uInt16 i = 0; i <= 3; ++i)
1014 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, i, 0, xDocShRef);
1015 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
1017 uno::Reference< beans::XPropertySet > xPropSet( xField, uno::UNO_QUERY_THROW );
1018 sal_Int32 nNumFmt;
1019 xPropSet->getPropertyValue("FileFormat") >>= nNumFmt;
1020 switch( i )
1022 case 0: // Path/File name
1023 CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(0), nNumFmt);
1024 break;
1025 case 1: // Path
1026 CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(1), nNumFmt);
1027 break;
1028 case 2: // File name without extension
1029 CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(2), nNumFmt);
1030 break;
1031 case 3: // File name with extension
1032 CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(3), nNumFmt);
1036 xDocShRef->DoClose();
1039 void SdOOXMLExportTest2::testAuthorField()
1041 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_field.odp"), ODP);
1043 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
1045 uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
1046 CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
1048 xDocShRef->DoClose();
1051 void SdOOXMLExportTest2::testTdf99224()
1053 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf99224.odp"), ODP);
1054 xShell = saveAndReload(xShell.get(), PPTX);
1055 uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
1056 // This was 0: the image with text was lost on export.
1057 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount());
1058 xShell->DoClose();
1061 void SdOOXMLExportTest2::testTdf92076()
1063 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf92076.odp"), ODP);
1064 xShell = saveAndReload(xShell.get(), PPTX);
1065 uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
1066 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xPage->getCount());
1067 xShell->DoClose();
1070 void SdOOXMLExportTest2::testTdf59046()
1072 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf59046.odp"), ODP);
1073 utl::TempFile tempFile;
1074 xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
1075 xShell->DoClose();
1076 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
1077 assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", 1);
1080 void SdOOXMLExportTest2::testTdf133502()
1082 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf133502.odp"), ODP);
1083 utl::TempFile tempFile;
1084 xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
1085 xShell->DoClose();
1086 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/comments/comment1.xml");
1088 assertXPathContent(pXmlDocRels, "/p:cmLst/p:cm/p:text", "Test for creator-initials");
1090 // Without the fix in place, the comment position would have been 0,0
1091 assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "x", "2032");
1092 assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "y", "1029");
1095 void SdOOXMLExportTest2::testTdf105739()
1097 // Gradient was lost during saving to ODP
1098 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf105739.pptx"), PPTX);
1099 utl::TempFile tempFile;
1100 xShell = saveAndReload(xShell.get(), ODP, &tempFile);
1101 uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
1102 uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
1103 uno::Any aAny = xPropSet->getPropertyValue("Background");
1104 CPPUNIT_ASSERT(aAny.hasValue());
1105 if (aAny.hasValue())
1107 uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
1108 aAny >>= aXBackgroundPropSet;
1110 // Test fill type
1111 drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
1112 aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
1113 CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(aFillStyle));
1115 // Test gradient properties
1116 com::sun::star::awt::Gradient aFillGradient;
1117 aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aFillGradient;
1118 CPPUNIT_ASSERT_EQUAL(int(awt::GradientStyle_LINEAR), static_cast<int>(aFillGradient.Style));
1119 CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor);
1120 CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor);
1123 xShell->DoClose();
1126 void SdOOXMLExportTest2::testPageBitmapWithTransparency()
1128 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/page_transparent_bitmap.pptx"), PPTX );
1130 xDocShRef = saveAndReload( xDocShRef.get(), ODP );
1131 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
1132 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1133 CPPUNIT_ASSERT_EQUAL_MESSAGE( "There should be exactly one page", static_cast<sal_Int32>(1), xDoc->getDrawPages()->getCount() );
1135 uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) );
1137 uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY );
1138 uno::Any aAny = xPropSet->getPropertyValue( "Background" );
1139 CPPUNIT_ASSERT_MESSAGE("Slide background is missing", aAny.hasValue());
1141 uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
1142 aAny >>= aXBackgroundPropSet;
1143 sal_Int32 nTransparence;
1144 aAny = aXBackgroundPropSet->getPropertyValue( "FillTransparence" );
1145 aAny >>= nTransparence;
1146 CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide background transparency is wrong", sal_Int32(49), nTransparence);
1148 xDocShRef->DoClose();
1151 void SdOOXMLExportTest2::testPptmContentType()
1153 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptm/macro.pptm"), PPTM);
1154 utl::TempFile tempFile;
1155 xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile);
1157 // Assert that the content type is the one of PPTM
1158 xmlDocUniquePtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
1159 assertXPath(pXmlContentType,
1160 "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']",
1161 "ContentType",
1162 "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml");
1164 xDocShRef->DoClose();
1167 void SdOOXMLExportTest2::testTdf111798()
1169 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf111798.odp"), ODP);
1170 utl::TempFile tempFile;
1171 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1172 xDocShRef->DoClose();
1173 xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
1175 const OUString data[][29] =
1178 "2700000", "2458080", "2414880", "1439640", "1440000",
1179 "moveTo", "0", "3000",
1180 "lnTo[1]", "3000", "3000",
1181 "lnTo[2]", "3000", "4000",
1182 "lnTo[3]", "4000", "2000",
1183 "lnTo[4]", "3000", "0",
1184 "lnTo[5]", "3000", "1000",
1185 "lnTo[6]", "0", "1000",
1186 "lnTo[7]", "0", "3000"
1189 "2700000", "6778080", "2414880", "1439640", "1440000",
1190 "moveTo", "3000", "0",
1191 "lnTo[1]", "3000", "3000",
1192 "lnTo[2]", "4000", "3000",
1193 "lnTo[3]", "2000", "4000",
1194 "lnTo[4]", "0", "3000",
1195 "lnTo[5]", "1000", "3000",
1196 "lnTo[6]", "1000", "0",
1197 "lnTo[7]", "3000", "0"
1201 for (size_t nShapeIndex = 0; nShapeIndex < SAL_N_ELEMENTS(data); nShapeIndex++)
1203 size_t nDataIndex = 0;
1205 const OString sSpPr = "/p:sld/p:cSld/p:spTree/p:sp[" + OString::number(nShapeIndex + 1) + "]/p:spPr";
1206 const OString sXfrm = sSpPr + "/a:xfrm";
1207 assertXPath(pXmlDoc, sXfrm, "rot", data[nShapeIndex][nDataIndex++]);
1208 const OString sOff = sXfrm + "/a:off";
1209 assertXPath(pXmlDoc, sOff, "x", data[nShapeIndex][nDataIndex++]);
1210 assertXPath(pXmlDoc, sOff, "y", data[nShapeIndex][nDataIndex++]);
1211 const OString sExt = sXfrm + "/a:ext";
1212 assertXPath(pXmlDoc, sExt, "cx", data[nShapeIndex][nDataIndex++]);
1213 assertXPath(pXmlDoc, sExt, "cy", data[nShapeIndex][nDataIndex++]);
1215 while (nDataIndex < SAL_N_ELEMENTS(data[nShapeIndex]))
1217 const OString sPt = sSpPr + "/a:custGeom/a:pathLst/a:path/a:" + data[nShapeIndex][nDataIndex++].toUtf8() + "/a:pt";
1218 assertXPath(pXmlDoc, sPt, "x", data[nShapeIndex][nDataIndex++]);
1219 assertXPath(pXmlDoc, sPt, "y", data[nShapeIndex][nDataIndex++]);
1224 void SdOOXMLExportTest2::testPptmVBAStream()
1226 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptm/macro.pptm"), PPTM);
1227 utl::TempFile tempFile;
1228 xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile);
1230 uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
1231 // This failed: VBA stream was not roundtripped
1232 CPPUNIT_ASSERT(xNameAccess->hasByName("ppt/vbaProject.bin"));
1234 xDocShRef->DoClose();
1237 void SdOOXMLExportTest2::testTdf111863()
1239 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf111863.pptx"), PPTX);
1240 utl::TempFile tempFile;
1241 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1242 xDocShRef->DoClose();
1244 // check that transition attribute didn't change from 'out' to 'in'
1245 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1246 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animEffect",
1247 "transition", "out");
1250 void SdOOXMLExportTest2::testTdf111518()
1252 sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf111518.pptx"), PPTX);
1253 utl::TempFile tempFile;
1254 tempFile.EnableKillingFile(false);
1255 xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
1256 xShell->DoClose();
1258 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
1259 OUString sActual = getXPath(pXmlDocRels,
1260 "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animMotion",
1261 "path");
1262 CPPUNIT_ASSERT_MOTIONPATH("M -3.54167E-6 -4.81481E-6 L 0.39037 -0.00069 E", sActual);
1265 void SdOOXMLExportTest2::testTdf100387()
1268 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf100387.odp"), ODP);
1269 utl::TempFile tempFile;
1270 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1271 xDocShRef->DoClose();
1272 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1274 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn", "dur", "indefinite");
1275 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]/p:cTn", "fill", "hold");
1276 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]/p:cTn/p:childTnLst/p:par/p:cTn", "fill", "hold");
1278 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
1279 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "st", "0");
1280 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[1]"
1281 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "end", "0");
1283 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]"
1284 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "st", "1");
1285 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]"
1286 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "end", "1");
1288 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
1289 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "st", "2");
1290 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[3]"
1291 "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "end", "2");
1294 // tdf#126746 Add support for Line Caps import and export
1295 void SdOOXMLExportTest2::testClosingShapesAndLineCaps()
1297 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/closed-shapes.odp"), ODP);
1298 utl::TempFile tempFile;
1299 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1300 xDocShRef->DoClose();
1301 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1302 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", 1);
1303 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", 1);
1304 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", 1);
1305 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 1);
1306 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:ln", "cap", "rnd");
1307 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:ln/a:miter", 1);
1309 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
1310 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:ln", "cap", "rnd");
1311 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:ln/a:miter", 1);
1313 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
1314 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:ln", "cap", "rnd");
1315 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:ln/a:miter", 1);
1317 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
1318 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:ln", "cap", "sq");
1319 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:ln/a:round", 1);
1321 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
1322 assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style
1323 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln/a:bevel", 1);
1325 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
1326 assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style
1327 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:ln/a:round", 1);
1330 void SdOOXMLExportTest2::testRotateFlip()
1332 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/rotate_flip.odp"), ODP);
1333 utl::TempFile tempFile;
1334 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1335 xDocShRef->DoClose();
1336 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1338 const OUString data[][4] =
1339 {// flipH flipV x y
1340 { "0", "1", "1170000", "1035720" },
1341 { "1", "1", "7108560", "1036440" },
1342 { "1", "0", "4140000", "1036440" }
1345 const OUString points[][2] = { {"221", "293"}, {"506", "12" }, {"367", "0" }, {"29", "406"}, {"431", "347"}, {"145", "645"},
1346 {"99", "520"}, {"0", "861"}, {"326", "765"}, {"209", "711"}, {"640", "233"}, {"640", "233"} };
1348 for (size_t nShapeIndex = 0; nShapeIndex < SAL_N_ELEMENTS(data); nShapeIndex++)
1350 size_t nDataIndex = 0;
1352 const OString sSpPr = "/p:sld/p:cSld/p:spTree/p:sp[" + OString::number(nShapeIndex + 1) + "]/p:spPr";
1353 const OString sXfrm = sSpPr + "/a:xfrm";
1354 if(data[nShapeIndex][nDataIndex++] == "1")
1355 assertXPath(pXmlDocContent, sXfrm, "flipH", "1");
1356 if(data[nShapeIndex][nDataIndex++] == "1")
1357 assertXPath(pXmlDocContent, sXfrm, "flipV", "1");
1358 assertXPath(pXmlDocContent, sXfrm, "rot", "20400000");
1359 const OString sOff = sXfrm + "/a:off";
1360 assertXPath(pXmlDocContent, sOff, "x", data[nShapeIndex][nDataIndex++]);
1361 assertXPath(pXmlDocContent, sOff, "y", data[nShapeIndex][nDataIndex++]);
1362 const OString sExt = sXfrm + "/a:ext";
1363 assertXPath(pXmlDocContent, sExt, "cx", "1800000");
1364 assertXPath(pXmlDocContent, sExt, "cy", "3600000");
1366 for (size_t nPointIndex = 0; nPointIndex < SAL_N_ELEMENTS(points); nPointIndex++)
1368 const OString sPt = sSpPr + "/a:custGeom/a:pathLst/a:path/a:lnTo[" + OString::number(nPointIndex + 1) + "]/a:pt";
1369 assertXPath(pXmlDocContent, sPt, "x", points[nPointIndex][0]);
1370 assertXPath(pXmlDocContent, sPt, "y", points[nPointIndex][1]);
1372 assertXPath(pXmlDocContent, sSpPr + "/a:custGeom/a:pathLst/a:path/a:close", 1);
1376 void SdOOXMLExportTest2::testTdf106867()
1378 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf106867.pptx"), PPTX);
1379 utl::TempFile tempFile;
1380 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1382 const SdrPage *pPage = GetPage(1, xDocShRef.get());
1384 // first check that we have the media object
1385 const SdrMediaObj* pMediaObj = dynamic_cast<SdrMediaObj*>(pPage->GetObj(2));
1386 CPPUNIT_ASSERT_MESSAGE("no media object", pMediaObj != nullptr);
1387 CPPUNIT_ASSERT_EQUAL(OUString("vnd.sun.star.Package:ppt/media/media1.avi"), pMediaObj->getURL());
1389 xDocShRef->DoClose();
1391 // additional checks of the output file
1392 uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
1393 // check that the document contains the video stream
1394 CPPUNIT_ASSERT(xNameAccess->hasByName("ppt/media/media1.avi"));
1396 // both the ooxml and the extended markup
1397 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1398 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:videoFile");
1399 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/p:extLst/p:ext/p14:media");
1401 // target the shape with the video in the command
1402 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr/p:tgtEl/p:spTgt",
1403 "spid", "42");
1406 void SdOOXMLExportTest2::testTdf112280()
1408 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112280.pptx"), PPTX);
1409 utl::TempFile tempFile;
1410 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1411 xDocShRef->DoClose();
1413 // check the animRot value
1414 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1415 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animRot",
1416 "by", "21600000");
1419 void SdOOXMLExportTest2::testTdf112088()
1421 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112088.pptx"), PPTX);
1422 utl::TempFile tempFile;
1423 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1424 xDocShRef->DoClose();
1426 // check gradient stops
1427 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1428 assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:gradFill/a:gsLst", 2);
1431 void SdOOXMLExportTest2::testTdf112333()
1433 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112333.pptx"), PPTX);
1434 utl::TempFile tempFile;
1435 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1436 xDocShRef->DoClose();
1438 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1440 OUString sTo = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set[1]/p:to/p:strVal", "val");
1441 CPPUNIT_ASSERT_EQUAL(OUString("solid"), sTo);
1443 OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set[1]/p:cBhvr/p:attrNameLst/p:attrName");
1444 CPPUNIT_ASSERT_EQUAL(OUString("fill.type"), sAttributeName);
1446 sTo = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set[2]/p:to/p:strVal", "val");
1447 CPPUNIT_ASSERT_EQUAL(OUString("true"), sTo);
1449 sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set[2]/p:cBhvr/p:attrNameLst/p:attrName");
1450 CPPUNIT_ASSERT_EQUAL(OUString("fill.on"), sAttributeName);
1452 sTo = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animClr/p:to/a:srgbClr", "val");
1453 CPPUNIT_ASSERT_EQUAL(OUString("0563c1"), sTo);
1455 sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animClr/p:cBhvr/p:attrNameLst/p:attrName");
1456 CPPUNIT_ASSERT_EQUAL(OUString("fillcolor"), sAttributeName);
1459 void SdOOXMLExportTest2::testTdf112552()
1461 // Background fill was not displayed, but it was because of the wrong geometry
1462 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf112552.odp"), ODP);
1463 utl::TempFile tempFile;
1464 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1466 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1467 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "w", "21600");
1468 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "h", "21600");
1469 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x", "21600");
1470 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y", "0");
1471 xDocShRef->DoClose();
1474 void SdOOXMLExportTest2::testTdf112557()
1476 // Subtitle shape should be skipped by export.
1477 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf112557.odp"), ODP);
1478 utl::TempFile tempFile;
1479 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1481 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
1482 assertXPath(pXmlDocContent, "/p:sldMaster/p:cSld/p:spTree/p:sp", 2); // title and object
1483 xDocShRef->DoClose();
1486 void SdOOXMLExportTest2::testTdf128049()
1488 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf128049.odp"), ODP);
1489 utl::TempFile tempFile;
1490 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1492 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1493 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom", 0);
1494 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:prstGeom", "prst", "noSmoking");
1495 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", "adj");
1496 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 12500");
1497 xDocShRef->DoClose();
1500 void SdOOXMLExportTest2::testTdf106026()
1502 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf106026.odp"), ODP);
1503 utl::TempFile tempFile;
1504 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1506 xmlDocUniquePtr pXmlMasterContent = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
1507 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:pPr/a:spcBef/a:spcPts", "val", "1417");
1508 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:pPr/a:spcBef/a:spcPts", "val", "1134");
1509 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[3]/a:pPr/a:spcBef/a:spcPts", "val", "850");
1510 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[4]/a:pPr/a:spcBef/a:spcPts", "val", "567");
1511 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[5]/a:pPr/a:spcBef/a:spcPts", "val", "283");
1512 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[6]/a:pPr/a:spcBef/a:spcPts", "val", "283");
1513 assertXPath(pXmlMasterContent, "/p:sldMaster/p:cSld/p:spTree/p:sp/p:txBody/a:p[7]/a:pPr/a:spcBef/a:spcPts", "val", "283");
1515 xmlDocUniquePtr pXmlSlideContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1516 assertXPath(pXmlSlideContent,
1517 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[1]/a:pPr/a:spcAft/a:spcPts", "val", "11339");
1518 assertXPath(pXmlSlideContent,
1519 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[2]/a:pPr/a:spcAft/a:spcPts", "val", "11339");
1520 assertXPath(pXmlSlideContent,
1521 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[3]/a:pPr/a:spcAft/a:spcPts", "val", "11339");
1522 xDocShRef->DoClose();
1525 void SdOOXMLExportTest2::testTdf112334()
1527 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112334.pptx"), PPTX);
1528 utl::TempFile tempFile;
1529 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1530 xDocShRef->DoClose();
1532 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1534 OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animClr[1]/p:cBhvr/p:attrNameLst/p:attrName");
1535 CPPUNIT_ASSERT_EQUAL(OUString("style.color"), sAttributeName);
1538 void SdOOXMLExportTest2::testTdf112089()
1540 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112089.pptx"), PPTX);
1541 utl::TempFile tempFile;
1542 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1543 xDocShRef->DoClose();
1545 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1547 OUString sID = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:cNvPr", "id");
1548 OUString sTarget = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt", "spid");
1549 CPPUNIT_ASSERT_EQUAL(sID, sTarget);
1552 void SdOOXMLExportTest2::testTdf112086()
1554 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112086.pptx"), PPTX);
1555 utl::TempFile tempFile;
1556 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1557 xDocShRef->DoClose();
1559 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1561 OUString sVal = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:tavLst/p:tav/p:val/p:fltVal", "val");
1562 CPPUNIT_ASSERT_EQUAL(OUString("0"), sVal);
1564 OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[1]/p:cBhvr/p:attrNameLst/p:attrName");
1565 CPPUNIT_ASSERT_EQUAL(OUString("ppt_w"), sAttributeName);
1567 sVal = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:tavLst/p:tav/p:val/p:fltVal", "val");
1568 CPPUNIT_ASSERT_EQUAL(OUString("0"), sVal);
1570 sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:cBhvr/p:attrNameLst/p:attrName");
1571 CPPUNIT_ASSERT_EQUAL(OUString("ppt_h"), sAttributeName);
1572 xDocShRef->DoClose();
1575 void SdOOXMLExportTest2::testTdf112647()
1577 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf112647.odp"), ODP);
1578 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
1579 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
1580 uno::Reference<text::XTextRange> xParagraph( getParagraphFromShape( 0, xShape ) );
1581 uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
1583 css::style::LineSpacing aLineSpacing;
1584 xPropSet->getPropertyValue("ParaLineSpacing") >>= aLineSpacing;
1585 CPPUNIT_ASSERT_EQUAL(sal_Int16(css::style::LineSpacingMode::FIX), aLineSpacing.Mode);
1586 CPPUNIT_ASSERT_EQUAL(sal_Int16(2117), aLineSpacing.Height);
1587 xDocShRef->DoClose();
1590 void SdOOXMLExportTest2::testGroupRotation()
1592 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/group_rotation.odp"), ODP);
1593 utl::TempFile tempFile;
1594 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1595 xDocShRef->DoClose();
1597 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1598 assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:grpSpPr/a:xfrm", "rot");
1599 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[1]/p:spPr/a:xfrm", "rot", "20400000");
1600 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[2]/p:spPr/a:xfrm", "rot", "20400000");
1603 void SdOOXMLExportTest2::testTdf104788()
1605 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104788.pptx"), PPTX);
1606 utl::TempFile tempFile;
1607 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1608 xDocShRef->DoClose();
1610 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide6.xml");
1612 OUString sVal = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]", "to");
1613 CPPUNIT_ASSERT_EQUAL(-1.0, sVal.toDouble());
1615 OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par[2]/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:cBhvr/p:attrNameLst/p:attrName");
1616 CPPUNIT_ASSERT_EQUAL(OUString("xshear"), sAttributeName);
1617 xDocShRef->DoClose();
1620 void SdOOXMLExportTest2::testSmartartRotation2()
1622 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-rotation2.pptx"), PPTX);
1624 // clear SmartArt data to check how group shapes with double-rotated children are exported, not smartart
1625 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
1626 uno::Sequence<beans::PropertyValue> aInteropGrabBag;
1627 xShape->setPropertyValue("InteropGrabBag", uno::makeAny(aInteropGrabBag));
1629 utl::TempFile tempFile;
1630 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1631 xDocShRef->DoClose();
1633 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1634 assertXPathContent(pXmlDocContent,
1635 "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[4]/p:txBody/a:p/a:r/a:t", "Text");
1636 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[4]/p:txBody/a:bodyPr", "rot", "10800000");
1637 double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[4]/p:spPr/a:xfrm/a:off", "x").toDouble();
1638 double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[4]/p:spPr/a:xfrm/a:off", "y").toDouble();
1639 CPPUNIT_ASSERT_DOUBLES_EQUAL( 2276280.0, dX, dX * .001);
1640 CPPUNIT_ASSERT_DOUBLES_EQUAL( 3158280.0, dY, dY * .001);
1643 void SdOOXMLExportTest2::testTdf91999_rotateShape()
1645 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf91999_rotateShape.pptx"), PPTX);
1646 utl::TempFile tempFile;
1647 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1648 xDocShRef->DoClose();
1650 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1651 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr", "name", "CustomShape 2");
1652 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:xfrm", "rot", "10800000");
1653 double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:xfrm/a:off", "x").toDouble();
1654 double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:xfrm/a:off", "y").toDouble();
1655 CPPUNIT_ASSERT_DOUBLES_EQUAL( 2960640.0, dX, dX * .001);
1656 CPPUNIT_ASSERT_DOUBLES_EQUAL( 1449000.0, dY, dY * .001);
1659 void SdOOXMLExportTest2::testTdf114845_rotateShape()
1661 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114845_rotateShape.pptx"), PPTX);
1662 utl::TempFile tempFile;
1663 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1664 xDocShRef->DoClose();
1666 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1667 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr", "name", "Straight Arrow Connector 9");
1668 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm", "flipV", "1");
1669 double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "x").toDouble();
1670 double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "y").toDouble();
1671 CPPUNIT_ASSERT_DOUBLES_EQUAL( 4059000.0, dX, dX * .001);
1672 CPPUNIT_ASSERT_DOUBLES_EQUAL( 3287520.0, dY, dY * .001);
1675 void SdOOXMLExportTest2::testGroupsPosition()
1677 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/group.pptx"), PPTX);
1678 utl::TempFile tempFile;
1679 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1680 xDocShRef->DoClose();
1682 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1683 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp[1]/p:sp[1]/p:spPr/a:xfrm/a:off", "x", "5004000");
1684 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp[1]/p:sp[1]/p:spPr/a:xfrm/a:off", "y", "3310560");
1685 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp[1]/p:sp[3]/p:spPr/a:xfrm/a:off", "x", "7760160");
1686 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp[1]/p:sp[3]/p:spPr/a:xfrm/a:off", "y", "3310560");
1689 void SdOOXMLExportTest2::testGroupsRotatedPosition()
1691 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/group-rot.pptx"), PPTX);
1692 utl::TempFile tempFile;
1693 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1694 xDocShRef->DoClose();
1696 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1697 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:spPr/a:xfrm/a:off", "x", "2857320");
1698 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:spPr/a:xfrm/a:off", "y", "4026960");
1701 void SdOOXMLExportTest2::testAccentColor()
1703 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/accent-color.pptx"), PPTX);
1704 utl::TempFile tempFile;
1705 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1706 xDocShRef->DoClose();
1708 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
1709 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp/p:style/a:fillRef/a:schemeClr", "val", "accent6");
1710 xmlDocUniquePtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
1711 assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp/p:style/a:fillRef/a:schemeClr", "val", "accent6");
1712 xmlDocUniquePtr pXmlDocTheme1 = parseExport(tempFile, "ppt/theme/theme1.xml");
1713 assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "70ad47");
1714 xmlDocUniquePtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
1715 assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
1718 void SdOOXMLExportTest2::testThemeColors()
1720 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf84205.pptx"), PPTX);
1721 utl::TempFile tempFile;
1722 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1723 xDocShRef->DoClose();
1725 xmlDocUniquePtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
1726 assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a");
1727 assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", "a5a5a5");
1730 void SdOOXMLExportTest2::testTdf114848()
1732 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
1733 utl::TempFile tempFile;
1734 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1735 xDocShRef->DoClose();
1737 xmlDocUniquePtr pXmlDocTheme1 = parseExport(tempFile, "ppt/theme/theme1.xml");
1738 assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
1739 xmlDocUniquePtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
1740 assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
1743 void SdOOXMLExportTest2::testTdf68759()
1745 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf68759.odp"), ODP);
1746 utl::TempFile tempFile;
1747 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1748 xDocShRef->DoClose();
1750 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1751 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[1]/p:spPr/a:xfrm/a:off", "x", "1687320");
1752 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[1]/p:spPr/a:xfrm/a:off", "y", "1615320");
1753 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[2]/p:spPr/a:xfrm", "flipH", "1");
1754 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[2]/p:spPr/a:xfrm", "rot", "9600000");
1755 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[2]/p:spPr/a:xfrm/a:off", "x", "3847320");
1756 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[2]/p:spPr/a:xfrm/a:off", "y", "1614600");
1757 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm", "flipH", "1");
1758 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm/a:off", "x", "5934960");
1759 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm/a:off", "y", "1615320");
1763 void SdOOXMLExportTest2::testTdf127901()
1765 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf127901.odp"), ODP);
1766 utl::TempFile tempFile;
1767 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1768 xDocShRef->DoClose();
1770 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
1771 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:lum", "bright", "70000");
1772 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:lum", "contrast", "-70000");
1774 xmlDocUniquePtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
1775 assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:grayscl", 1);
1777 xmlDocUniquePtr pXmlDocContent3 = parseExport(tempFile, "ppt/slides/slide3.xml");
1778 assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:biLevel", "thresh", "50000");
1782 void SdOOXMLExportTest2::testTdf48735()
1784 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf48735.odp"), ODP);
1785 utl::TempFile tempFile;
1786 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1787 xDocShRef->DoClose();
1789 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
1790 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:srcRect", "b", "23627");
1791 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:srcRect", "l", "23627");
1792 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:srcRect", "r", "23627");
1793 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:srcRect", "t", "18842");
1796 void SdOOXMLExportTest2::testTdf90626()
1798 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf90626.odp"), ODP);
1799 utl::TempFile tempFile;
1800 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1801 xDocShRef->DoClose();
1803 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1804 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[1]/a:pPr/a:buSzPct", "val", "100000");
1805 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[2]/a:pPr/a:buSzPct", "val", "150568");
1806 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[3]/a:pPr/a:buSzPct", "val", "100000");
1807 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[4]/a:pPr/a:buSzPct", "val", "150568");
1810 void SdOOXMLExportTest2::testTdf107608()
1812 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf107608.pptx"), PPTX);
1813 utl::TempFile tempFile;
1814 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1816 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
1817 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
1819 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
1820 xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
1821 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_HATCH, aFillStyle);
1823 bool bBackgroundFill = false;
1824 xPropSet->getPropertyValue("FillBackground") >>= bBackgroundFill;
1825 CPPUNIT_ASSERT(bBackgroundFill);
1827 sal_Int32 nBackgroundColor;
1828 xPropSet->getPropertyValue("FillColor") >>= nBackgroundColor;
1829 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x92D050), nBackgroundColor);
1831 xDocShRef->DoClose();
1834 void SdOOXMLExportTest2::testTdf111786()
1836 // Export line transparency with the color
1837 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf111786.pptx"), PPTX);
1838 utl::TempFile tempFile;
1839 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1841 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
1842 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
1844 sal_uInt32 nLineColor;
1845 xPropSet->getPropertyValue("LineColor") >>= nLineColor;
1846 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x3465A4), nLineColor);
1848 sal_Int16 nTransparency;
1849 xPropSet->getPropertyValue("LineTransparence") >>= nTransparency;
1850 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(33), nTransparency);
1852 xDocShRef->DoClose();
1855 void SdOOXMLExportTest2::testFontScale()
1857 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/font-scale.pptx"), PPTX);
1858 utl::TempFile tempFile;
1859 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1860 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1862 // Rounding errors possible, approximate value
1863 OUString sScale = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:normAutofit", "fontScale");
1864 if (sScale != "73000" && sScale != "72000" && sScale != "74000")
1865 CPPUNIT_ASSERT_EQUAL(OUString("73000"), sScale);
1867 xDocShRef->DoClose();
1870 void SdOOXMLExportTest2::testShapeAutofitPPTX()
1872 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/testShapeAutofit.pptx"), PPTX);
1873 utl::TempFile tempFile;
1874 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1875 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1876 CPPUNIT_ASSERT(pXmlDocContent);
1878 // TextAutoGrowHeight --> "Resize shape to fit text" --> true
1879 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr/a:spAutoFit", 1);
1880 // TextAutoGrowHeight --> "Resize shape to fit text" --> false
1881 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr/a:noAutofit", 1);
1884 void SdOOXMLExportTest2::testLegacyShapeAutofitPPTX()
1886 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp"), ODP);
1887 utl::TempFile tempFile;
1888 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1889 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
1890 CPPUNIT_ASSERT(pXmlDocContent);
1892 // Text in a legacy rectangle
1893 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr/a:noAutofit", 1);
1894 // Text in (closed) Polygon
1895 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr/a:noAutofit", 1);
1896 // Text in a legacy ellipse
1897 assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:txBody/a:bodyPr/a:noAutofit", 1);
1900 void SdOOXMLExportTest2::testTdf115394()
1902 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394.pptx"), PPTX);
1903 utl::TempFile tempFile;
1904 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1905 double fTransitionDuration;
1907 // Slow in MS formats
1908 SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
1909 fTransitionDuration = pPage1->getTransitionDuration();
1910 CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
1912 // Medium in MS formats
1913 SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
1914 fTransitionDuration = pPage2->getTransitionDuration();
1915 CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
1917 // Fast in MS formats
1918 SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
1919 fTransitionDuration = pPage3->getTransitionDuration();
1920 CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
1922 // Custom values
1923 SdPage* pPage4 = xDocShRef->GetDoc()->GetSdPage(3, PageKind::Standard);
1924 fTransitionDuration = pPage4->getTransitionDuration();
1925 CPPUNIT_ASSERT_EQUAL(0.25, fTransitionDuration);
1927 SdPage* pPage5 = xDocShRef->GetDoc()->GetSdPage(4, PageKind::Standard);
1928 fTransitionDuration = pPage5->getTransitionDuration();
1929 CPPUNIT_ASSERT_EQUAL(4.25, fTransitionDuration);
1931 xDocShRef->DoClose();
1934 void SdOOXMLExportTest2::testTdf115394Zero()
1936 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394-zero.pptx"), PPTX);
1937 utl::TempFile tempFile;
1938 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
1939 double fTransitionDuration;
1941 SdPage* pPage = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
1942 fTransitionDuration = pPage->getTransitionDuration();
1943 CPPUNIT_ASSERT_EQUAL(0.01, fTransitionDuration);
1945 xDocShRef->DoClose();
1948 void SdOOXMLExportTest2::testTdf115005()
1950 sd::DrawDocShellRef xDocShRefOriginal = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf115005.odp"), ODP);
1951 utl::TempFile tempFile;
1952 sd::DrawDocShellRef xDocShRefResaved = saveAndReload(xDocShRefOriginal.get(), ODP, &tempFile);
1954 // additional checks of the output file
1955 uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
1957 // check that the document contains original vector images
1958 const uno::Sequence<OUString> names = xNameAccess->getElementNames();
1959 int nSVMFiles = 0;
1960 for (OUString const & s : names)
1962 if(s.endsWith(".svm"))
1963 nSVMFiles++;
1965 CPPUNIT_ASSERT_EQUAL(3, nSVMFiles);
1968 int SdOOXMLExportTest2::testTdf115005_FallBack_Images(bool bAddReplacementImages)
1970 sd::DrawDocShellRef xDocShRefOriginal = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf115005_no_fallback_images.odp"), ODP);
1972 // check if fallback images were not created if AddReplacementImages=true/false
1973 // set AddReplacementImages
1975 std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() );
1976 if ( !officecfg::Office::Common::Save::Graphic::AddReplacementImages::isReadOnly() )
1977 officecfg::Office::Common::Save::Graphic::AddReplacementImages::set(bAddReplacementImages, batch);
1978 batch->commit();
1981 // save the file with already set options
1982 utl::TempFile tempFile;
1983 sd::DrawDocShellRef xDocShRefResaved = saveAndReload(xDocShRefOriginal.get(), ODP, &tempFile);
1985 // additional checks of the output file
1986 uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
1988 // check that the document contains original vector images
1989 const uno::Sequence<OUString> names = xNameAccess->getElementNames();
1990 int nSVMFiles = 0;
1991 int nPNGFiles = 0;
1992 for (OUString const & n :names)
1994 if(n.endsWith(".svm"))
1995 nSVMFiles++;
1996 if(n.endsWith(".png"))
1997 nPNGFiles++;
2000 // check results
2001 CPPUNIT_ASSERT_EQUAL(1, nSVMFiles);
2002 return nPNGFiles;
2005 void SdOOXMLExportTest2::testTdf115005_FallBack_Images_On()
2007 const int nPNGFiles = testTdf115005_FallBack_Images(true);
2008 CPPUNIT_ASSERT_EQUAL(1, nPNGFiles);
2011 void SdOOXMLExportTest2::testTdf115005_FallBack_Images_Off()
2013 const int nPNGFiles = testTdf115005_FallBack_Images(false);
2014 CPPUNIT_ASSERT_EQUAL(0, nPNGFiles);
2017 void SdOOXMLExportTest2::testTdf118806()
2019 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118806.odp"), ODP);
2020 utl::TempFile tempFile;
2021 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2023 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2024 assertXPath(pXmlDocContent, "//p:animMotion", "origin", "layout");
2026 xDocShRef->DoClose();
2029 void SdOOXMLExportTest2::testTdf111789()
2031 // Shadow properties were not exported for text shapes.
2032 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf111789.pptx"), PPTX);
2033 utl::TempFile tempFile;
2034 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2036 // First text shape has some shadow
2038 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2039 bool bHasShadow = false;
2040 xShape->getPropertyValue("Shadow") >>= bHasShadow;
2041 CPPUNIT_ASSERT(bHasShadow);
2042 double fShadowDist = 0.0;
2043 xShape->getPropertyValue("ShadowXDistance") >>= fShadowDist;
2044 CPPUNIT_ASSERT_EQUAL(static_cast<double>(273), fShadowDist);
2045 xShape->getPropertyValue("ShadowYDistance") >>= fShadowDist;
2046 CPPUNIT_ASSERT_EQUAL(static_cast<double>(273), fShadowDist);
2047 sal_Int32 nColor = 0;
2048 xShape->getPropertyValue("ShadowColor") >>= nColor;
2049 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xFF0000), nColor);
2050 sal_Int32 nTransparency = 0;
2051 xShape->getPropertyValue("ShadowTransparence") >>= nTransparency;
2052 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7), nTransparency);
2055 // Second text shape has no shadow
2057 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 1, 0, xDocShRef ) );
2058 bool bHasShadow = false;
2059 xShape->getPropertyValue("Shadow") >>= bHasShadow;
2060 CPPUNIT_ASSERT(!bHasShadow);
2063 xDocShRef->DoClose();
2066 void SdOOXMLExportTest2::testTdf104792()
2068 ::sd::DrawDocShellRef xDocShRef = loadURL(
2069 m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx"), PPTX);
2070 utl::TempFile tempFile;
2071 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2073 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2074 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[1]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:set/p:cBhvr/p:tgtEl/p:spTgt", 1);
2076 xDocShRef->DoClose();
2079 void SdOOXMLExportTest2::testTdf90627()
2081 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf90627.odp"), ODP);
2082 utl::TempFile tempFile;
2083 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2085 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2086 // Don't export empty endCondLst without cond.
2087 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:endCondLst[not(*)]", 0);
2089 xDocShRef->DoClose();
2092 void SdOOXMLExportTest2::testTdf104786()
2094 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104786.pptx"), PPTX);
2095 utl::TempFile tempFile;
2096 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2098 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide2.xml");
2099 // Don't export empty 'to'
2100 assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst/p:set[2]/p:to", 0);
2102 xDocShRef->DoClose();
2105 void SdOOXMLExportTest2::testTdf118783()
2107 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118783.odp"), ODP);
2108 utl::TempFile tempFile;
2109 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2110 xDocShRef->DoClose();
2112 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2113 OUString sAttributeName = getXPathContent(pXmlDocContent, "//p:animRot/p:cBhvr/p:attrNameLst/p:attrName");
2114 CPPUNIT_ASSERT_EQUAL(OUString("r"), sAttributeName);
2115 xDocShRef->DoClose();
2118 void SdOOXMLExportTest2::testTdf104789()
2120 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), PPTX);
2121 utl::TempFile tempFile;
2122 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2124 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2125 OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:attrNameLst/p:attrName");
2126 CPPUNIT_ASSERT_EQUAL(OUString("style.opacity"), sAttributeName);
2128 xDocShRef->DoClose();
2131 void SdOOXMLExportTest2::testOpenDocumentAsReadOnly()
2133 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/open-as-read-only.pptx"), PPTX);
2134 CPPUNIT_ASSERT(xDocShRef->IsSecurityOptOpenReadOnly());
2135 utl::TempFile tempFile;
2136 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2137 CPPUNIT_ASSERT(xDocShRef->IsSecurityOptOpenReadOnly());
2138 xDocShRef->DoClose();
2141 void SdOOXMLExportTest2::testTdf118835()
2143 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118835.odp"), ODP);
2144 utl::TempFile tempFile;
2145 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2147 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2148 assertXPath(pXmlDocContent, "(//p:animClr)[1]", "clrSpc", "rgb");
2149 assertXPathContent(pXmlDocContent, "(//p:animClr)[1]//p:attrName", "style.color");
2150 assertXPath(pXmlDocContent, "(//p:animClr)[1]//p:to/a:srgbClr", "val", "ed1c24");
2152 assertXPath(pXmlDocContent, "(//p:animClr)[2]", "clrSpc", "rgb");
2153 assertXPathContent(pXmlDocContent, "(//p:animClr)[2]//p:attrName", "stroke.color");
2154 assertXPath(pXmlDocContent, "(//p:animClr)[2]//p:to/a:srgbClr", "val", "333399");
2156 assertXPath(pXmlDocContent, "(//p:animClr)[3]", "clrSpc", "rgb");
2157 assertXPathContent(pXmlDocContent, "(//p:animClr)[3]//p:attrName", "fillcolor");
2158 assertXPath(pXmlDocContent, "(//p:animClr)[3]//p:to/a:srgbClr", "val", "fcd3c1");
2160 assertXPath(pXmlDocContent, "(//p:animClr)[5]", "clrSpc", "hsl");
2161 assertXPathContent(pXmlDocContent, "(//p:animClr)[5]//p:attrName", "fillcolor");
2162 assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "h", "10800000");
2163 assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "s", "0");
2164 assertXPath(pXmlDocContent, "(//p:animClr)[5]//p:by/p:hsl", "l", "0");
2166 xDocShRef->DoClose();
2169 void SdOOXMLExportTest2::testTdf118768()
2171 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118768-brake.odp"), ODP);
2172 utl::TempFile tempFile;
2173 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2175 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2176 assertXPath(pXmlDocContent, "//p:anim[1]", "from", "(-#ppt_w/2)");
2177 assertXPath(pXmlDocContent, "//p:anim[1]", "to", "(#ppt_x)");
2178 assertXPath(pXmlDocContent, "//p:anim[2]", "from", "0");
2180 assertXPath(pXmlDocContent, "//p:anim[2]", "to", "-1");
2181 assertXPath(pXmlDocContent, "//p:anim[2]/p:cBhvr/p:cTn", "autoRev", "1");
2183 assertXPath(pXmlDocContent, "//p:anim[3]", "by", "(#ppt_h/3+#ppt_w*0.1)");
2184 assertXPath(pXmlDocContent, "//p:anim[3]/p:cBhvr/p:cTn", "autoRev", "1");
2185 xDocShRef->DoClose();
2188 void SdOOXMLExportTest2::testTdf118836()
2190 sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118836.odp"), ODP);
2191 utl::TempFile tempFile;
2192 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2194 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2195 assertXPath(pXmlDocContent, "//p:animScale/p:by", "x", "250000");
2196 assertXPath(pXmlDocContent, "//p:animScale/p:by", "y", "250000");
2197 xDocShRef->DoClose();
2200 static double getAdjustmentValue( const uno::Reference<beans::XPropertySet>& xSet )
2202 auto aGeomPropSeq = xSet->getPropertyValue( "CustomShapeGeometry" )
2203 .get<uno::Sequence<beans::PropertyValue>>();
2204 auto aGeomPropVec
2205 = comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>(
2206 aGeomPropSeq );
2208 const OUString sName = "AdjustmentValues";
2209 auto aIterator = std::find_if(
2210 aGeomPropVec.begin(), aGeomPropVec.end(),
2211 [sName]( const beans::PropertyValue& rValue ) { return rValue.Name == sName; } );
2213 if (aIterator != aGeomPropVec.end())
2215 uno::Sequence<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustment;
2216 double fResult = 0.0;
2217 aIterator->Value >>= aAdjustment;
2218 aAdjustment[0].Value >>= fResult;
2219 return fResult;
2222 return -1.0;
2225 static bool getScaleXValue(const uno::Reference<beans::XPropertySet>& xSet)
2227 bool bScaleX = false;
2229 auto aGeomPropSeq = xSet->getPropertyValue("CustomShapeGeometry")
2230 .get<uno::Sequence<beans::PropertyValue>>();
2231 auto aGeomPropVec
2232 = comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>(
2233 aGeomPropSeq);
2235 const OUString sName = "TextPath";
2236 auto aIterator = std::find_if(
2237 aGeomPropVec.begin(), aGeomPropVec.end(),
2238 [sName](const beans::PropertyValue& rValue) { return rValue.Name == sName; });
2240 if (aIterator != aGeomPropVec.end())
2242 uno::Sequence<beans::PropertyValue> aTextPathProperties;
2243 aIterator->Value >>= aTextPathProperties;
2244 const OUString sScaleX = "ScaleX";
2245 auto aIterator2 = std::find_if(
2246 aTextPathProperties.begin(), aTextPathProperties.end(),
2247 [sScaleX](const beans::PropertyValue& rValue) { return rValue.Name == sScaleX; });
2249 if (aIterator2 != aTextPathProperties.end())
2251 aIterator2->Value >>= bScaleX;
2255 return bScaleX;
2258 void SdOOXMLExportTest2::testTdf116350TextEffects()
2260 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf116350-texteffects.pptx" ), PPTX );
2262 // Default angle for ArchUp
2263 uno::Reference<beans::XPropertySet> xShape0( getShapeFromPage( 0, 0, xDocShRef ) );
2264 double fAdjust = getAdjustmentValue( xShape0 );
2265 CPPUNIT_ASSERT_EQUAL( 180.0, fAdjust );
2267 bool bScaleX = getScaleXValue( xShape0 );
2268 CPPUNIT_ASSERT_EQUAL( true, bScaleX );
2270 // Default angle for ArchDown
2271 uno::Reference<beans::XPropertySet> xShape14( getShapeFromPage( 14, 0, xDocShRef ) );
2272 fAdjust = getAdjustmentValue( xShape14 );
2273 CPPUNIT_ASSERT_EQUAL( 0.0, fAdjust );
2275 bScaleX = getScaleXValue( xShape14 );
2276 CPPUNIT_ASSERT_EQUAL( true, bScaleX );
2278 // Angle directly set
2279 uno::Reference<beans::XPropertySet> xShape1( getShapeFromPage( 1, 0, xDocShRef ) );
2280 fAdjust = getAdjustmentValue( xShape1 );
2281 CPPUNIT_ASSERT_EQUAL( 213.25, fAdjust );
2283 bScaleX = getScaleXValue( xShape1 );
2284 CPPUNIT_ASSERT_EQUAL( true, bScaleX );
2286 // Export
2287 utl::TempFile tempFile;
2288 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
2290 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2291 assertXPath(pXmlDocContent, "//p:sp[1]/p:txBody/a:bodyPr/a:prstTxWarp", "prst", "textArchUp");
2292 assertXPath(pXmlDocContent, "//p:sp[14]/p:txBody/a:bodyPr/a:prstTxWarp", "prst", "textCircle");
2293 assertXPath(pXmlDocContent, "//p:sp[14]/p:spPr/a:solidFill/a:srgbClr", 0);
2295 xDocShRef->DoClose();
2298 void SdOOXMLExportTest2::testTdf128096()
2300 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf128096.odp"), ODP);
2301 utl::TempFile tempFile;
2302 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2303 xDocShRef->DoClose();
2305 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
2306 assertXPath(pXmlDocContent1, "//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:highlight/a:srgbClr", "val", "ffff00");
2308 // Check that underlined content is also highlighted
2309 xmlDocUniquePtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
2310 assertXPath(pXmlDocContent2, "//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:highlight/a:srgbClr", "val", "ffff00");
2312 void SdOOXMLExportTest2::testTdf120573()
2314 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf120573.pptx" ), PPTX );
2315 utl::TempFile tempFile;
2316 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
2318 xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
2319 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:audioFile", 1);
2320 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:videoFile", 0);
2322 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
2323 assertXPath(pXmlDocRels,
2324 "(/rels:Relationships/rels:Relationship[@Target='../media/media1.wav'])[1]",
2325 "Type",
2326 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio");
2328 xmlDocUniquePtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
2329 assertXPath(pXmlContentType,
2330 "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/media1.wav']",
2331 "ContentType",
2332 "audio/x-wav");
2335 void SdOOXMLExportTest2::testTdf118825()
2337 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118825-motionpath.odp"), ODP);
2338 utl::TempFile tempFile;
2339 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2340 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2343 CPPUNIT_ASSERT_MOTIONPATH("M 0.0449285714285714 0.00368253968253968 C 0.0575714285714285 -0.00095238095238096 0.0704264795523803 -0.00370117418637049 0.0831071428571428 -0.00819047619047622 C 0.0953550597998766 -0.0125265741339082 0.107821870086751 -0.010397536991717 0.120321428571429 -0.0115555555555556 C 0.133179018681433 -0.0127467438724762 0.151318627483861 -0.0158700272533852 0.1585 0.00539682539682542 C 0.16478291361998 0.0240029898688431 0.15828642886492 0.0483806254341085 0.161392857142857 0.0698412698412698 C 0.165179286017685 0.0959996731216037 0.17453898927982 0.119735912694626 0.187142857142857 0.132634920634921 C 0.199788991845377 0.145577185161529 0.215607110490848 0.142889773028431 0.230107142857143 0.142857142857143 C 0.243821417584191 0.142826280916829 0.257716514999779 0.142685979556724 0.271142857142857 0.137777777777778 C 0.286895094567923 0.132019309914514 0.302318190711873 0.122962218306185 0.317928571428571 0.11568253968254 C 0.333496771884547 0.108422531222479 0.348787823719556 0.0990570571890929 0.363714285714286 0.0885079365079364 C 0.374930683062651 0.080580865157908 0.385357142857143 0.0693333333333332 0.396178571428571 0.0596825396825396 L 0.404785714285714 0.0410158730158729 L 0.401892857142857 0.0342222222222221 E", getXPath(pXmlDocContent, "(//p:animMotion)[1]", "path"));
2344 CPPUNIT_ASSERT_MOTIONPATH("M 0.025 0.0571428571428571 L 0.0821428571428571 0.184126984126984 L -0.175 0.234920634920635 L -0.246428571428571 -0.0190476190476191 L -0.0821428571428573 -0.133333333333333 E", getXPath(pXmlDocContent, "(//p:animMotion)[2]", "path"));
2345 CPPUNIT_ASSERT_MOTIONPATH("M -0.0107142857142857 0.00634920634920635 C -0.110714285714286 0.501587301587301 -0.153571428571429 -0.00634920634920635 -0.246428571428572 0.184126984126984 C -0.339285714285715 0.374603174603175 -0.296428571428572 0.514285714285714 -0.267857142857143 0.603174603174603 C -0.239285714285715 0.692063492063492 0.0607142857142858 0.590476190476191 0.0607142857142858 0.590476190476191 E", getXPath(pXmlDocContent, "(//p:animMotion)[3]", "path"));
2346 CPPUNIT_ASSERT_MOTIONPATH("M 0.0535714285714286 -0.0444444444444444 L 0.132142857142857 -0.0444444444444444 L 0.132142857142857 -0.146031746031746 L 0.0964285714285715 -0.146031746031746 E", getXPath(pXmlDocContent, "(//p:animMotion)[4]", "path"));
2347 xDocShRef->DoClose();
2350 void SdOOXMLExportTest2::testTdf119118()
2352 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf119118.pptx" ), PPTX);
2353 utl::TempFile tempFile;
2354 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2355 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2356 assertXPath(pXmlDocContent, "//p:iterate", "type", "lt");
2357 assertXPath(pXmlDocContent, "//p:tmAbs", "val", "200");
2358 xDocShRef->DoClose();
2361 void SdOOXMLExportTest2::testTdf99213()
2363 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc( "sd/qa/unit/data/odp/tdf99213-target-missing.odp" ), ODP);
2364 utl::TempFile tempFile;
2365 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2366 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2367 // Number of nodes with p:attrNameLst was 3, including one that missed tgtEl
2368 assertXPath(pXmlDocContent, "//p:attrNameLst", 2);
2369 // Timenode that miss its target element should be filtered.
2370 assertXPath(pXmlDocContent, "//p:attrNameLst/preceding-sibling::p:tgtEl", 2);
2371 xDocShRef->DoClose();
2374 void SdOOXMLExportTest2::testPotxExport()
2376 // Create new document
2377 sd::DrawDocShellRef xDocShRef
2378 = new sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Draw);
2379 uno::Reference<frame::XLoadable> xLoadable(xDocShRef->GetModel(), uno::UNO_QUERY);
2380 CPPUNIT_ASSERT(xLoadable.is());
2381 xLoadable->initNew();
2383 // Export as a POTM template
2384 utl::TempFile tempFile;
2385 xDocShRef = saveAndReload(xDocShRef.get(), POTX, &tempFile);
2386 xDocShRef->DoClose();
2388 // Load and check content type
2389 xmlDocUniquePtr pContentTypes = parseExport(tempFile, "[Content_Types].xml");
2390 CPPUNIT_ASSERT(pContentTypes);
2391 assertXPath(pContentTypes, "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']",
2392 "ContentType", "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml");
2395 void SdOOXMLExportTest2::testTdf44223()
2397 utl::TempFile tempFile;
2398 ::sd::DrawDocShellRef xDocShRef
2399 = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), PPTX);
2400 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2402 std::unique_ptr<SvStream> const pStream1(parseExportStream(tempFile, "ppt/media/audio1.wav"));
2403 CPPUNIT_ASSERT_EQUAL(sal_uInt64(11140), pStream1->remainingSize());
2405 std::unique_ptr<SvStream> const pStream2(parseExportStream(tempFile, "ppt/media/audio2.wav"));
2406 CPPUNIT_ASSERT_EQUAL(sal_uInt64(28074), pStream2->remainingSize());
2408 xmlDocUniquePtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
2409 assertXPath(pXmlContentType,
2410 "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/audio1.wav']",
2411 "ContentType",
2412 "audio/x-wav");
2414 assertXPath(pXmlContentType,
2415 "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/audio2.wav']",
2416 "ContentType",
2417 "audio/x-wav");
2419 xmlDocUniquePtr pDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml");
2421 // Start condition: 0s after timenode id 5 begins.
2422 assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", "evt", "begin");
2423 assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond", "delay", "0");
2424 assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:cTn/p:stCondLst/p:cond/p:tn", "val", "5");
2426 xmlDocUniquePtr pDoc2 = parseExport(tempFile, "ppt/slides/slide2.xml");
2427 assertXPath(pDoc2 , "//p:transition/p:sndAc/p:stSnd/p:snd[@r:embed]", 2);
2429 xmlDocUniquePtr pRels1 = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
2430 assertXPath(pRels1, "//rels:Relationship[@Id='rId1']", "Type",
2431 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio");
2432 assertXPath(pRels1, "//rels:Relationship[@Id='rId1']", "Target", "../media/audio1.wav");
2434 xDocShRef->DoClose();
2437 void SdOOXMLExportTest2::testSmartArtPreserve()
2439 ::sd::DrawDocShellRef xDocShRef
2440 = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/smartart-preserve.pptx"), PPTX);
2441 utl::TempFile tempFile;
2442 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2444 xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
2445 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:cNvPr");
2446 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/dgm:relIds");
2447 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:nvPr/p:extLst/p:ext",
2448 "uri", "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}");
2449 assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:nvPr/p:extLst/p:ext/p14:modId");
2451 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
2452 assertXPath(pXmlDocRels,
2453 "(/rels:Relationships/rels:Relationship[@Target='../diagrams/layout1.xml'])[1]", "Type",
2454 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout");
2455 assertXPath(pXmlDocRels,
2456 "(/rels:Relationships/rels:Relationship[@Target='../diagrams/data1.xml'])[1]", "Type",
2457 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData");
2458 assertXPath(pXmlDocRels,
2459 "(/rels:Relationships/rels:Relationship[@Target='../diagrams/colors1.xml'])[1]", "Type",
2460 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors");
2461 assertXPath(pXmlDocRels,
2462 "(/rels:Relationships/rels:Relationship[@Target='../diagrams/quickStyle1.xml'])[1]", "Type",
2463 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle");
2465 xmlDocUniquePtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml");
2466 assertXPath(pXmlContentType,
2467 "/ContentType:Types/ContentType:Override[@PartName='/ppt/diagrams/layout1.xml']",
2468 "ContentType", "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml");
2469 assertXPath(pXmlContentType,
2470 "/ContentType:Types/ContentType:Override[@PartName='/ppt/diagrams/data1.xml']",
2471 "ContentType", "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml");
2472 assertXPath(pXmlContentType,
2473 "/ContentType:Types/ContentType:Override[@PartName='/ppt/diagrams/colors1.xml']",
2474 "ContentType", "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml");
2475 assertXPath(pXmlContentType,
2476 "/ContentType:Types/ContentType:Override[@PartName='/ppt/diagrams/quickStyle1.xml']",
2477 "ContentType", "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml");
2479 xDocShRef->DoClose();
2482 void SdOOXMLExportTest2::testTdf125346()
2484 // There are two themes in the test document, make sure we use the right theme
2485 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125346.pptx"), PPTX);
2486 utl::TempFile tempFile;
2487 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2489 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2490 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
2492 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
2493 xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
2494 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
2496 sal_Int32 nFillColor;
2497 xPropSet->getPropertyValue("FillColor") >>= nFillColor;
2498 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
2500 xDocShRef->DoClose();
2503 void SdOOXMLExportTest2::testTdf125346_2()
2505 // There are two themes in the test document, make sure we use the right theme
2506 // Test more slides with different themes
2507 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125346_2.pptx"), PPTX);
2508 utl::TempFile tempFile;
2509 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2512 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2513 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
2515 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
2516 xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
2517 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
2519 sal_Int32 nFillColor;
2520 xPropSet->getPropertyValue("FillColor") >>= nFillColor;
2521 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
2525 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 1, xDocShRef ) );
2526 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
2528 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
2529 xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
2530 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
2532 sal_Int32 nFillColor;
2533 xPropSet->getPropertyValue("FillColor") >>= nFillColor;
2534 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x052F61), nFillColor);
2538 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 2, xDocShRef ) );
2539 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW );
2541 drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
2542 xPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
2543 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle);
2545 sal_Int32 nFillColor;
2546 xPropSet->getPropertyValue("FillColor") >>= nFillColor;
2547 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor);
2550 xDocShRef->DoClose();
2553 void SdOOXMLExportTest2::testTdf125360()
2555 // Check whether the changed fill transparency is exported correctly.
2556 // Color is defined by shape style
2557 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360.pptx"), PPTX);
2559 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2561 xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23)));
2563 utl::TempFile tempFile;
2564 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2566 xShape.set( getShapeFromPage( 0, 0, xDocShRef ) );
2568 sal_Int32 nTransparence = 0;
2569 xShape->getPropertyValue("FillTransparence") >>= nTransparence;
2570 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence);
2572 xDocShRef->DoClose();
2575 void SdOOXMLExportTest2::testTdf125360_1()
2577 // Check whether the changed fill transparency is exported correctly.
2578 // Color is defined by color scheme
2579 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360_1.pptx"), PPTX);
2581 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2583 xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23)));
2585 utl::TempFile tempFile;
2586 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2588 xShape.set( getShapeFromPage( 0, 0, xDocShRef ) );
2590 sal_Int32 nTransparence = 0;
2591 xShape->getPropertyValue("FillTransparence") >>= nTransparence;
2592 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence);
2594 xDocShRef->DoClose();
2597 void SdOOXMLExportTest2::testTdf125360_2()
2599 // Check whether the changed fill transparency is exported correctly.
2600 // Color is defined by color scheme with a transparency
2601 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360_2.pptx"), PPTX);
2603 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2605 sal_Int32 nTransparence = 0;
2606 xShape->getPropertyValue("FillTransparence") >>= nTransparence;
2607 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(82), nTransparence);
2609 xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23)));
2611 utl::TempFile tempFile;
2612 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2614 xShape.set( getShapeFromPage( 0, 0, xDocShRef ) );
2616 nTransparence = 0;
2617 xShape->getPropertyValue("FillTransparence") >>= nTransparence;
2618 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence);
2620 xDocShRef->DoClose();
2623 void SdOOXMLExportTest2::testTdf125551()
2625 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125551.pptx"), PPTX);
2626 utl::TempFile tempFile;
2627 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2629 uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
2630 uno::Reference<drawing::XShape> xShapeBg(xGroupShape->getByIndex(0), uno::UNO_QUERY);
2632 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1024), xShapeBg->getPosition().X);
2633 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(576), xShapeBg->getPosition().Y);
2634 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10815), xShapeBg->getSize().Width);
2635 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8587), xShapeBg->getSize().Height);
2638 void SdOOXMLExportTest2::testTdf136830()
2640 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf136830.pptx"), PPTX);
2641 utl::TempFile tempFile;
2642 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2644 // Without the fix in place, the X position of the shapes would have been 0
2645 uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
2647 uno::Reference<drawing::XShape> xShape1(xGroupShape->getByIndex(0), uno::UNO_QUERY);
2648 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14134), xShape1->getPosition().X);
2649 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-5321), xShape1->getPosition().Y);
2651 uno::Reference<drawing::XShape> xShape2(xGroupShape->getByIndex(1), uno::UNO_QUERY);
2652 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8085), xShape2->getPosition().X);
2653 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8085), xShape2->getPosition().Y);
2655 uno::Reference<drawing::XShape> xShape3(xGroupShape->getByIndex(2), uno::UNO_QUERY);
2656 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8283), xShape3->getPosition().X);
2657 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4620), xShape3->getPosition().Y);
2660 void SdOOXMLExportTest2::testTdf100348_convert_Fontwork2TextWarp()
2662 ::sd::DrawDocShellRef xDocShRef = loadURL(
2663 m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf100348_Fontwork2TextWarp.odp"), ODP);
2664 utl::TempFile tempFile;
2665 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2667 // Resulting pptx has to contain the TextWarp shape
2668 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2669 const OString sPathStart("/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr/a:prstTxWarp");
2670 assertXPath(pXmlDocContent, sPathStart + "[@prst='textWave1']");
2671 const OString sPathAdj(sPathStart + "/a:avLst/a:gd");
2672 assertXPath(pXmlDocContent, sPathAdj + "[@name='adj1' and @fmla='val 18750']");
2673 assertXPath(pXmlDocContent, sPathAdj + "[@name='adj2' and @fmla='val -7500']");
2675 // Reloading has to get the Fontwork shape back
2676 // TextPath makes a custom shape to a Fontwork shape, so must exist
2677 uno::Reference<beans::XPropertySet> xShapeWavePropSet(getShapeFromPage(0, 0, xDocShRef));
2678 auto aGeomPropSeq = xShapeWavePropSet->getPropertyValue("CustomShapeGeometry")
2679 .get<uno::Sequence<beans::PropertyValue>>();
2680 auto aGeomPropVec
2681 = comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>(aGeomPropSeq);
2682 OUString sName = "TextPath";
2683 auto aIterator = std::find_if(
2684 aGeomPropVec.begin(), aGeomPropVec.end(),
2685 [sName](const beans::PropertyValue& rValue) { return rValue.Name == sName; });
2686 CPPUNIT_ASSERT_MESSAGE("No TextPath", aIterator != aGeomPropVec.end());
2688 // Type has to be same as in original document on roundtrip.
2689 sName = "Type";
2690 auto aIterator2 = std::find_if(
2691 aGeomPropVec.begin(), aGeomPropVec.end(),
2692 [sName](const beans::PropertyValue& rValue) { return rValue.Name == sName; });
2693 CPPUNIT_ASSERT_MESSAGE("No Type", aIterator2 != aGeomPropVec.end());
2694 OUString sOwnName;
2695 aIterator2->Value >>= sOwnName;
2696 CPPUNIT_ASSERT_EQUAL(OUString("fontwork-wave"), sOwnName);
2698 // Adjustmentvalues need to be the same.
2699 sName = "AdjustmentValues";
2700 auto aIterator3 = std::find_if(
2701 aGeomPropVec.begin(), aGeomPropVec.end(),
2702 [sName](const beans::PropertyValue& rValue) { return rValue.Name == sName; });
2703 CPPUNIT_ASSERT_MESSAGE("No AdjustmentValues", aIterator3 != aGeomPropVec.end());
2704 uno::Sequence<drawing::EnhancedCustomShapeAdjustmentValue> aAdjValueSeq;
2705 aIterator3->Value >>= aAdjValueSeq;
2706 double fAdj1;
2707 aAdjValueSeq[0].Value >>= fAdj1;
2708 double fAdj2;
2709 aAdjValueSeq[1].Value >>= fAdj2;
2710 CPPUNIT_ASSERT_EQUAL(4050.0, fAdj1); // odp values, not pptx values
2711 CPPUNIT_ASSERT_EQUAL(9180.0, fAdj2);
2713 xDocShRef->DoClose();
2716 void SdOOXMLExportTest2::testTdf1225573_FontWorkScaleX()
2718 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx"), PPTX);
2719 utl::TempFile tempFile;
2720 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2722 // Error was, that attribute 'fromWordArt' was ignored
2723 // ensure, resulting pptx has fromWordArt="1" on textArchDown shape
2724 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2725 assertXPath(
2726 pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr[@fromWordArt='1']");
2728 // Error was, that text in legacy shapes of category "Follow Path" was not scaled to the path.
2729 uno::Reference<beans::XPropertySet> xShapeArchProps(getShapeFromPage(0, 0, xDocShRef));
2730 awt::Rectangle aBoundRectArch;
2731 xShapeArchProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectArch;
2732 // difference should be zero, but allow some range for stroke thickness
2733 CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectArch.Width - 13081));
2735 // Error was, that text in shapes of category "Warp" was not scaled to the path.
2736 uno::Reference<beans::XPropertySet> xShapeWaveProps(getShapeFromPage(0, 1, xDocShRef));
2737 awt::Rectangle aBoundRectWave;
2738 xShapeWaveProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectWave;
2739 // difference should be zero, but allow some range for stroke thickness
2740 CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectWave.Width - 11514));
2742 xDocShRef->DoClose();
2745 void SdOOXMLExportTest2::testTdf126234()
2747 sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126234.pptx"), PPTX );
2748 utl::TempFile tempFile;
2749 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2751 // check relative size of the bullet, 400% is a legitimate value for MS Office document
2752 // Without a fix, it will fail to set the size correctly
2753 const SdrPage *pPage = GetPage( 1, xDocShRef );
2754 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
2755 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
2756 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
2757 const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
2758 CPPUNIT_ASSERT(pNumFmt);
2759 CPPUNIT_ASSERT_EQUAL(sal_uInt16(400), pNumFmt->GetNumRule()->GetLevel(0).GetBulletRelSize());
2761 xDocShRef->DoClose();
2764 void SdOOXMLExportTest2::testTdf126741()
2766 sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126741.pptx"), PPTX );
2767 utl::TempFile tempFile;
2768 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2770 // dash dot dot line style import fix
2771 // The original fixed values are replaced with the percent values, because
2772 // with fix for tdf#127166 the MS Office preset styles are correctly detected.
2773 const SdrPage *pPage = GetPage( 1, xDocShRef );
2774 SdrObject *const pObj = pPage->GetObj(0);
2775 CPPUNIT_ASSERT(pObj);
2777 const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
2778 pObj->GetMergedItem(XATTR_LINESTYLE));
2779 const XLineDashItem& rDashItem = dynamic_cast<const XLineDashItem&>(
2780 pObj->GetMergedItem(XATTR_LINEDASH));
2782 CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_DASH, rStyleItem.GetValue());
2783 CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rDashItem.GetDashValue().GetDots());
2784 CPPUNIT_ASSERT_EQUAL(800.0, rDashItem.GetDashValue().GetDotLen());
2785 CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rDashItem.GetDashValue().GetDashes());
2786 CPPUNIT_ASSERT_EQUAL(100.0, rDashItem.GetDashValue().GetDashLen());
2787 CPPUNIT_ASSERT_EQUAL(300.0, rDashItem.GetDashValue().GetDistance());
2789 xDocShRef->DoClose();
2792 void SdOOXMLExportTest2::testTdf99497_keepAppearanceOfCircleKind()
2794 // Error was, that all CircleKind were exported to 'ellipse'.
2795 // Resulting pptx has to contain the customshapes of the corresponding kind
2796 // slide 1 ARC -> arc, slide 2 CUT -> chord, slide 3 SECTION -> pie
2797 // Adjustment values need to exist and their values need to correspond to the
2798 // original angles. Shape 'arc' needs to be unfilled.
2799 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf99497_CircleKind.odp"), ODP);
2800 utl::TempFile tempFile;
2801 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
2803 // slide 1 45° -> adj1 = 20493903, 270° -> adj2 = 5400000, <a:noFill/> exists
2804 xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
2805 const OString sPathStart1("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
2806 assertXPath(pXmlDocContent1, sPathStart1 + "[@prst='arc']");
2807 const OString sPathAdj1(sPathStart1 + "/a:avLst/a:gd");
2808 assertXPath(pXmlDocContent1, sPathAdj1 + "[@name='adj1' and @fmla='val 20493903']");
2809 assertXPath(pXmlDocContent1, sPathAdj1 + "[@name='adj2' and @fmla='val 5400000']");
2810 assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill");
2812 // slide 2 270° -> adj1 = 5400000, 180° -> adj2 = 10800000
2813 xmlDocUniquePtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
2814 const OString sPathStart2("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
2815 assertXPath(pXmlDocContent2, sPathStart2 + "[@prst='chord']");
2816 const OString sPathAdj2(sPathStart2 + "/a:avLst/a:gd");
2817 assertXPath(pXmlDocContent2, sPathAdj2 + "[@name='adj1' and @fmla='val 5400000']");
2818 assertXPath(pXmlDocContent2, sPathAdj2 + "[@name='adj2' and @fmla='val 10800000']");
2820 // slide 3 120° -> adj1 = 12600000, 30° -> adj2 = 20946396
2821 xmlDocUniquePtr pXmlDocContent3 = parseExport(tempFile, "ppt/slides/slide3.xml");
2822 const OString sPathStart3("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
2823 assertXPath(pXmlDocContent3, sPathStart3 + "[@prst='pie']");
2824 const OString sPathAdj3(sPathStart3 + "/a:avLst/a:gd");
2825 assertXPath(pXmlDocContent3, sPathAdj3 + "[@name='adj1' and @fmla='val 12600000']");
2826 assertXPath(pXmlDocContent3, sPathAdj3 + "[@name='adj2' and @fmla='val 20946396']");
2828 xDocShRef->DoClose();
2831 void SdOOXMLExportTest2::testTdf127372()
2833 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf127372.odp"), ODP);
2834 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2835 uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
2836 awt::Gradient aTransparenceGradient;
2837 xShape->getPropertyValue("FillTransparenceGradient") >>= aTransparenceGradient;
2838 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aTransparenceGradient.StartColor);
2839 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aTransparenceGradient.EndColor);
2842 void SdOOXMLExportTest2::testTdf127379()
2844 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf127379.odp"), ODP);
2845 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2846 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
2847 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
2848 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDoc->getDrawPages()->getCount() );
2850 uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) );
2851 uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY );
2853 uno::Any aAny = xPropSet->getPropertyValue( "Background" );
2854 CPPUNIT_ASSERT_MESSAGE("Slide background is missing", aAny.hasValue());
2855 uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
2856 aAny >>= aXBackgroundPropSet;
2858 drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
2859 aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
2860 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
2862 awt::Gradient aGradient;
2863 CPPUNIT_ASSERT(aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aGradient);
2864 CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), aGradient.StartColor);
2865 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2A6099), aGradient.EndColor);
2868 void SdOOXMLExportTest2::testTdf98603()
2870 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf98603.pptx"), PPTX);
2871 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2872 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
2873 uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
2874 uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
2875 uno::Reference< beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
2876 css::lang::Locale aLocale;
2877 xPropSet->getPropertyValue("CharLocaleComplex") >>= aLocale;
2878 CPPUNIT_ASSERT_EQUAL(OUString("he"), aLocale.Language);
2879 CPPUNIT_ASSERT_EQUAL(OUString("IL"), aLocale.Country);
2882 void SdOOXMLExportTest2::testTdf128213()
2884 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf128213.pptx"), PPTX);
2885 utl::TempFile tempFile;
2886 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
2888 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2889 assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm", "rot");
2892 void SdOOXMLExportTest2::testTdf79082()
2894 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf79082.pptx"), PPTX);
2895 utl::TempFile tempFile;
2896 xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
2898 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
2899 assertXPath(pXmlDocContent,
2900 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[1]",
2901 "pos",
2902 "360000");
2903 assertXPath(pXmlDocContent,
2904 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[1]",
2905 "algn",
2906 "l");
2908 assertXPath(pXmlDocContent,
2909 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[2]",
2910 "pos",
2911 "756000");
2912 assertXPath(pXmlDocContent,
2913 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[2]",
2914 "algn",
2915 "l");
2917 assertXPath(pXmlDocContent,
2918 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[3]",
2919 "pos",
2920 "1440000");
2921 assertXPath(pXmlDocContent,
2922 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[3]",
2923 "algn",
2924 "ctr");
2926 assertXPath(pXmlDocContent,
2927 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[4]",
2928 "pos",
2929 "1800000");
2930 assertXPath(pXmlDocContent,
2931 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[4]",
2932 "algn",
2933 "r");
2935 assertXPath(pXmlDocContent,
2936 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[5]",
2937 "pos",
2938 "3240000");
2939 assertXPath(pXmlDocContent,
2940 "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr/a:tabLst/a:tab[5]",
2941 "algn",
2942 "dec");
2944 xDocShRef->DoClose();
2947 void SdOOXMLExportTest2::testTdf129372()
2949 //Without the fix in place, it would crash at import time
2950 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf129372.pptx"), PPTX);
2951 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2952 const SdrPage *pPage = GetPage( 1, xDocShRef.get() );
2954 const SdrObject* pObj = pPage->GetObj(0);
2955 CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
2956 CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() );
2959 void SdOOXMLExportTest2::testShapeGlowEffect()
2961 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-glow-effect.pptx"), PPTX);
2962 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2963 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
2964 sal_Int32 nRadius = -1;
2965 xShape->getPropertyValue("GlowEffectRadius") >>= nRadius;
2966 CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 139700 EMU = 388.0556 mm/100
2967 Color nColor;
2968 xShape->getPropertyValue("GlowEffectColor") >>= nColor;
2969 CPPUNIT_ASSERT_EQUAL(Color(0xFFC000), nColor);
2970 sal_Int16 nTransparency;
2971 xShape->getPropertyValue("GlowEffectTransparency") >>= nTransparency;
2972 CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency);
2975 void SdOOXMLExportTest2::testTdf119087()
2977 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf119087.pptx"), PPTX);
2978 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2979 // This would fail both on export validation, and reloading the saved pptx file.
2982 void SdOOXMLExportTest2::testTdf131554()
2984 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf131554.pptx"), PPTX);
2985 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2986 uno::Reference<drawing::XShape> xShape(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY);
2987 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5622), xShape->getPosition().X);
2988 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(13251), xShape->getPosition().Y);
2991 void SdOOXMLExportTest2::testTdf132282()
2993 ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf132282.pptx"), PPTX);
2994 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
2995 uno::Reference<drawing::XShape> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
2996 // Without the fix in place, the position would be 0,0, height = 1 and width = 1
2997 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1736), xShape->getPosition().X);
2998 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(763), xShape->getPosition().Y);
2999 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(30523), xShape->getSize().Width);
3000 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2604), xShape->getSize().Height);
3003 void SdOOXMLExportTest2::testTdf132201EffectOrder()
3005 auto xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/effectOrder.pptx"),
3006 PPTX);
3007 utl::TempFile tempFile;
3008 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
3009 xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
3010 assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", 2);
3011 // The relative order of effects is important: glow must be before shadow
3012 CPPUNIT_ASSERT_EQUAL(0, getXPathPosition(pXmlDocContent,
3013 "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst",
3014 "glow"));
3015 CPPUNIT_ASSERT_EQUAL(1, getXPathPosition(pXmlDocContent,
3016 "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst",
3017 "outerShdw"));
3019 xDocShRef->DoClose();
3022 void SdOOXMLExportTest2::testShapeSoftEdgeEffect()
3024 auto xDocShRef
3025 = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-soft-edges.pptx"), PPTX);
3026 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
3027 auto xShapeProps(getShapeFromPage(0, 0, xDocShRef));
3028 sal_Int32 nRadius = -1;
3029 xShapeProps->getPropertyValue("SoftEdgeRadius") >>= nRadius;
3030 CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nRadius); // 18 pt
3033 void SdOOXMLExportTest2::testShapeShadowBlurEffect()
3035 auto xDocShRef
3036 = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-blur-effect.pptx"), PPTX);
3037 xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
3038 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
3039 bool bHasShadow = false;
3040 xShape->getPropertyValue("Shadow") >>= bHasShadow;
3041 CPPUNIT_ASSERT(bHasShadow);
3042 sal_Int32 nRadius = -1;
3043 xShape->getPropertyValue("ShadowBlur") >>= nRadius;
3044 CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 11 pt
3047 void SdOOXMLExportTest2::testTdf119223()
3049 auto xDocShRef
3050 = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf119223.odp"), ODP);
3051 utl::TempFile tempFile;
3052 xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
3054 xDocShRef->DoClose();
3056 xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
3057 assertXPath(pXmlDocRels,
3058 "//p:cNvPr[@name='SomeCustomShape']");
3060 assertXPath(pXmlDocRels,
3061 "//p:cNvPr[@name='SomePicture']");
3063 assertXPath(pXmlDocRels,
3064 "//p:cNvPr[@name='SomeFormula']");
3066 assertXPath(pXmlDocRels,
3067 "//p:cNvPr[@name='SomeLine']");
3069 assertXPath(pXmlDocRels,
3070 "//p:cNvPr[@name='SomeTextbox']");
3072 assertXPath(pXmlDocRels,
3073 "//p:cNvPr[@name='SomeTable']");
3075 assertXPath(pXmlDocRels,
3076 "//p:cNvPr[@name='SomeGroup']");
3079 void SdOOXMLExportTest2::testTdf96061_textHighlight()
3081 ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
3083 uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
3084 uno::Reference<text::XTextRange> const xParagraph1(getParagraphFromShape(0, xShape));
3085 uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
3086 uno::Reference< beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY_THROW);
3087 sal_Int32 aColor;
3088 xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
3089 CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
3091 uno::Reference<text::XTextRange> const xParagraph2(getParagraphFromShape(1, xShape));
3092 uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
3093 uno::Reference< beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY_THROW);
3094 xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
3095 CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
3097 xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
3099 uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(0, 0, xDocShRef));
3100 uno::Reference<text::XTextRange> const xParagraph3(getParagraphFromShape(0, xShape2));
3101 uno::Reference<text::XTextRange> xRun3(getRunFromParagraph(0, xParagraph3));
3102 uno::Reference< beans::XPropertySet> xPropSet3(xRun3, uno::UNO_QUERY_THROW);
3103 xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
3104 CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
3106 uno::Reference<text::XTextRange> const xParagraph4(getParagraphFromShape(1, xShape2));
3107 uno::Reference<text::XTextRange> xRun4(getRunFromParagraph(0, xParagraph4));
3108 uno::Reference< beans::XPropertySet> xPropSet4(xRun4, uno::UNO_QUERY_THROW);
3109 xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
3110 CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
3113 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
3115 CPPUNIT_PLUGIN_IMPLEMENT();
3117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */