fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sd / qa / unit / import-tests.cxx
blobbdedca1b325b3e2083c16ec1880b204084e7d801
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <config_poppler.h>
12 #include "sdmodeltestbase.hxx"
14 #include <svl/stritem.hxx>
15 #include <editeng/editobj.hxx>
16 #include <editeng/outlobj.hxx>
17 #include <editeng/ulspitem.hxx>
18 #include <editeng/fhgtitem.hxx>
19 #include <editeng/escapementitem.hxx>
20 #include <editeng/colritem.hxx>
21 #include <editeng/fontitem.hxx>
22 #include <editeng/wghtitem.hxx>
23 #include <editeng/numitem.hxx>
24 #include <editeng/lrspitem.hxx>
25 #include <editeng/postitem.hxx>
26 #include <rsc/rscsfx.hxx>
28 #include <sfx2/sfxsids.hrc>
29 #include <svl/stritem.hxx>
30 #include <svx/svdotext.hxx>
31 #include <svx/svdoashp.hxx>
32 #include <svx/svdograf.hxx>
33 #include <svx/svdogrp.hxx>
34 #include <svx/svdomedia.hxx>
35 #include <svx/svdoole2.hxx>
36 #include <svx/svdotable.hxx>
37 #include <svx/xflclit.hxx>
38 #include <svx/xlineit0.hxx>
39 #include <svx/xlnclit.hxx>
40 #include <svx/xlnwtit.hxx>
41 #include <animations/animationnodehelper.hxx>
42 #include <sax/tools/converter.hxx>
44 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
45 #include <com/sun/star/drawing/XDrawPage.hpp>
46 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
47 #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
48 #include <com/sun/star/animations/XAnimationNode.hpp>
49 #include <com/sun/star/animations/XAnimate.hpp>
50 #include <com/sun/star/beans/XPropertySet.hpp>
51 #include <com/sun/star/chart/XChartDocument.hpp>
52 #include <com/sun/star/chart2/XChartDocument.hpp>
53 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
54 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
55 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
56 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
57 #include <com/sun/star/chart2/data/XDataSequence.hpp>
58 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
59 #include <com/sun/star/table/BorderLine2.hpp>
60 #include <com/sun/star/style/ParagraphAdjust.hpp>
61 #include <com/sun/star/table/XTableRows.hpp>
63 #include <stlpool.hxx>
65 using namespace ::com::sun::star;
67 /// Impress import filters tests.
68 class SdImportTest : public SdModelTestBase
70 public:
71 void testDocumentLayout();
72 void testSmoketest();
73 void testN759180();
74 void testN778859();
75 void testMasterPageStyleParent();
76 void testGradientAngle();
77 void testFdo64512();
78 void testFdo71075();
79 void testN828390_2();
80 void testN828390_3();
81 void testFdo68594();
82 void testFdo72998();
83 void testFdo77027();
84 void testStrictOOXML();
85 void testN862510_1();
86 void testN862510_2();
87 void testN862510_4();
88 void testBnc870237();
89 void testBnc887225();
90 void testBnc480256();
91 void testBnc591147();
92 void testCreationDate();
93 void testBnc584721_1();
94 void testBnc584721_2();
95 void testBnc584721_3();
96 void testBnc584721_4();
97 void testBnc904423();
98 void testShapeLineStyle();
99 void testBnc862510_6();
100 void testBnc862510_7();
101 #if ENABLE_PDFIMPORT
102 void testPDFImport();
103 void testPDFImportSkipImages();
104 #endif
105 void testBulletSuffix();
106 void testBnc910045();
107 void testRowHeight();
108 void testTdf93830();
109 void testTdf93097();
111 CPPUNIT_TEST_SUITE(SdImportTest);
113 CPPUNIT_TEST(testDocumentLayout);
114 CPPUNIT_TEST(testSmoketest);
115 CPPUNIT_TEST(testN759180);
116 CPPUNIT_TEST(testN778859);
117 CPPUNIT_TEST(testMasterPageStyleParent);
118 CPPUNIT_TEST(testGradientAngle);
119 CPPUNIT_TEST(testFdo64512);
120 CPPUNIT_TEST(testFdo71075);
121 CPPUNIT_TEST(testN828390_2);
122 CPPUNIT_TEST(testN828390_3);
123 CPPUNIT_TEST(testFdo68594);
124 CPPUNIT_TEST(testFdo72998);
125 CPPUNIT_TEST(testFdo77027);
126 CPPUNIT_TEST(testStrictOOXML);
127 CPPUNIT_TEST(testN862510_1);
128 CPPUNIT_TEST(testN862510_2);
129 CPPUNIT_TEST(testN862510_4);
130 CPPUNIT_TEST(testBnc870237);
131 CPPUNIT_TEST(testBnc887225);
132 CPPUNIT_TEST(testBnc480256);
133 CPPUNIT_TEST(testBnc591147);
134 CPPUNIT_TEST(testCreationDate);
135 CPPUNIT_TEST(testBnc584721_1);
136 CPPUNIT_TEST(testBnc584721_2);
137 CPPUNIT_TEST(testBnc584721_3);
138 CPPUNIT_TEST(testBnc584721_4);
139 CPPUNIT_TEST(testBnc904423);
140 CPPUNIT_TEST(testShapeLineStyle);
141 CPPUNIT_TEST(testBnc862510_6);
142 CPPUNIT_TEST(testBnc862510_7);
143 #if ENABLE_PDFIMPORT
144 CPPUNIT_TEST(testPDFImport);
145 CPPUNIT_TEST(testPDFImportSkipImages);
146 #endif
147 CPPUNIT_TEST(testBulletSuffix);
148 CPPUNIT_TEST(testBnc910045);
149 CPPUNIT_TEST(testRowHeight);
150 CPPUNIT_TEST(testTdf93830);
151 CPPUNIT_TEST(testTdf93097);
153 CPPUNIT_TEST_SUITE_END();
156 /** Test document against a reference XML dump of shapes.
158 If you want to update one of these tests, or add a new one, set the nUpdateMe
159 to the index of the test, and the dump XML's will be created (or rewritten)
160 instead of checking. Use with care - when the test is failing, first find out
161 why, instead of just updating .xml's blindly.
163 Example: Let's say you are adding a test called fdoABCD.pptx. You'll place it
164 to the data/ subdirectory, and will add an entry to aFilesToCompare below,
165 the 3rd parameter is for export test - can be -1 (don't export), ODP, PPT or PPTX
166 like:
168 { "fdoABCD.pptx", "xml/fdoABCD_", PPTX },
170 and will count the index in the aFilesToCompare structure (1st is 0, 2nd is 1,
171 etc.) Temporarily you'll set nUpdateMe to this index (instead of -1), and run
173 make sd
175 This will generate the sd/qa/unit/data/xml/fdoABCD_*.xml for you. Now you
176 will change nUpdateMe back to -1, and commit your fdoABCD.pptx test, the
177 xml/fdoABCD_*.xml dumps, and the aFilesToCompare addition in one commit.
179 As the last step, you will revert your fix and do 'make sd' again, to check
180 that without your fix, the unit test breaks. Then clean up, and push :-)
182 NOTE: This approach is suitable only for tests of fixes that actually change
183 the layout - best to check by reverting your fix locally after having added
184 the test, and re-running; it should break.
186 void SdImportTest::testDocumentLayout()
188 struct { const char *pInput, *pDump; sal_Int32 nFormat; sal_Int32 nExportType; } aFilesToCompare[] =
190 { "odp/shapes-test.odp", "xml/shapes-test_page", ODP, -1 },
191 { "fdo47434.pptx", "xml/fdo47434_", PPTX, -1 },
192 { "n758621.ppt", "xml/n758621_", PPT, -1 },
193 { "fdo64586.ppt", "xml/fdo64586_", PPT, -1 },
194 { "n819614.pptx", "xml/n819614_", PPTX, -1 },
195 { "n820786.pptx", "xml/n820786_", PPTX, -1 },
196 { "n762695.pptx", "xml/n762695_", PPTX, -1 },
197 { "n593612.pptx", "xml/n593612_", PPTX, -1 },
198 { "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 },
199 { "n902652.pptx", "xml/n902652_", PPTX, -1 },
200 { "tdf90403.pptx", "xml/tdf90403_", PPTX, -1 },
201 { "tdf90338.odp", "xml/tdf90338_", ODP, PPTX },
202 { "tdf92001.odp", "xml/tdf92001_", ODP, PPTX },
203 // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example
206 for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) ); ++i )
208 int nUpdateMe = -1; // index of test we want to update; supposedly only when the test is created
210 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ), aFilesToCompare[i].nFormat );
211 if( aFilesToCompare[i].nExportType >= 0 )
212 xDocShRef = saveAndReload( xDocShRef, aFilesToCompare[i].nExportType );
213 compareWithShapesDump( xDocShRef,
214 getPathFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pDump ),
215 i == nUpdateMe );
219 void SdImportTest::testSmoketest()
221 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/smoketest.pptx"), PPTX);
223 SdDrawDocument *pDoc = xDocShRef->GetDoc();
224 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
226 // cf. SdrModel svx/svdmodel.hxx ...
228 CPPUNIT_ASSERT_MESSAGE( "wrong page count", pDoc->GetPageCount() == 3);
230 const SdrPage *pPage = pDoc->GetPage (1);
231 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
233 const size_t nObjs = pPage->GetObjCount();
234 for (size_t i = 0; i < nObjs; i++)
236 SdrObject *pObj = pPage->GetObj(i);
237 SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
238 SdrTextObj *pTxt = dynamic_cast<SdrTextObj *>( pObj );
239 (void)pTxt; (void)eKind;
242 CPPUNIT_ASSERT_MESSAGE( "changed", !pDoc->IsChanged() );
244 xDocShRef->DoClose();
247 void SdImportTest::testN759180()
249 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/n759180.pptx"), PPTX);
251 SdDrawDocument *pDoc = xDocShRef->GetDoc();
252 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
253 const SdrPage *pPage = pDoc->GetPage (1);
254 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
256 //sal_uIntPtr nObjs = pPage->GetObjCount();
257 //for (sal_uIntPtr i = 0; i < nObjs; i++)
259 // Get the object
260 SdrObject *pObj = pPage->GetObj(0);
261 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
262 CPPUNIT_ASSERT(pTxtObj);
263 std::vector<EECharAttrib> rLst;
264 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
265 const SvxULSpaceItem *pULSpace = dynamic_cast<const SvxULSpaceItem *>(aEdit.GetParaAttribs(0).GetItem(EE_PARA_ULSPACE));
266 CPPUNIT_ASSERT(pULSpace);
267 CPPUNIT_ASSERT_MESSAGE( "Para bottom spacing is wrong!", pULSpace->GetLower() == 0 );
268 aEdit.GetCharAttribs(1, rLst);
269 for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
271 const SvxFontHeightItem * pFontHeight = dynamic_cast<const SvxFontHeightItem *>((*it).pAttr);
272 if(pFontHeight)
274 // nStart == 9
275 // font height = 5 => 5*2540/72
276 CPPUNIT_ASSERT_MESSAGE( "Font height is wrong", pFontHeight->GetHeight() == 176 );
277 break;
282 xDocShRef->DoClose();
285 void SdImportTest::testN862510_1()
287 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_1.pptx"), PPTX );
289 SdDrawDocument *pDoc = xDocShRef->GetDoc();
290 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
291 const SdrPage *pPage = pDoc->GetPage(1);
292 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
294 std::vector<EECharAttrib> rLst;
295 SdrObject *pObj = pPage->GetObj( 0 );
296 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
297 CPPUNIT_ASSERT( pTxtObj );
298 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
299 aEdit.GetCharAttribs( 0, rLst );
300 for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
302 const SvxEscapementItem *pFontEscapement = dynamic_cast<const SvxEscapementItem *>( (*it).pAttr );
303 CPPUNIT_ASSERT_MESSAGE( "Baseline attribute not handled properly", !( pFontEscapement && pFontEscapement->GetProp() != 100 ) );
307 xDocShRef->DoClose();
310 void SdImportTest::testN862510_2()
312 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_2.pptx"), PPTX );
314 SdDrawDocument *pDoc = xDocShRef->GetDoc();
315 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
316 const SdrPage *pPage = pDoc->GetPage(1);
317 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
319 SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 0 ) );
320 CPPUNIT_ASSERT( pGrpObj );
321 SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>( pGrpObj->GetSubList()->GetObj( 0 ) );
322 CPPUNIT_ASSERT( pObj );
323 CPPUNIT_ASSERT_MESSAGE( "Wrong Text Rotation!", pObj->GetExtraTextRotation( true ) == 90 );
326 xDocShRef->DoClose();
329 void SdImportTest::testN862510_4()
331 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_4.pptx"), PPTX );
333 SdDrawDocument *pDoc = xDocShRef->GetDoc();
334 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
335 const SdrPage *pPage = pDoc->GetPage( 1 );
336 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
338 std::vector<EECharAttrib> rLst;
339 SdrObject *pObj = pPage->GetObj( 0 );
340 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
341 CPPUNIT_ASSERT( pTxtObj );
342 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
343 aEdit.GetCharAttribs( 0, rLst );
344 for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it )
346 const SvxColorItem *pC = dynamic_cast<const SvxColorItem *>( (*it).pAttr );
347 CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue().GetColor() == 0 ) );
351 xDocShRef->DoClose();
354 void SdImportTest::testN828390_2()
356 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n828390_2.pptx"), PPTX );
358 SdDrawDocument *pDoc = xDocShRef->GetDoc();
359 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
360 const SdrPage *pPage = pDoc->GetPage(1);
361 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
363 SdrObject *pObj = pPage->GetObj(0);
364 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
365 CPPUNIT_ASSERT( pTxtObj );
366 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
367 CPPUNIT_ASSERT(aEdit.GetText(0) == "Linux ");
368 CPPUNIT_ASSERT(aEdit.GetText(1) == "Standard Platform");
370 xDocShRef->DoClose();
373 void SdImportTest::testN828390_3()
375 bool bPassed = true;
376 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n828390_3.pptx"), PPTX );
378 SdDrawDocument *pDoc = xDocShRef->GetDoc();
379 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
380 const SdrPage *pPage = pDoc->GetPage(1);
381 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
383 SdrObject *pObj = pPage->GetObj(0);
384 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
385 CPPUNIT_ASSERT( pTxtObj );
386 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
387 std::vector<EECharAttrib> rLst;
388 aEdit.GetCharAttribs(1, rLst);
389 for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
391 const SvxEscapementItem *pFontEscapement = dynamic_cast<const SvxEscapementItem *>((*it).pAttr);
392 if(pFontEscapement)
394 if( pFontEscapement->GetEsc() != 0 )
396 bPassed = false;
397 break;
401 CPPUNIT_ASSERT_MESSAGE("CharEscapment not imported properly", bPassed);
403 xDocShRef->DoClose();
406 void SdImportTest::testMasterPageStyleParent()
408 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/odp/masterpage_style_parent.odp"), ODP );
410 SdDrawDocument *pDoc = xDocShRef->GetDoc();
411 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
412 const SdrPage *pPage = pDoc->GetPage(1);
413 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
415 SdStyleSheetPool *const pPool(pDoc->GetSdStyleSheetPool());
417 int parents(0);
418 SfxStyleSheetIterator iter(pPool, SD_STYLE_FAMILY_MASTERPAGE);
419 for (SfxStyleSheetBase * pStyle = iter.First(); pStyle; pStyle = iter.Next())
421 OUString const name(pStyle->GetName());
422 OUString const parent(pStyle->GetParent());
423 if (!parent.isEmpty())
425 ++parents;
426 // check that parent exists
427 SfxStyleSheetBase *const pParentStyle(
428 pPool->Find(parent, SD_STYLE_FAMILY_MASTERPAGE));
429 CPPUNIT_ASSERT(pParentStyle);
430 CPPUNIT_ASSERT_EQUAL(pParentStyle->GetName(), parent);
431 // check that parent has the same master page as pStyle
432 CPPUNIT_ASSERT(parent.indexOf(SD_LT_SEPARATOR) != -1);
433 CPPUNIT_ASSERT(name.indexOf(SD_LT_SEPARATOR) != -1);
434 CPPUNIT_ASSERT_EQUAL(
435 parent.copy(0, parent.indexOf(SD_LT_SEPARATOR)),
436 name.copy(0, name.indexOf(SD_LT_SEPARATOR)));
439 // check that there are actually parents...
440 CPPUNIT_ASSERT_EQUAL(16, parents);
442 xDocShRef->DoClose();
445 void SdImportTest::testGradientAngle()
447 sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odg/gradient-angle.fodg"), FODG);
449 uno::Reference<lang::XMultiServiceFactory> const xDoc(
450 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
452 awt::Gradient gradient;
453 uno::Reference<container::XNameAccess> const xGradients(
454 xDoc->createInstance("com.sun.star.drawing.GradientTable"),
455 uno::UNO_QUERY);
457 CPPUNIT_ASSERT(xGradients->getByName("Gradient 38") >>= gradient);
458 CPPUNIT_ASSERT_EQUAL(sal_Int16(0), gradient.Angle); // was: 3600
460 CPPUNIT_ASSERT(xGradients->getByName("Gradient 10") >>= gradient);
461 CPPUNIT_ASSERT_EQUAL(sal_Int16(270), gradient.Angle); // 27deg
463 CPPUNIT_ASSERT(xGradients->getByName("Gradient 11") >>= gradient);
464 CPPUNIT_ASSERT_EQUAL(sal_Int16(1145), gradient.Angle); // 2rad
466 CPPUNIT_ASSERT(xGradients->getByName("Gradient 12") >>= gradient);
467 CPPUNIT_ASSERT_EQUAL(sal_Int16(900), gradient.Angle); // 100grad
469 CPPUNIT_ASSERT(xGradients->getByName("Gradient 13") >>= gradient);
470 CPPUNIT_ASSERT_EQUAL(sal_Int16(3599), gradient.Angle); // -1
472 CPPUNIT_ASSERT(xGradients->getByName("Gradient 14") >>= gradient);
473 CPPUNIT_ASSERT_EQUAL(sal_Int16(3028), gradient.Angle); // -1rad
475 CPPUNIT_ASSERT(xGradients->getByName("Gradient 15") >>= gradient);
476 CPPUNIT_ASSERT_EQUAL(sal_Int16(300), gradient.Angle); // 3900
478 CPPUNIT_ASSERT(xGradients->getByName("Gradient 16") >>= gradient);
479 CPPUNIT_ASSERT_EQUAL(sal_Int16(105), gradient.Angle); // 10.5deg
481 CPPUNIT_ASSERT(xGradients->getByName("Gradient 17") >>= gradient);
482 CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), gradient.Angle); // \pi rad
484 uno::Reference<container::XNameAccess> const xTranspGradients(
485 xDoc->createInstance("com.sun.star.drawing.TransparencyGradientTable"),
486 uno::UNO_QUERY);
488 CPPUNIT_ASSERT(xTranspGradients->getByName("Transparency 2") >>= gradient);
489 CPPUNIT_ASSERT_EQUAL(sal_Int16(10), gradient.Angle); // 1
491 CPPUNIT_ASSERT(xTranspGradients->getByName("Transparency 1") >>= gradient);
492 CPPUNIT_ASSERT_EQUAL(sal_Int16(900), gradient.Angle); // 90deg
494 CPPUNIT_ASSERT(xTranspGradients->getByName("Transparency 3") >>= gradient);
495 CPPUNIT_ASSERT_EQUAL(sal_Int16(572), gradient.Angle); // 1.0rad
497 CPPUNIT_ASSERT(xTranspGradients->getByName("Transparency 4") >>= gradient);
498 CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), gradient.Angle); // 1000grad
501 void SdImportTest::testN778859()
503 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/n778859.pptx"), PPTX);
505 SdDrawDocument *pDoc = xDocShRef->GetDoc();
506 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
507 const SdrPage *pPage = pDoc->GetPage(1);
508 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
510 // Get the object
511 SdrObject *pObj = pPage->GetObj(1);
512 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
513 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
514 CPPUNIT_ASSERT(!pTxtObj->IsAutoFit());
517 xDocShRef->DoClose();
520 void SdImportTest::testFdo68594()
522 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/ppt/fdo68594.ppt"), PPT);
524 SdDrawDocument *pDoc = xDocShRef->GetDoc();
525 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
526 const SdrPage *pPage = &(pDoc->GetPage (1)->TRG_GetMasterPage());
527 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
528 SdrObject *pObj = pPage->GetObj(1);
529 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
530 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
531 const SvxColorItem *pC = dynamic_cast<const SvxColorItem *>(&pTxtObj->GetMergedItem(EE_CHAR_COLOR));
532 CPPUNIT_ASSERT_MESSAGE( "no color item", pC != NULL);
533 // Color should be black
534 CPPUNIT_ASSERT_MESSAGE( "Placeholder color mismatch", pC->GetValue().GetColor() == 0);
536 xDocShRef->DoClose();
539 void SdImportTest::testFdo72998()
541 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/cshapes.pptx"), PPTX);
543 SdDrawDocument *pDoc = xDocShRef->GetDoc();
544 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
545 const SdrPage *pPage = pDoc->GetPage(1);
546 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
548 SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2));
549 CPPUNIT_ASSERT( pObj );
550 const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
551 const ::com::sun::star::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
552 CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox );
553 com::sun::star::awt::Rectangle aViewBox;
554 CPPUNIT_ASSERT( (*pViewBox >>= aViewBox ) );
555 CPPUNIT_ASSERT_MESSAGE( "Width should be zero - for forcing scale to 1", !aViewBox.Width );
556 CPPUNIT_ASSERT_MESSAGE( "Height should be zero - for forcing scale to 1", !aViewBox.Height );
559 xDocShRef->DoClose();
562 // FIXME copypasta
563 std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
565 rStrm << "Color: R:" << rColor.GetRed() << " G:" << rColor.GetGreen() << " B: " << rColor.GetBlue();
566 return rStrm;
569 void SdImportTest::testFdo77027()
571 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/fdo77027.odp"), ODP);
573 SdDrawDocument *pDoc = xDocShRef->GetDoc();
574 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
575 const SdrPage *pPage = pDoc->GetPage(1);
576 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
578 SdrOle2Obj *const pObj = dynamic_cast<SdrOle2Obj*>(pPage->GetObj(0));
579 CPPUNIT_ASSERT(pObj);
581 // check that the fill style/color was actually imported
582 const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
583 pObj->GetMergedItem(XATTR_FILLSTYLE));
584 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue());
585 const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
586 pObj->GetMergedItem(XATTR_FILLCOLOR));
587 CPPUNIT_ASSERT_EQUAL(Color(0xff6600), rColorItem.GetColorValue());
590 xDocShRef->DoClose();
593 void SdImportTest::testFdo64512()
595 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"), ODP);
597 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
598 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
599 CPPUNIT_ASSERT_MESSAGE( "not exactly one page", xDoc->getDrawPages()->getCount() == 1 );
601 uno::Reference< drawing::XDrawPage > xPage(
602 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
603 CPPUNIT_ASSERT_MESSAGE( "no exactly three shapes", xPage->getCount() == 3 );
605 uno::Reference< beans::XPropertySet > xConnectorShape(
606 xPage->getByIndex(2), uno::UNO_QUERY );
607 CPPUNIT_ASSERT_MESSAGE( "no connector shape", xConnectorShape.is() );
609 uno::Reference< beans::XPropertySet > xSvgShape(
610 xConnectorShape->getPropertyValue("StartShape"), uno::UNO_QUERY );
611 CPPUNIT_ASSERT_MESSAGE( "no start shape", xSvgShape.is() );
613 uno::Reference< beans::XPropertySet > xCustomShape(
614 xConnectorShape->getPropertyValue("EndShape"), uno::UNO_QUERY );
615 CPPUNIT_ASSERT_MESSAGE( "no end shape", xCustomShape.is() );
617 uno::Reference< animations::XAnimationNodeSupplier > xAnimNodeSupplier(
618 xPage, uno::UNO_QUERY_THROW );
619 uno::Reference< animations::XAnimationNode > xRootNode(
620 xAnimNodeSupplier->getAnimationNode() );
621 std::vector< uno::Reference< animations::XAnimationNode > > aAnimVector;
622 anim::create_deep_vector(xRootNode, aAnimVector);
623 CPPUNIT_ASSERT_MESSAGE( "not 8 animation nodes", aAnimVector.size() == 8 );
625 uno::Reference< animations::XAnimate > xNode(
626 aAnimVector[7], uno::UNO_QUERY_THROW );
627 uno::Reference< drawing::XShape > xTargetShape(
628 xNode->getTarget(), uno::UNO_QUERY_THROW );
629 CPPUNIT_ASSERT_MESSAGE( "inner node not referencing svg shape",
630 xTargetShape != xSvgShape );
632 xDocShRef->DoClose();
635 // Unit test for importing charts
636 void SdImportTest::testFdo71075()
638 double values[] = { 12.0, 13.0, 14.0 };
639 ::com::sun::star::uno::Any aAny;
640 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo71075.odp"), ODP);
642 SdDrawDocument *pDoc = xDocShRef->GetDoc();
643 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
644 uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
645 uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
646 uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
647 CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() );
649 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
650 aAny = xPropSet->getPropertyValue( OUString("Model") );
651 CPPUNIT_ASSERT_MESSAGE( "failed to load shape", aAny.hasValue() );
653 uno::Reference< chart::XChartDocument > xChartDoc;
654 aAny >>= xChartDoc;
655 CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChartDoc.is() );
656 uno::Reference< chart2::XChartDocument > xChart2Doc( xChartDoc, uno::UNO_QUERY );
657 CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart2Doc.is() );
659 uno::Reference< chart2::XCoordinateSystemContainer > xBCooSysCnt( xChart2Doc->getFirstDiagram(), uno::UNO_QUERY );
660 uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xBCooSysCnt->getCoordinateSystems());
661 uno::Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[0], uno::UNO_QUERY );
663 uno::Reference< chart2::XDataSeriesContainer > xDSCnt( xCTCnt->getChartTypes()[0], uno::UNO_QUERY );
664 CPPUNIT_ASSERT_MESSAGE( "failed to load data series", xDSCnt.is() );
665 uno::Sequence< uno::Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries());
666 CPPUNIT_ASSERT_MESSAGE( "Invalid Series count", aSeriesSeq.getLength() == 1);
667 uno::Reference< chart2::data::XDataSource > xSource( aSeriesSeq[0], uno::UNO_QUERY );
668 uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(xSource->getDataSequences());
669 CPPUNIT_ASSERT_MESSAGE( "Invalid Series count", aSeqCnt.getLength() == 1);
670 uno::Reference< chart2::data::XDataSequence > xValueSeq( aSeqCnt[0]->getValues() );
671 CPPUNIT_ASSERT_MESSAGE( "Invalid Data count", xValueSeq->getData().getLength() == sizeof(values)/(sizeof(double)));
672 uno::Reference< chart2::data::XNumericalDataSequence > xNumSeq( xValueSeq, uno::UNO_QUERY );
673 uno::Sequence< double > aValues( xNumSeq->getNumericalData());
674 for(sal_Int32 i=0;i<xValueSeq->getData().getLength();i++)
675 CPPUNIT_ASSERT_MESSAGE( "Invalid Series count", aValues.getConstArray()[i] == values[i]);
677 xDocShRef->DoClose();
680 void SdImportTest::testStrictOOXML()
682 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/strict_ooxml.pptx"), PPTX);
684 SdDrawDocument *pDoc = xDocShRef->GetDoc();
685 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
686 uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
687 uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
688 uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
689 CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() );
691 xDocShRef->DoClose();
694 void SdImportTest::testBnc870237()
696 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc870237.pptx"), PPTX);
698 SdDrawDocument *pDoc = xDocShRef->GetDoc();
699 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
700 const SdrPage *pPage = pDoc->GetPage (1);
701 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
703 // Simulate a:ext inside dsp:txXfrm with changing the lower distance
704 const SdrObjGroup* pObj = dynamic_cast<SdrObjGroup*>( pPage->GetObj( 0 ) );
705 CPPUNIT_ASSERT_MESSAGE( "no object", pObj != NULL);
706 CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue());
707 CPPUNIT_ASSERT_EQUAL( sal_Int32(9919), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue());
708 CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST))).GetValue());
709 CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST))).GetValue());
711 xDocShRef->DoClose();
714 void SdImportTest::testCreationDate()
716 sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo71434.pptx"), PPTX);
717 uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY);
718 uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
719 util::DateTime aDate = xDocumentProperties->getCreationDate();
720 OUStringBuffer aBuffer;
721 sax::Converter::convertDateTime(aBuffer, aDate, 0);
722 // Metadata wasn't imported, this was 0000-00-00.
723 CPPUNIT_ASSERT_EQUAL(OUString("2013-11-09T10:37:56"), aBuffer.makeStringAndClear());
724 xDocShRef->DoClose();
727 void SdImportTest::testBnc887225()
729 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bnc887225.pptx"), PPTX );
730 // In the document, lastRow and lastCol table properties are used.
731 // Make sure styles are set properly for individual cells.
733 SdDrawDocument *pDoc = xDocShRef->GetDoc();
734 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
735 const SdrPage *pPage = pDoc->GetPage(1);
736 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
738 sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(2));
739 CPPUNIT_ASSERT( pTableObj );
740 uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
741 uno::Reference< beans::XPropertySet > xCell;
742 sal_Int32 nColor;
744 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
745 xCell->getPropertyValue("FillColor") >>= nColor;
746 CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
748 xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
749 xCell->getPropertyValue("FillColor") >>= nColor;
750 CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
752 xCell.set(xTable->getCellByPosition(1, 1), uno::UNO_QUERY_THROW);
753 xCell->getPropertyValue("FillColor") >>= nColor;
754 CPPUNIT_ASSERT_EQUAL(sal_Int32(13754095), nColor);
756 xCell.set(xTable->getCellByPosition(1, 2), uno::UNO_QUERY_THROW);
757 xCell->getPropertyValue("FillColor") >>= nColor;
758 CPPUNIT_ASSERT_EQUAL(sal_Int32(15331319), nColor);
760 xCell.set(xTable->getCellByPosition(1, 4), uno::UNO_QUERY_THROW);
761 xCell->getPropertyValue("FillColor") >>= nColor;
762 CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
764 xCell.set(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
765 xCell->getPropertyValue("FillColor") >>= nColor;
766 CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
768 xCell.set(xTable->getCellByPosition(3, 4), uno::UNO_QUERY_THROW);
769 xCell->getPropertyValue("FillColor") >>= nColor;
770 CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
772 xDocShRef->DoClose();
775 void SdImportTest::testBnc480256()
777 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
778 // In the document, there are two tables with table background properties.
779 // Make sure colors are set properly for individual cells.
781 // TODO: If you are working on improving table background support, expect
782 // this unit test to fail. In that case, feel free to change the numbers.
784 SdDrawDocument *pDoc = xDocShRef->GetDoc();
785 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
786 const SdrPage *pPage = pDoc->GetPage(1);
787 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
789 sdr::table::SdrTableObj *pTableObj;
790 uno::Reference< table::XCellRange > xTable;
791 uno::Reference< beans::XPropertySet > xCell;
792 sal_Int32 nColor;
793 table::BorderLine2 aBorderLine;
795 pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
796 CPPUNIT_ASSERT( pTableObj );
797 xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
799 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
800 xCell->getPropertyValue("FillColor") >>= nColor;
801 CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
802 xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
803 CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
805 xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
806 xCell->getPropertyValue("FillColor") >>= nColor;
807 CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
808 xCell->getPropertyValue("TopBorder") >>= aBorderLine;
809 CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
811 pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
812 CPPUNIT_ASSERT( pTableObj );
813 xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
815 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
816 xCell->getPropertyValue("FillColor") >>= nColor;
817 CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
818 xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
819 CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
821 xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
822 xCell->getPropertyValue("FillColor") >>= nColor;
823 CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
825 xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
826 xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
827 CPPUNIT_ASSERT_EQUAL(util::Color(0), aBorderLine.Color);
829 xDocShRef->DoClose();
832 void SdImportTest::testBnc584721_1()
834 // Title text shape on the master page contained wrong text.
836 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_1_2.pptx"), PPTX);
838 SdDrawDocument *pDoc = xDocShRef->GetDoc();
839 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
840 const SdrPage *pPage = &(pDoc->GetPage (1)->TRG_GetMasterPage());
841 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
842 SdrObject *pObj = pPage->GetObj(0);
843 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
844 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
845 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
846 CPPUNIT_ASSERT_EQUAL(OUString("Click to edit Master title style"), aEdit.GetText(0));
847 xDocShRef->DoClose();
850 void SdImportTest::testBnc584721_2()
852 // Import created an extra/unneeded outliner shape on the master slide next to the imported title shape.
854 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_1_2.pptx"), PPTX);
856 SdDrawDocument *pDoc = xDocShRef->GetDoc();
857 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
858 const SdrPage *pPage = &(pDoc->GetPage(1)->TRG_GetMasterPage());
859 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
860 CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
862 xDocShRef->DoClose();
865 void SdImportTest::testBnc584721_3()
867 // Subtitle was simply skipped on master slides.
868 // Check whether the second shape is a subtitle shape with the right text.
870 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_3.pptx"), PPTX);
872 SdDrawDocument *pDoc = xDocShRef->GetDoc();
873 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
874 const SdrPage *pPage = &(pDoc->GetPage(1)->TRG_GetMasterPage());
875 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
876 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(1) );
877 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
879 // Check the shape type
880 uno::Reference< drawing::XShape > xShape( pTxtObj->getUnoShape(), uno::UNO_QUERY );
881 CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.presentation.SubtitleShape"), xShape->getShapeType());
883 // Check the text
884 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
885 CPPUNIT_ASSERT_EQUAL(OUString("Click to edit Master subtitle style"), aEdit.GetText(0));
887 xDocShRef->DoClose();
890 void SdImportTest::testBnc591147()
892 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc591147.pptx"), PPTX);
894 // In the document, there are two slides with media files.
895 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
896 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
897 CPPUNIT_ASSERT_EQUAL( sal_Int32(2), xDoc->getDrawPages()->getCount() );
899 // First page has video file inserted
900 uno::Reference< drawing::XDrawPage > xPage(
901 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
902 CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xPage->getCount() );
904 uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
905 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY_THROW );
906 OUString sVideoURL("emptyURL");
907 bool bSucess = xPropSet->getPropertyValue("MediaURL") >>= sVideoURL;
908 CPPUNIT_ASSERT_MESSAGE( "MediaURL property is not set", bSucess );
909 CPPUNIT_ASSERT_MESSAGE("MediaURL is empty", !sVideoURL.isEmpty());
911 // Second page has audio file inserted
912 xPage.set( xDoc->getDrawPages()->getByIndex(1), uno::UNO_QUERY_THROW );
913 CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xPage->getCount() );
915 xShape.set( xPage->getByIndex(0), uno::UNO_QUERY_THROW );
916 xPropSet.set( xShape, uno::UNO_QUERY_THROW );
917 OUString sAudioURL("emptyURL");
918 bSucess = xPropSet->getPropertyValue("MediaURL") >>= sAudioURL;
919 CPPUNIT_ASSERT_MESSAGE( "MediaURL property is not set", bSucess );
920 CPPUNIT_ASSERT_MESSAGE("MediaURL is empty", !sAudioURL.isEmpty());
922 CPPUNIT_ASSERT_MESSAGE( "sAudioURL and sVideoURL should not be equal", sAudioURL != sVideoURL );
924 xDocShRef->DoClose();
927 void SdImportTest::testBnc584721_4()
929 // Black text was imported as white because of wrong caching mechanism
931 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_4.pptx"), PPTX);
933 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
934 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
936 uno::Reference< drawing::XDrawPage > xPage(
937 xDoc->getDrawPages()->getByIndex(1), uno::UNO_QUERY_THROW );
939 uno::Reference< beans::XPropertySet > xShape(
940 xPage->getByIndex(1), uno::UNO_QUERY );
941 CPPUNIT_ASSERT_MESSAGE( "no text shape", xShape.is() );
943 // Get first paragraph of the text
944 uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
945 CPPUNIT_ASSERT_MESSAGE( "no text shape", xText.is() );
946 uno::Reference<container::XEnumerationAccess> paraEnumAccess;
947 paraEnumAccess.set(xText, uno::UNO_QUERY);
948 uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
949 uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
950 uno::UNO_QUERY_THROW);
952 // Get first run of the paragraph
953 uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
954 uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
955 uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
956 uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
957 sal_Int32 nCharColor;
958 xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
960 // Color should be black
961 CPPUNIT_ASSERT_EQUAL( sal_Int32(COL_BLACK), nCharColor );
963 xDocShRef->DoClose();
966 void SdImportTest::testBnc904423()
968 // Here the problem was that different fill properties were applied in wrong order on the shape
969 // Right order: 1) master slide fill style, 2) theme, 3) direct formatting
970 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("sd/qa/unit/data/pptx/bnc904423.pptx"), PPTX);
972 SdDrawDocument *pDoc = xDocShRef->GetDoc();
973 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
974 const SdrPage *pPage = pDoc->GetPage(1);
975 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
977 // First shape's background color is defined on master slide
979 SdrObject *const pObj = pPage->GetObj(0);
980 CPPUNIT_ASSERT(pObj);
982 const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
983 pObj->GetMergedItem(XATTR_FILLSTYLE));
984 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue());
985 const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
986 pObj->GetMergedItem(XATTR_FILLCOLOR));
987 CPPUNIT_ASSERT_EQUAL(ColorData(0x00CC99), rColorItem.GetColorValue().GetColor());
990 // Second shape's background color is defined by theme
992 SdrObject *const pObj = pPage->GetObj(1);
993 CPPUNIT_ASSERT(pObj);
995 const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
996 pObj->GetMergedItem(XATTR_FILLSTYLE));
997 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue());
998 const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
999 pObj->GetMergedItem(XATTR_FILLCOLOR));
1000 CPPUNIT_ASSERT_EQUAL(ColorData(0x3333CC), rColorItem.GetColorValue().GetColor());
1003 // Third shape's background color is defined by direct formatting
1005 SdrObject *const pObj = pPage->GetObj(2);
1006 CPPUNIT_ASSERT(pObj);
1008 const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
1009 pObj->GetMergedItem(XATTR_FILLSTYLE));
1010 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue());
1011 const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
1012 pObj->GetMergedItem(XATTR_FILLCOLOR));
1013 CPPUNIT_ASSERT_EQUAL(ColorData(0xFF0000), rColorItem.GetColorValue().GetColor());
1016 xDocShRef->DoClose();
1019 void SdImportTest::testShapeLineStyle()
1021 // Here the problem was that different line properties were applied in wrong order on the shape
1022 // Right order: 1) master slide line style, 2) theme, 3) direct formatting
1023 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("sd/qa/unit/data/pptx/ShapeLineProperties.pptx"), PPTX);
1025 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1026 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1027 const SdrPage *pPage = pDoc->GetPage(1);
1028 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
1030 // First shape's line style is defined on master slide
1032 SdrObject *const pObj = pPage->GetObj(0);
1033 CPPUNIT_ASSERT(pObj);
1035 const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
1036 pObj->GetMergedItem(XATTR_LINESTYLE));
1037 CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_DASH, rStyleItem.GetValue());
1039 const XLineColorItem& rColorItem = dynamic_cast<const XLineColorItem&>(
1040 pObj->GetMergedItem(XATTR_LINECOLOR));
1041 CPPUNIT_ASSERT_EQUAL(ColorData(0xFF0000), rColorItem.GetColorValue().GetColor());
1043 const XLineWidthItem& rWidthItem = dynamic_cast<const XLineWidthItem&>(
1044 pObj->GetMergedItem(XATTR_LINEWIDTH));
1045 CPPUNIT_ASSERT_EQUAL(sal_Int32(132), rWidthItem.GetValue());
1048 // Second shape's line style is defined by theme
1050 SdrObject *const pObj = pPage->GetObj(1);
1051 CPPUNIT_ASSERT(pObj);
1053 const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
1054 pObj->GetMergedItem(XATTR_LINESTYLE));
1055 CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, rStyleItem.GetValue());
1057 const XLineColorItem& rColorItem = dynamic_cast<const XLineColorItem&>(
1058 pObj->GetMergedItem(XATTR_LINECOLOR));
1059 CPPUNIT_ASSERT_EQUAL(ColorData(0x3333CC), rColorItem.GetColorValue().GetColor());
1061 const XLineWidthItem& rWidthItem = dynamic_cast<const XLineWidthItem&>(
1062 pObj->GetMergedItem(XATTR_LINEWIDTH));
1063 CPPUNIT_ASSERT_EQUAL(sal_Int32(35), rWidthItem.GetValue());
1066 // Third shape's line style is defined by direct formatting
1068 SdrObject *const pObj = pPage->GetObj(2);
1069 CPPUNIT_ASSERT(pObj);
1071 const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
1072 pObj->GetMergedItem(XATTR_LINESTYLE));
1073 CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, rStyleItem.GetValue());
1075 const XLineColorItem& rColorItem = dynamic_cast<const XLineColorItem&>(
1076 pObj->GetMergedItem(XATTR_LINECOLOR));
1077 CPPUNIT_ASSERT_EQUAL(ColorData(0x7030A0), rColorItem.GetColorValue().GetColor());
1079 const XLineWidthItem& rWidthItem = dynamic_cast<const XLineWidthItem&>(
1080 pObj->GetMergedItem(XATTR_LINEWIDTH));
1081 CPPUNIT_ASSERT_EQUAL(sal_Int32(176), rWidthItem.GetValue());
1084 xDocShRef->DoClose();
1087 void SdImportTest::testBnc862510_6()
1089 // Black text was imported instead of gray
1090 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc862510_6.pptx"), PPTX);
1092 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
1093 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1095 uno::Reference< drawing::XDrawPage > xPage(
1096 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1098 uno::Reference< beans::XPropertySet > xShape(
1099 xPage->getByIndex(0), uno::UNO_QUERY );
1100 CPPUNIT_ASSERT_MESSAGE( "no shape", xShape.is() );
1102 // Get first paragraph of the text
1103 uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
1104 CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
1105 uno::Reference<container::XEnumerationAccess> paraEnumAccess;
1106 paraEnumAccess.set(xText, uno::UNO_QUERY);
1107 uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
1108 uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
1109 uno::UNO_QUERY_THROW);
1111 // Get first run of the paragraph
1112 uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
1113 uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
1114 uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
1115 uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
1116 sal_Int32 nCharColor;
1117 xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
1119 // Color should be gray
1120 CPPUNIT_ASSERT_EQUAL( sal_Int32(0x8B8B8B), nCharColor );
1122 xDocShRef->DoClose();
1125 void SdImportTest::testBnc862510_7()
1127 // Title shape's text was aligned to left instead of center.
1128 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc862510_7.pptx"), PPTX);
1130 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
1131 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1133 uno::Reference< drawing::XDrawPage > xPage(
1134 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1136 uno::Reference< beans::XPropertySet > xShape(
1137 xPage->getByIndex(0), uno::UNO_QUERY );
1138 CPPUNIT_ASSERT_MESSAGE( "no shape", xShape.is() );
1140 // Get first paragraph
1141 uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
1142 CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
1143 uno::Reference<container::XEnumerationAccess> paraEnumAccess;
1144 paraEnumAccess.set(xText, uno::UNO_QUERY);
1145 uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
1146 uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
1147 uno::UNO_QUERY_THROW);
1148 uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
1150 sal_Int16 nParaAdjust = 0;
1151 xPropSet->getPropertyValue( "ParaAdjust" ) >>= nParaAdjust;
1152 CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(nParaAdjust));
1154 xDocShRef->DoClose();
1157 #if ENABLE_PDFIMPORT
1159 void SdImportTest::testPDFImport()
1161 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pdf/txtpic.pdf"), PDF);
1162 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1163 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1164 uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1165 uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1166 CPPUNIT_ASSERT_MESSAGE( "no exactly two shapes", xPage->getCount() == 2 );
1168 uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
1169 CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() );
1170 uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
1171 CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
1173 xDocShRef->DoClose();
1176 void SdImportTest::testPDFImportSkipImages()
1178 SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
1179 pParams->Put( SfxStringItem ( SID_FILE_FILTEROPTIONS, OUString("SkipImages") ) );
1181 ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pdf/txtpic.pdf"), PDF, pParams);
1182 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1183 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1184 uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1185 uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1186 CPPUNIT_ASSERT_MESSAGE( "no exactly one shape", xPage->getCount() == 1 );
1188 uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
1189 CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() );
1190 uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
1191 CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
1193 xDocShRef->DoClose();
1196 #endif
1198 void SdImportTest::testBulletSuffix()
1200 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n83889.pptx"), PPTX );
1202 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
1203 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1205 uno::Reference< drawing::XDrawPage > xPage(
1206 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1207 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1208 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1210 // check suffix of the char bullet
1211 const SdrPage *pPage = pDoc->GetPage(1);
1212 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
1213 SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
1214 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
1215 const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
1216 const SvxNumBulletItem *pNumFmt = dynamic_cast<const SvxNumBulletItem *>(aEdit.GetParaAttribs(1).GetItem(EE_PARA_NUMBULLET));
1217 CPPUNIT_ASSERT(pNumFmt);
1218 CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", OUString(pNumFmt->GetNumRule()->GetLevel(0).GetSuffix()), OUString("") );
1219 xDocShRef->DoClose();
1222 void SdImportTest::testBnc910045()
1224 // Problem with table style which defines cell color with fill style
1225 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bnc910045.pptx"), PPTX );
1227 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1228 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1229 const SdrPage *pPage = pDoc->GetPage(1);
1230 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
1232 sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
1233 CPPUNIT_ASSERT( pTableObj );
1234 uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
1235 uno::Reference< beans::XPropertySet > xCell;
1236 sal_Int32 nColor;
1238 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
1239 xCell->getPropertyValue("FillColor") >>= nColor;
1240 CPPUNIT_ASSERT_EQUAL(sal_Int32(5210557), nColor);
1243 void SdImportTest::testRowHeight()
1245 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n80340.pptx"), PPTX );
1247 SdDrawDocument *pDoc = xDocShRef->GetDoc();
1248 CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
1250 const SdrPage *pPage = pDoc->GetPage(1);
1251 CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
1253 sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
1254 CPPUNIT_ASSERT( pTableObj );
1256 sal_Int32 nHeight;
1257 const OUString sHeight("Height");
1258 uno::Reference< com::sun::star::table::XTable > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
1259 uno::Reference< com::sun::star::table::XTableRows > xRows( xTable->getRows(), uno::UNO_QUERY_THROW);
1260 uno::Reference< beans::XPropertySet > xRefRow( xRows->getByIndex(0), uno::UNO_QUERY_THROW );
1261 xRefRow->getPropertyValue( sHeight ) >>= nHeight;
1262 CPPUNIT_ASSERT_EQUAL( sal_Int32(508), nHeight);
1265 void SdImportTest::testTdf93830()
1267 // Text shape offset was ignored
1268 sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf93830.pptx"), PPTX);
1270 uno::Reference< drawing::XDrawPagesSupplier > xDoc(
1271 xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
1273 uno::Reference< drawing::XDrawPage > xPage(
1274 xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
1276 // Get the first text box from group shape
1277 uno::Reference< container::XIndexAccess > xShape( xPage->getByIndex(0), uno::UNO_QUERY );
1278 uno::Reference< beans::XPropertySet > xPropSet( xShape->getByIndex(2), uno::UNO_QUERY );
1279 CPPUNIT_ASSERT_MESSAGE( "no textbox shape", xPropSet.is() );
1281 sal_Int32 nTextLeftDistance = 0;
1282 xPropSet->getPropertyValue( "TextLeftDistance" ) >>= nTextLeftDistance;
1283 CPPUNIT_ASSERT_EQUAL(sal_Int32(4152), nTextLeftDistance);
1285 xDocShRef->DoClose();
1288 void SdImportTest::testTdf93097()
1290 // Throwing metadata import aborted the filter, check that metadata is now imported.
1291 sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf93097.pptx"), PPTX);
1292 uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY);
1293 uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
1294 CPPUNIT_ASSERT_EQUAL(OUString("ss"), xDocumentProperties->getTitle());
1295 xDocShRef->DoClose();
1298 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
1300 CPPUNIT_PLUGIN_IMPLEMENT();
1302 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */