summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2013-12-30 18:05:48 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2013-12-30 18:07:00 +0530
commitee6eadfc617a1ce3bc2b489523ac713b99482404 (patch)
tree517effb90e7ff43eaa77eea2f52d73ba2b0ea85b /sd
parentb104133abe2a377f1397cce3fa6e1bc7d85d4020 (diff)
fdo#72998: Add unit test case.
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/cshapes.pptxbin0 -> 173125 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/cshapes.pptx b/sd/qa/unit/data/pptx/cshapes.pptx
new file mode 100644
index 000000000000..b546206256c6
--- /dev/null
+++ b/sd/qa/unit/data/pptx/cshapes.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index cd6f9b0f7403..015b6e1dc6b3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -22,6 +22,7 @@
#include <rsc/rscsfx.hxx>
#include <svx/svdotext.hxx>
+#include <svx/svdoashp.hxx>
#include <animations/animationnodehelper.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -57,6 +58,7 @@ public:
void testN828390_4();
void testN828390_5();
void testFdo68594();
+ void testFdo72998();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -71,6 +73,7 @@ public:
CPPUNIT_TEST(testN828390_4);
CPPUNIT_TEST(testN828390_5);
CPPUNIT_TEST(testFdo68594);
+ CPPUNIT_TEST(testFdo72998);
CPPUNIT_TEST_SUITE_END();
};
@@ -389,6 +392,29 @@ void SdFiltersTest::testFdo68594()
CPPUNIT_ASSERT_MESSAGE( "Placeholder color mismatch", pC->GetValue().GetColor() == 0);
}
+void SdFiltersTest::testFdo72998()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/cshapes.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 );
+ {
+ SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2));
+ const SdrCustomShapeGeometryItem& rGeometryItem = (const SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+ CPPUNIT_ASSERT_MESSAGE( "not a custom shape", pObj );
+ const ::com::sun::star::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
+ CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox );
+ com::sun::star::awt::Rectangle aViewBox;
+ CPPUNIT_ASSERT( (*pViewBox >>= aViewBox ) );
+ CPPUNIT_ASSERT_MESSAGE( "Width should be zero - for forcing scale to 1", !aViewBox.Width );
+ CPPUNIT_ASSERT_MESSAGE( "Height should be zero - for forcing scale to 1", !aViewBox.Height );
+ }
+}
+
void SdFiltersTest::testFdo64512()
{
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"));