diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-04-08 19:10:23 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-06-03 09:12:34 -0430 |
commit | 5e1dfa9952724c1909acb3679369e3ec8e3f99ae (patch) | |
tree | a6a09ffe3b563136e6f8acef82f9ed6c91704c08 /xmloff | |
parent | b4b403305a32ca989fb4cff9c6a726ec937f1f9d (diff) |
Export errorbars attributes and styles to XML.
- Instead of exporting the errorbar data to the series in a global way now each errorbar has its own attributes depending on their user settings,
so we can have different data for each type bar (only when using ODF 1.2 extended) and still keeping it backward compatible with old formats.
Diffstat (limited to 'xmloff')
-rwxr-xr-x | xmloff/source/chart/SchXMLExport.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index c661ac293a94..f0c77838aec9 100755 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3121,7 +3121,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() ); /// Dont export X ErrorBars for older ODF versions. - if ( !bYError && nCurrentVersion < SvtSaveOptions::ODFVER_012 ) + if ( !bYError && nCurrentVersion != SvtSaveOptions::ODFVER_LATEST ) return; if (xSeriesProp.is()) @@ -3162,12 +3162,34 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe { if( bExportContent && nErrorBarStyle == chart::ErrorBarStyle::FROM_DATA ) { + uno::Reference< chart2::XChartDocument > xNewDoc(mrExport.GetModel(), uno::UNO_QUERY); + // register data ranges for error bars for export in local table ::std::vector< Reference< chart2::data::XDataSequence > > aErrorBarSequences( lcl_getErrorBarSequences( xErrorBarProp )); for( ::std::vector< Reference< chart2::data::XDataSequence > >::const_iterator aIt( aErrorBarSequences.begin()); aIt != aErrorBarSequences.end(); ++aIt ) { + if ( nCurrentVersion == SvtSaveOptions::ODFVER_LATEST ) + { + rtl::OUString aRole, aRange; + Reference< beans::XPropertySet > xSeqProp( *aIt, uno::UNO_QUERY_THROW ); + xSeqProp->getPropertyValue("Role") >>= aRole; + + aRange = lcl_ConvertRange((*aIt)->getSourceRangeRepresentation(), xNewDoc ); + + if ( aRole.indexOf("positive") != -1 ) + { + if ( bPositive ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ERROR_UPPER_RANGE, aRange ); + } + else + { + if ( bNegative ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ERROR_LOWER_RANGE, aRange ); + } + } + m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, *aIt )); } } |