diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-22 10:22:42 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-22 13:57:32 +0200 |
commit | 13861b853fd707c9f288197302fb76db32c8dc66 (patch) | |
tree | dd72f51eede06c98e2bd94d050b09106c3577105 /xmloff/source/chart/PropertyMaps.cxx | |
parent | 4475e4f3d94f312798dd90f8a8b861f981e0fd22 (diff) |
get the handling of error bar ranges correct in xmloff
We finally produce valid files again for error bars export. Additionally
we don't export unnecessary attributes anymore.
Change-Id: Idc4b4259c47a945e3679dac1a9810cd9f1f05bac
Diffstat (limited to 'xmloff/source/chart/PropertyMaps.cxx')
-rw-r--r-- | xmloff/source/chart/PropertyMaps.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index b6590c072c89..9962a09d0f5d 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -52,6 +52,8 @@ #include <com/sun/star/drawing/LineJoint.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartAxisPosition.hpp> +#include <com/sun/star/chart2/XChartDocument.hpp> +#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> // header for any2enum #include <comphelper/extract.hxx> @@ -344,6 +346,22 @@ void XMLChartExportPropertyMapper::handleElementItem( } } +namespace { + +OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc ) +{ + OUString aResult = rRange; + if( !xDoc.is() ) + return aResult; + uno::Reference< chart2::data::XRangeXMLConversion > xConversion( + xDoc->getDataProvider(), uno::UNO_QUERY ); + if( xConversion.is()) + aResult = xConversion->convertRangeToXML( rRange ); + return aResult; +} + +} + void XMLChartExportPropertyMapper::handleSpecialItem( SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, @@ -440,6 +458,14 @@ void XMLChartExportPropertyMapper::handleSpecialItem( break; } + case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE: + { + OUString aRangeStr; + rProperty.maValue >>= aRangeStr; + sValueBuffer.append(convertRange(aRangeStr, mxChartDoc)); + } + break; + default: bHandled = sal_False; break; @@ -460,6 +486,11 @@ void XMLChartExportPropertyMapper::handleSpecialItem( } } +void XMLChartExportPropertyMapper::setChartDoc( uno::Reference< chart2::XChartDocument > xChartDoc ) +{ + mxChartDoc = xChartDoc; +} + // ---------------------------------------- XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, @@ -582,6 +613,12 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( } break; + case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE: + { + rProperty.maValue <<= rValue; + } + break; + // deprecated from 6.0 beta on case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME: rProperty.maValue <<= mrImport.ResolveGraphicObjectURL( rValue, sal_False ); |