[Libreoffice-commits] core.git: sd/qa
Muthu Subramanian
sumuthu at collabora.com
Mon Dec 30 04:34:56 PST 2013
sd/qa/unit/data/pptx/cshapes.pptx |binary
sd/qa/unit/import-tests.cxx | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+)
New commits:
commit ee6eadfc617a1ce3bc2b489523ac713b99482404
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Mon Dec 30 18:05:48 2013 +0530
fdo#72998: Add unit test case.
diff --git a/sd/qa/unit/data/pptx/cshapes.pptx b/sd/qa/unit/data/pptx/cshapes.pptx
new file mode 100644
index 0000000..b546206
Binary files /dev/null and b/sd/qa/unit/data/pptx/cshapes.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index cd6f9b0..015b6e1 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"));
More information about the Libreoffice-commits
mailing list