diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-22 21:14:22 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-23 01:59:41 +0100 |
commit | 391220ef21d7d99a968437893ee1e783cdcdaf59 (patch) | |
tree | 5f95e1e2d05b0610d353d068402722f3ec512c3e /chart2 | |
parent | at least fix the crash when calling SdXImpressDocument::dispose for now (diff) | |
download | core-391220ef21d7d99a968437893ee1e783cdcdaf59.tar.gz core-391220ef21d7d99a968437893ee1e783cdcdaf59.zip |
add test for bnc#864396
Change-Id: I38d77a11acf6684cb583ba3e5ffb80f30f3f2fdc
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 23 | ||||
-rw-r--r-- | chart2/qa/extras/charttest.hxx | 15 | ||||
-rw-r--r-- | chart2/qa/extras/data/pptx/bnc864396.pptx | bin | 0 -> 41580 bytes |
3 files changed, 32 insertions, 6 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 9ca95b616435..2d4259b1102b 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -33,6 +33,7 @@ public: void testPPTXChartSeries(); void testPPTChartSeries(); void testODPChartSeries(); + void testBnc864396(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -50,9 +51,10 @@ public: * this causes the UT to crash in sd. * sd::DrawView::Notify tries to reset by calling sd::DrawViewShell::ResetActualPage */ -// CPPUNIT_TEST(testPPTChartSeries); -// CPPUNIT_TEST(testPPTXChartSeries); -// CPPUNIT_TEST(testODPChartSeries); + CPPUNIT_TEST(testPPTChartSeries); + CPPUNIT_TEST(testPPTXChartSeries); + CPPUNIT_TEST(testODPChartSeries); + CPPUNIT_TEST(testBnc864396); CPPUNIT_TEST_SUITE_END(); private: @@ -281,6 +283,21 @@ void Chart2ImportTest::testODPChartSeries() } +void Chart2ImportTest::testBnc864396() +{ + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/pptx/", "bnc864396.pptx"), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW ); + uno::Reference< chart::XChartDataArray > xChartDataArray(xDataProvider, uno::UNO_QUERY_THROW); + uno::Sequence< OUString > aRowLabels = xChartDataArray->getRowDescriptions(); + for(sal_Int32 i = 0; i < aRowLabels.getLength(); ++i) + { + OUString aExpected = OUString("cat") + OUString::number(i+1); + CPPUNIT_ASSERT_EQUAL(aExpected, aRowLabels[i]); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index def88c313aac..68b4c8835dd6 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -58,6 +58,8 @@ public: uno::Sequence < OUString > getImpressChartColumnDescriptions( const char* pDir, const char* pName ); OUString getFileExtension( const OUString& rFileName ); + uno::Reference< chart::XChartDocument > getChartDocFromImpress( const char* pDir, const char* pName ); + void loadDocx(const char* pDir, const char* pName); utl::TempFile reloadDocx(); virtual void setUp(); @@ -215,7 +217,7 @@ uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XC return seriesList; } -uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const char* pDir, const char* pName ) +uno::Reference< chart::XChartDocument > ChartTest::getChartDocFromImpress( const char* pDir, const char* pName ) { mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.comp.Draw.PresentationDocument"); uno::Reference< drawing::XDrawPagesSupplier > xDoc(mxComponent, uno::UNO_QUERY_THROW ); @@ -228,8 +230,15 @@ uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const c uno::Reference< frame::XModel > xDocModel; xShapeProps->getPropertyValue("Model") >>= xDocModel; CPPUNIT_ASSERT(xDocModel.is()); - uno::Reference< chart::XChartDocument > xChart1Doc( xDocModel, uno::UNO_QUERY_THROW ); - uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), uno::UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChartDoc( xDocModel, uno::UNO_QUERY_THROW ); + + return xChartDoc; +} + +uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const char* pDir, const char* pName ) +{ + uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromImpress( pDir, pName ); + uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartData.is()); uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions(); return seriesList; diff --git a/chart2/qa/extras/data/pptx/bnc864396.pptx b/chart2/qa/extras/data/pptx/bnc864396.pptx Binary files differnew file mode 100644 index 000000000000..e2e05c51613e --- /dev/null +++ b/chart2/qa/extras/data/pptx/bnc864396.pptx |