[Libreoffice-commits] core.git: sd/qa

Muthu Subramanian sumuthu at collabora.com
Mon Mar 17 01:36:11 PDT 2014


 sd/qa/unit/data/pptx/n862510_1.pptx |binary
 sd/qa/unit/import-tests.cxx         |   27 +++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

New commits:
commit 2796aa203c563d45b12dd395a963724a1c0e42ed
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Mon Mar 17 14:06:34 2014 +0530

    n#862510: Adding unit test case for baseline=0
    
    Change-Id: Ia8281ddc31b653ecf47c6bb5030db74de75b2e8d

diff --git a/sd/qa/unit/data/pptx/n862510_1.pptx b/sd/qa/unit/data/pptx/n862510_1.pptx
new file mode 100644
index 0000000..2a16a4b
Binary files /dev/null and b/sd/qa/unit/data/pptx/n862510_1.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index eb3b56d..8ea16b5 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -61,6 +61,7 @@ public:
     void testFdo68594();
     void testFdo72998();
     void testStrictOOXML();
+    void testN862510_1();
 
     CPPUNIT_TEST_SUITE(SdFiltersTest);
     CPPUNIT_TEST(testDocumentLayout);
@@ -78,6 +79,7 @@ public:
     CPPUNIT_TEST(testFdo68594);
     CPPUNIT_TEST(testFdo72998);
     CPPUNIT_TEST(testStrictOOXML);
+    CPPUNIT_TEST(testN862510_1);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -235,6 +237,31 @@ void SdFiltersTest::testN821567()
     CPPUNIT_ASSERT_MESSAGE("Slide Background is not exported properly", !bgImage.isEmpty());
 }
 
+void SdFiltersTest::testN862510_1()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n862510_1.pptx") );
+    CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
+    CPPUNIT_ASSERT_MESSAGE( "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 );
+    {
+        std::vector<EECharAttrib> rLst;
+        SdrObject *pObj = pPage->GetObj( 0 );
+        SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
+        CPPUNIT_ASSERT( pTxtObj );
+        const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
+        aEdit.GetCharAttribs( 0, rLst );
+        for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
+        {
+            const SvxEscapementItem *pFontEscapement = dynamic_cast<const SvxEscapementItem *>( (*it).pAttr );
+            CPPUNIT_ASSERT_MESSAGE( "Baseline attribute not handled properly", !( pFontEscapement && pFontEscapement->GetProp() != 100 ) );
+        }
+    }
+}
+
 void SdFiltersTest::testN828390()
 {
     bool bPassed = false;


More information about the Libreoffice-commits mailing list