summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2013-12-12 18:54:00 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2013-12-12 18:54:00 +0530
commiteea8c671e42b91c8486e3796869d140d70b1a7eb (patch)
treea3b2ab513bee21317e0a67f3f070e24e907f978c /sd
parentfdf77f50ab825bd2b44e980552f3383acf637b12 (diff)
n#828390: Unit test for resetting char escapement.
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/n828390_3.pptxbin0 -> 34098 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx35
2 files changed, 35 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/n828390_3.pptx
Binary files 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<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"));