diff options
Diffstat (limited to 'chart2/source/model/template/NetChartTypeTemplate.cxx')
-rw-r--r-- | chart2/source/model/template/NetChartTypeTemplate.cxx | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx index e348b32b7bc6..9b2c089b7298 100644 --- a/chart2/source/model/template/NetChartTypeTemplate.cxx +++ b/chart2/source/model/template/NetChartTypeTemplate.cxx @@ -64,11 +64,13 @@ NetChartTypeTemplate::NetChartTypeTemplate( const ::rtl::OUString & rServiceName, StackMode eStackMode, bool bSymbols, - bool bHasLines ) : + bool bHasLines , + bool bHasFilledArea ) : ChartTypeTemplate( xContext, rServiceName ), m_eStackMode( eStackMode ), m_bHasSymbols( bSymbols ), - m_bHasLines( bHasLines ) + m_bHasLines( bHasLines ), + m_bHasFilledArea( bHasFilledArea ) {} NetChartTypeTemplate::~NetChartTypeTemplate() @@ -110,11 +112,18 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate( { sal_Bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties ); - // check symbol-style - // for a template with symbols it is ok, if there is at least one series - // with symbols, otherwise an unknown template is too easy to achieve + uno::Reference< beans::XPropertySet > xChartTypeProp( + DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), uno::UNO_QUERY_THROW ); + if( bResult ) { + //filled net chart?: + if( m_bHasFilledArea ) + return sal_True; + + // check symbol-style + // for a template with symbols it is ok, if there is at least one series + // with symbols, otherwise an unknown template is too easy to achieve bool bSymbolFound = false; bool bLineFound = false; @@ -182,8 +191,13 @@ Reference< chart2::XChartType > NetChartTypeTemplate::getChartTypeForIndex( sal_ { Reference< lang::XMultiServiceFactory > xFact( GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW ); - xResult.set( xFact->createInstance( - CHART2_SERVICE_NAME_CHARTTYPE_NET ), uno::UNO_QUERY_THROW ); + + if( m_bHasFilledArea ) + xResult.set( xFact->createInstance( + CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ), uno::UNO_QUERY_THROW ); + else + xResult.set( xFact->createInstance( + CHART2_SERVICE_NAME_CHARTTYPE_NET ), uno::UNO_QUERY_THROW ); } catch( uno::Exception & ex ) { |