diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-17 02:42:15 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-17 02:44:43 +0200 |
commit | 326f8dc37bc11591e7d683b21085da7ee15b8072 (patch) | |
tree | 2159b607fe79104309650f836db77599c32cf29f /chart2/qa/extras/charttest.hxx | |
parent | 0ce6d9bcea7c37a7cb2c42e8393e2e20780bd171 (diff) |
add test case for fdo#70609
Change-Id: I85ddd43f5c8e88c6f6bf19284b0822f8bbea1d44
Diffstat (limited to 'chart2/qa/extras/charttest.hxx')
-rw-r--r-- | chart2/qa/extras/charttest.hxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index 471346cdd30a..b3a0d31d57e7 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -238,6 +238,33 @@ Reference< chart2::data::XDataSequence > getLabelDataSequenceFromDoc( return Reference< chart2::data::XDataSequence > (); } +Reference< chart2::data::XDataSequence > getDataSequenceFromDocByRole( + Reference< chart2::XChartDocument > xChartDoc, const OUString& rRole, + sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0 ) +{ + Reference< chart2::XDataSeries > xDataSeries = + getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType, nCooSys ); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference< chart2::data::XDataSource > xDataSource( xDataSeries, uno::UNO_QUERY_THROW ); + Sequence< Reference< chart2::data::XLabeledDataSequence > > xDataSequences = + xDataSource->getDataSequences(); + for(sal_Int32 i = 0; i < xDataSequences.getLength(); ++i) + { + Reference< chart2::data::XDataSequence> xLabelSeq = xDataSequences[i]->getValues(); + uno::Reference< beans::XPropertySet > xProps(xLabelSeq, uno::UNO_QUERY); + if(!xProps.is()) + continue; + + OUString aRoleName = xProps->getPropertyValue("Role").get<OUString>(); + + if(aRoleName == rRole) + return xLabelSeq; + } + + CPPUNIT_FAIL("no Label sequence found"); + return Reference< chart2::data::XDataSequence > (); +} + uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XComponent > mxComponent ) { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); |