diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-04-30 01:20:36 +0200 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2014-05-05 20:09:35 +0000 |
commit | 206d59068e1293382a6d11b4caef7ebbd323fb86 (patch) | |
tree | e2b4661076aea52289d050a83111f9deca9663ca | |
parent | 8a14eb18ffc34ab6d7afb8ab0abeb878b3ad2b11 (diff) |
set graphic properties for error bars during import, fdo#78041
Change-Id: I43138745b074dcacdafa090d97eeb9aa2ccecf78
Reviewed-on: https://gerrit.libreoffice.org/9233
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r-- | chart2/source/tools/ErrorBar.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index cd55836eea29..5a639bf7e7d0 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -165,7 +165,7 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny else if(rPropName == "ShowNegativeError") rAny >>= mbShowNegativeError; else if(rPropName == "ErrorBarRangePositive" || rPropName == "ErrorBarRangeNegative") - throw uno::RuntimeException("read-only property", static_cast< uno::XWeak*>(this)); + throw beans::UnknownPropertyException("read-only property", static_cast< uno::XWeak*>(this)); else LineProperties::setPropertyValue(rPropName, rAny); diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index c72f1afab145..e55b77144c72 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -1011,6 +1011,19 @@ SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext() namespace { +void SetErrorBarStyleProperties( const OUString& rStyleName, uno::Reference< beans::XPropertySet > xBarProp, + SchXMLImportHelper& rImportHelper ) +{ + const SvXMLStylesContext* pStylesCtxt = rImportHelper.GetAutoStylesContext(); + const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(rImportHelper.GetChartFamilyID(), + rStyleName); + + XMLPropStyleContext * pSeriesStyleContext = + const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle )); + + pSeriesStyleContext->FillPropertySet( xBarProp ); +} + void SetErrorBarPropertiesFromStyleName( const OUString& aStyleName, uno::Reference< beans::XPropertySet> xBarProp, SchXMLImportHelper& rImportHelper, OUString& aPosRange, OUString& aNegRange) { @@ -1177,6 +1190,8 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax xBarProp->setPropertyValue("ShowNegativeError",uno::makeAny(sal_True)); // first import defaults from parent style + SetErrorBarStyleProperties( maSeriesStyleName, xBarProp, mrImportHelper ); + SetErrorBarStyleProperties( sAutoStyleName, xBarProp, mrImportHelper ); SetErrorBarPropertiesFromStyleName( maSeriesStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange ); SetErrorBarPropertiesFromStyleName( sAutoStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange ); |