summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-08-14 17:04:40 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-08-14 17:04:40 +0530
commit3ccb8dac1405dc4ffa0ca3c45bd0724cc339d8ad (patch)
tree1fe5ae808b41458624624a9cd29502aa5bb290ad /sd
parente3acf19c0502b0758359b56abda81e504d167630 (diff)
Adding unit test case for n#759180
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/n759180.pptxbin0 -> 39463 bytes
-rw-r--r--sd/qa/unit/regression-test.cxx45
2 files changed, 45 insertions, 0 deletions
diff --git a/sd/qa/unit/data/n759180.pptx b/sd/qa/unit/data/n759180.pptx
new file mode 100644
index 000000000000..16cbf9adbda3
--- /dev/null
+++ b/sd/qa/unit/data/n759180.pptx
Binary files differ
diff --git a/sd/qa/unit/regression-test.cxx b/sd/qa/unit/regression-test.cxx
index 787291b6e44f..342d6a88ce2b 100644
--- a/sd/qa/unit/regression-test.cxx
+++ b/sd/qa/unit/regression-test.cxx
@@ -60,6 +60,11 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <drawinglayer/XShapeDumper.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/outlobj.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/fhgtitem.hxx>
+
/* Implementation of Filters test */
using namespace ::com::sun::star;
@@ -78,9 +83,11 @@ public:
virtual void tearDown();
void test();
+ void testN759180();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testN759180);
CPPUNIT_TEST_SUITE_END();
private:
@@ -152,6 +159,44 @@ void SdFiltersTest::test()
}*/
}
+void SdFiltersTest::testN759180()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/n759180.pptx"));
+ 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 );
+
+ //sal_uIntPtr nObjs = pPage->GetObjCount();
+ //for (sal_uIntPtr i = 0; i < nObjs; i++)
+ {
+ // Get the object
+ SdrObject *pObj = pPage->GetObj(0);
+ SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
+ CPPUNIT_ASSERT(pTxtObj);
+ std::vector<EECharAttrib> rLst;
+ const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
+ const SvxULSpaceItem *pULSpace = dynamic_cast<const SvxULSpaceItem *>(aEdit.GetParaAttribs(0).GetItem(EE_PARA_ULSPACE));
+ CPPUNIT_ASSERT(pULSpace);
+ CPPUNIT_ASSERT_MESSAGE( "Para bottom spacing is wrong!", pULSpace->GetLower() == 0 );
+ aEdit.GetCharAttribs(1, rLst);
+ for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); it++)
+ {
+ const SvxFontHeightItem * pFontHeight = dynamic_cast<const SvxFontHeightItem *>((*it).pAttr);
+ if(pFontHeight)
+ {
+ // nStart == 9
+ // font height = 5 => 5*2540/72
+ CPPUNIT_ASSERT_MESSAGE( "Font height is wrong", pFontHeight->GetHeight() == 176 );
+ break;
+ }
+ }
+ }
+}
+
void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef, const rtl::OString& fileNameBase)
{
CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );