From eea8c671e42b91c8486e3796869d140d70b1a7eb Mon Sep 17 00:00:00 2001 From: Muthu Subramanian Date: Thu, 12 Dec 2013 18:54:00 +0530 Subject: n#828390: Unit test for resetting char escapement. --- sd/qa/unit/data/pptx/n828390_3.pptx | Bin 0 -> 34098 bytes sd/qa/unit/import-tests.cxx | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 sd/qa/unit/data/pptx/n828390_3.pptx (limited to 'sd') 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 000000000000..ad9575858cd0 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 f912d11a8ae1..630891ccacd4 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( pObj ); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + std::vector rLst; + aEdit.GetCharAttribs(1, rLst); + for( std::vector::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it) + { + const SvxEscapementItem *pFontEscapement = dynamic_cast((*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")); -- cgit