From 3a25a6503dea6dcbcca676f2d9ae741b8ed1696f Mon Sep 17 00:00:00 2001 From: Muthu Subramanian Date: Mon, 10 Sep 2012 18:28:58 +0530 Subject: n#778859: Add unit test case. --- sd/qa/unit/data/pptx/n778859.pptx | Bin 0 -> 32444 bytes sd/qa/unit/filters-test.cxx | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 sd/qa/unit/data/pptx/n778859.pptx (limited to 'sd/qa/unit') diff --git a/sd/qa/unit/data/pptx/n778859.pptx b/sd/qa/unit/data/pptx/n778859.pptx new file mode 100644 index 000000000000..034cfc5445b6 Binary files /dev/null and b/sd/qa/unit/data/pptx/n778859.pptx differ diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx index 2b474bc442c6..b5ae8032cc63 100644 --- a/sd/qa/unit/filters-test.cxx +++ b/sd/qa/unit/filters-test.cxx @@ -70,9 +70,11 @@ public: void test(); // Ensure CVEs remain unbroken void testCVEs(); + void testN778859(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(test); + CPPUNIT_TEST(testN778859); CPPUNIT_TEST(testCVEs); CPPUNIT_TEST_SUITE_END(); @@ -158,6 +160,24 @@ void SdFiltersTest::test() xDocShRef->DoClose(); } +void SdFiltersTest::testN778859() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/n778859.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 ); + { + // Get the object + SdrObject *pObj = pPage->GetObj(1); + SdrTextObj *pTxtObj = dynamic_cast( pObj ); + CPPUNIT_ASSERT(!pTxtObj->IsAutoFit()); + } +} + bool SdFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData) { -- cgit