sd/qa/unit/data/pptx/n828390_3.pptx |binary sd/qa/unit/import-tests.cxx | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
New commits: commit eea8c671e42b91c8486e3796869d140d70b1a7eb Author: Muthu Subramanian <sumu...@collabora.com> Date: Thu Dec 12 18:54:00 2013 +0530 n#828390: Unit test for resetting char escapement. diff --git a/sd/qa/unit/data/pptx/n828390_3.pptx b/sd/qa/unit/data/pptx/n828390_3.pptx new file mode 100644 index 0000000..ad95758 Binary files /dev/null and b/sd/qa/unit/data/pptx/n828390_3.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index f912d11..630891c 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -50,6 +50,7 @@ public: void testFdo71075(); void testN828390(); void testN828390_2(); + void testN828390_3(); void testFdo68594(); CPPUNIT_TEST_SUITE(SdFiltersTest); @@ -61,6 +62,7 @@ public: CPPUNIT_TEST(testFdo71075); CPPUNIT_TEST(testN828390); CPPUNIT_TEST(testN828390_2); + CPPUNIT_TEST(testN828390_3); CPPUNIT_TEST(testFdo68594); CPPUNIT_TEST_SUITE_END(); @@ -248,6 +250,39 @@ void SdFiltersTest::testN828390_2() CPPUNIT_ASSERT(aEdit.GetText(1) == OUString("Standard Platform")); } +void SdFiltersTest::testN828390_3() +{ + bool bPassed = true; + ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n828390_3.pptx") ); + CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() ); + CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() ); + CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = pDoc->GetPage(1); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + + SdrObject *pObj = pPage->GetObj(0); + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj ); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + std::vector<EECharAttrib> rLst; + aEdit.GetCharAttribs(1, rLst); + for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it) + { + const SvxEscapementItem *pFontEscapement = dynamic_cast<const SvxEscapementItem *>((*it).pAttr); + if(pFontEscapement) + { + if( pFontEscapement->GetEsc() != 0 ) + { + bPassed = false; + break; + } + } + } + CPPUNIT_ASSERT_MESSAGE("CharEscapment not imported properly", bPassed); +} + void SdFiltersTest::testN778859() { ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/n778859.pptx")); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits