From e220bc9850e5afd7d622c0adc6665af88dd25dcb Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 26 Feb 2013 22:35:57 +0100 Subject: one more fix for error bar import, fdo#60083 This makes it finally possible to import the original test document. Change-Id: I5941f2ce303a28674dcf04aeabbbbc2d178c0913 Reviewed-on: https://gerrit.libreoffice.org/2434 Reviewed-by: Petr Mladek Tested-by: Petr Mladek --- xmloff/source/chart/SchXMLPlotAreaContext.cxx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index e5b16fd321ec..4463ebf4d999 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -980,8 +980,6 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume else aRoleBuffer.append( sal_Unicode( 'x' )); - rtl::OUString aPlainRole = aRoleBuffer.makeStringAndClear(); - aRoleBuffer.append( aPlainRole ); aRoleBuffer.append( sal_Unicode( '-' )); if( bPositiveValue ) @@ -1040,7 +1038,7 @@ SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext() namespace { void SetErrorBarPropertiesFromStyleName( const OUString& aStyleName, uno::Reference< beans::XPropertySet> xBarProp, - SchXMLImportHelper& rImportHelper) + SchXMLImportHelper& rImportHelper, OUString& aPosRange, OUString& aNegRange) { const SvXMLStylesContext* pStylesCtxt = rImportHelper.GetAutoStylesContext(); const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(rImportHelper.GetChartFamilyID(), @@ -1098,6 +1096,20 @@ void SetErrorBarPropertiesFromStyleName( const OUString& aStyleName, uno::Refere xBarProp->setPropertyValue("NegativeError", aAny); } + aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangePositive", + pSeriesStyleContext, pStylesCtxt); + if( aAny.hasValue() ) + { + aAny >>= aPosRange; + } + + aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangeNegative", + pSeriesStyleContext, pStylesCtxt); + if( aAny.hasValue() ) + { + aAny >>= aNegRange; + } + switch(aBarStyle) { case com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN: @@ -1183,8 +1195,8 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax // first import defaults from parent style - SetErrorBarPropertiesFromStyleName( maSeriesStyleName, xBarProp, mrImportHelper ); - SetErrorBarPropertiesFromStyleName( sAutoStyleName, xBarProp, mrImportHelper ); + SetErrorBarPropertiesFromStyleName( maSeriesStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange ); + SetErrorBarPropertiesFromStyleName( sAutoStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange ); uno::Reference< chart2::XChartDocument > xDoc(GetImport().GetModel(),uno::UNO_QUERY); -- cgit