summaryrefslogtreecommitdiff
path: root/xmloff/source/chart
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 10:03:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 13:06:13 +0100
commit5f4938d89d641681346001746f3762dffcb831b4 (patch)
tree5e5f8d5bbf505cc9dafd7e9b2358f874c6f41774 /xmloff/source/chart
parent5b74eb68113d3721e1a3f9fa40024bf9b2a15f0c (diff)
loplugin:flatten in xmloff
Change-Id: I782278b8a633094b96788f81ae7066a45d45b5fe Reviewed-on: https://gerrit.libreoffice.org/44750 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx196
1 files changed, 99 insertions, 97 deletions
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 9209efa07ce0..875d3468fb49 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -869,45 +869,46 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
uno::Reference< chart2::data::XDataSequence > xNewSequence(
xDataProvider->createDataSequenceByRangeRepresentation( aRange ));
- if( xNewSequence.is())
- {
- SchXMLTools::setXMLRangePropertyAtDataSequence(xNewSequence,aXMLRange);
+ if( !xNewSequence.is())
+ return;
- OUStringBuffer aRoleBuffer("error-bars-");
- if( bYError )
- aRoleBuffer.append( 'y' );
- else
- aRoleBuffer.append( 'x');
+ SchXMLTools::setXMLRangePropertyAtDataSequence(xNewSequence,aXMLRange);
- aRoleBuffer.append( '-' );
+ OUStringBuffer aRoleBuffer("error-bars-");
+ if( bYError )
+ aRoleBuffer.append( 'y' );
+ else
+ aRoleBuffer.append( 'x');
- if( bPositiveValue )
- aRoleBuffer = aRoleBuffer.append( "positive" );
- else
- aRoleBuffer = aRoleBuffer.append( "negative" );
+ aRoleBuffer.append( '-' );
- OUString aRole = aRoleBuffer.makeStringAndClear();
+ if( bPositiveValue )
+ aRoleBuffer = aRoleBuffer.append( "positive" );
+ else
+ aRoleBuffer = aRoleBuffer.append( "negative" );
- Reference< beans::XPropertySet > xSeqProp( xNewSequence, uno::UNO_QUERY );
+ OUString aRole = aRoleBuffer.makeStringAndClear();
- xSeqProp->setPropertyValue("Role", uno::makeAny( aRole ));
+ Reference< beans::XPropertySet > xSeqProp( xNewSequence, uno::UNO_QUERY );
- Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ xSeqProp->setPropertyValue("Role", uno::makeAny( aRole ));
- Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext),
- uno::UNO_QUERY_THROW );
+ Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
- rSequences.emplace( tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq );
+ Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext),
+ uno::UNO_QUERY_THROW );
- xLabelSeq->setValues( xNewSequence );
+ rSequences.emplace( tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq );
- uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
- xDataSource->getDataSequences());
+ xLabelSeq->setValues( xNewSequence );
+
+ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences(
+ xDataSource->getDataSequences());
+
+ aSequences.realloc( aSequences.getLength() + 1 );
+ aSequences[ aSequences.getLength() - 1 ] = xLabelSeq;
+ xDataSink->setData( aSequences );
- aSequences.realloc( aSequences.getLength() + 1 );
- aSequences[ aSequences.getLength() - 1 ] = xLabelSeq;
- xDataSink->setData( aSequences );
- }
}
SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
@@ -962,100 +963,101 @@ void SetErrorBarPropertiesFromStyleName( const OUString& aStyleName, const uno::
uno::Any aAny = SchXMLTools::getPropertyFromContext("ErrorBarStyle",
pSeriesStyleContext,pStylesCtxt);
- if ( aAny.hasValue() )
- {
- sal_Int32 aBarStyle = css::chart::ErrorBarStyle::NONE;
- aAny >>= aBarStyle;
- xBarProp->setPropertyValue("ErrorBarStyle", aAny);
+ if ( !aAny.hasValue() )
+ return;
- aAny = SchXMLTools::getPropertyFromContext("ShowPositiveError",
- pSeriesStyleContext,pStylesCtxt);
+ sal_Int32 aBarStyle = css::chart::ErrorBarStyle::NONE;
+ aAny >>= aBarStyle;
+ xBarProp->setPropertyValue("ErrorBarStyle", aAny);
- if(aAny.hasValue())
- xBarProp->setPropertyValue("ShowPositiveError",aAny);
+ aAny = SchXMLTools::getPropertyFromContext("ShowPositiveError",
+ pSeriesStyleContext,pStylesCtxt);
- aAny = SchXMLTools::getPropertyFromContext("ShowNegativeError",
- pSeriesStyleContext,pStylesCtxt);
+ if(aAny.hasValue())
+ xBarProp->setPropertyValue("ShowPositiveError",aAny);
- if(aAny.hasValue())
- xBarProp->setPropertyValue("ShowNegativeError",aAny);
+ aAny = SchXMLTools::getPropertyFromContext("ShowNegativeError",
+ pSeriesStyleContext,pStylesCtxt);
+
+ if(aAny.hasValue())
+ xBarProp->setPropertyValue("ShowNegativeError",aAny);
+
+ aAny = SchXMLTools::getPropertyFromContext("PositiveError",
+ pSeriesStyleContext, pStylesCtxt);
- aAny = SchXMLTools::getPropertyFromContext("PositiveError",
+ if(aAny.hasValue())
+ xBarProp->setPropertyValue("PositiveError", aAny);
+ else
+ {
+ aAny = SchXMLTools::getPropertyFromContext("ConstantErrorHigh",
pSeriesStyleContext, pStylesCtxt);
if(aAny.hasValue())
xBarProp->setPropertyValue("PositiveError", aAny);
- else
- {
- aAny = SchXMLTools::getPropertyFromContext("ConstantErrorHigh",
- pSeriesStyleContext, pStylesCtxt);
+ }
- if(aAny.hasValue())
- xBarProp->setPropertyValue("PositiveError", aAny);
- }
+ aAny = SchXMLTools::getPropertyFromContext("NegativeError",
+ pSeriesStyleContext, pStylesCtxt);
- aAny = SchXMLTools::getPropertyFromContext("NegativeError",
+ if(aAny.hasValue())
+ xBarProp->setPropertyValue("NegativeError", aAny);
+ else
+ {
+ aAny = SchXMLTools::getPropertyFromContext("ConstantErrorLow",
pSeriesStyleContext, pStylesCtxt);
if(aAny.hasValue())
xBarProp->setPropertyValue("NegativeError", aAny);
- else
- {
- aAny = SchXMLTools::getPropertyFromContext("ConstantErrorLow",
- pSeriesStyleContext, pStylesCtxt);
-
- if(aAny.hasValue())
- xBarProp->setPropertyValue("NegativeError", aAny);
- }
+ }
- aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangePositive",
- pSeriesStyleContext, pStylesCtxt);
- if( aAny.hasValue() )
- {
- aAny >>= aPosRange;
- }
+ aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangePositive",
+ pSeriesStyleContext, pStylesCtxt);
+ if( aAny.hasValue() )
+ {
+ aAny >>= aPosRange;
+ }
- aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangeNegative",
- pSeriesStyleContext, pStylesCtxt);
- if( aAny.hasValue() )
- {
- aAny >>= aNegRange;
- }
+ aAny = SchXMLTools::getPropertyFromContext("ErrorBarRangeNegative",
+ pSeriesStyleContext, pStylesCtxt);
+ if( aAny.hasValue() )
+ {
+ aAny >>= aNegRange;
+ }
- aAny = SchXMLTools::getPropertyFromContext("Weight",
- pSeriesStyleContext, pStylesCtxt);
- if( aAny.hasValue() )
- {
- xBarProp->setPropertyValue("Weight", aAny);
- }
+ aAny = SchXMLTools::getPropertyFromContext("Weight",
+ pSeriesStyleContext, pStylesCtxt);
+ if( aAny.hasValue() )
+ {
+ xBarProp->setPropertyValue("Weight", aAny);
+ }
- aAny = SchXMLTools::getPropertyFromContext("PercentageError",
- pSeriesStyleContext, pStylesCtxt);
- if( aAny.hasValue() && aBarStyle == css::chart::ErrorBarStyle::RELATIVE )
- {
- xBarProp->setPropertyValue("PositiveError", aAny);
- xBarProp->setPropertyValue("NegativeError", aAny);
- }
+ aAny = SchXMLTools::getPropertyFromContext("PercentageError",
+ pSeriesStyleContext, pStylesCtxt);
+ if( aAny.hasValue() && aBarStyle == css::chart::ErrorBarStyle::RELATIVE )
+ {
+ xBarProp->setPropertyValue("PositiveError", aAny);
+ xBarProp->setPropertyValue("NegativeError", aAny);
+ }
- switch(aBarStyle)
- {
- case css::chart::ErrorBarStyle::ERROR_MARGIN:
- {
- aAny = SchXMLTools::getPropertyFromContext("NegativeError",
- pSeriesStyleContext,pStylesCtxt);
+ switch(aBarStyle)
+ {
+ case css::chart::ErrorBarStyle::ERROR_MARGIN:
+ {
+ aAny = SchXMLTools::getPropertyFromContext("NegativeError",
+ pSeriesStyleContext,pStylesCtxt);
- xBarProp->setPropertyValue("NegativeError",aAny);
+ xBarProp->setPropertyValue("NegativeError",aAny);
- aAny = SchXMLTools::getPropertyFromContext("PositiveError",
- pSeriesStyleContext,pStylesCtxt);
+ aAny = SchXMLTools::getPropertyFromContext("PositiveError",
+ pSeriesStyleContext,pStylesCtxt);
- xBarProp->setPropertyValue("PositiveError",aAny);
- }
- break;
- default:
- break;
- }
+ xBarProp->setPropertyValue("PositiveError",aAny);
+ }
+ break;
+ default:
+ break;
}
+
}
}