diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-09 10:11:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-09 12:41:09 +0000 |
commit | 5a308b1239a09417507b0d05090ff2d3418d5133 (patch) | |
tree | 990fa9015a4107e4916691eb4dee80fa5713e96b /xmloff/source/chart | |
parent | c1a227600d0b16df283162d24f1a31f5c9cee474 (diff) |
V801: Decreased performance
Change-Id: Iba139ede7bd72e23c0b7a28a8a4ff38ea816725a
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLAxisContext.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 58 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLImport.cxx | 4 |
3 files changed, 38 insertions, 38 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 079dbb6cb0b4..502ef0838965 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -86,7 +86,7 @@ class DateScaleContext : public SvXMLImportContext public: DateScaleContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const Reference< beans::XPropertySet > xAxisProps ); + const Reference< beans::XPropertySet >& rAxisProps ); virtual ~DateScaleContext(); virtual void StartElement( const Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE; @@ -122,10 +122,10 @@ SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper, SchXMLAxisContext::~SchXMLAxisContext() {} -static Reference< chart::XAxis > lcl_getChartAxis(const SchXMLAxis& rCurrentAxis, const Reference< chart::XDiagram > xDiagram ) +static Reference< chart::XAxis > lcl_getChartAxis(const SchXMLAxis& rCurrentAxis, const Reference< chart::XDiagram >& rDiagram ) { Reference< chart::XAxis > xAxis; - Reference< chart::XAxisSupplier > xAxisSuppl( xDiagram, uno::UNO_QUERY ); + Reference< chart::XAxisSupplier > xAxisSuppl( rDiagram, uno::UNO_QUERY ); if( !xAxisSuppl.is() ) return xAxis; if( rCurrentAxis.nAxisIndex == 0 ) @@ -713,12 +713,12 @@ void SchXMLAxisContext::EndElement() namespace { -Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem > xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) +Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem >& rCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) { Reference< chart2::XAxis > xAxis; try { - xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); + xAxis = rCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ); } catch( uno::Exception & ) { @@ -884,9 +884,9 @@ DateScaleContext::DateScaleContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const Reference< beans::XPropertySet > xAxisProps ) : + const Reference< beans::XPropertySet >& rAxisProps ) : SvXMLImportContext( rImport, nPrefix, rLocalName ), - m_xAxisProps( xAxisProps ) + m_xAxisProps( rAxisProps ) { } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e5eec219988a..9b80507d1927 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -198,12 +198,12 @@ public: const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, bool bExportContent ); void exportAxis( enum XMLTokenEnum eDimension, enum XMLTokenEnum eAxisName, - const Reference< beans::XPropertySet > xAxisProps, const Reference< chart2::XAxis >& xChart2Axis, + const Reference< beans::XPropertySet >& rAxisProps, const Reference< chart2::XAxis >& rChart2Axis, const OUString& rCategoriesRanges, bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, bool bExportContent ); - void exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent ); - void exportDateScale( const Reference< beans::XPropertySet > xAxisProps ); - void exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent ); + void exportGrid( const Reference< beans::XPropertySet >& rGridProperties, bool bMajor, bool bExportContent ); + void exportDateScale( const Reference< beans::XPropertySet >& rAxisProps ); + void exportAxisTitle( const Reference< beans::XPropertySet >& rTitleProps, bool bExportContent ); void exportSeries( const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, @@ -961,13 +961,13 @@ void lcl_exportNumberFormat( const OUString& rPropertyName, const Reference< bea return aResult; } -bool lcl_exportDomainForThisSequence( const Reference< chart2::data::XDataSequence > xValues, OUString& rFirstRangeForThisDomainIndex, SvXMLExport& rExport ) +bool lcl_exportDomainForThisSequence( const Reference< chart2::data::XDataSequence >& rValues, OUString& rFirstRangeForThisDomainIndex, SvXMLExport& rExport ) { bool bDomainExported = false; - if( xValues.is()) + if( rValues.is()) { Reference< chart2::XChartDocument > xNewDoc( rExport.GetModel(), uno::UNO_QUERY ); - OUString aRange( lcl_ConvertRange( xValues->getSourceRangeRepresentation(), xNewDoc ) ); + OUString aRange( lcl_ConvertRange( rValues->getSourceRangeRepresentation(), xNewDoc ) ); //work around error in OOo 2.0 (problems with multiple series having a domain element) if( rFirstRangeForThisDomainIndex.isEmpty() || !aRange.equals(rFirstRangeForThisDomainIndex) ) @@ -2156,13 +2156,13 @@ namespace } } -void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XPropertySet > xAxisProps ) +void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XPropertySet >& rAxisProps ) { - if( !xAxisProps.is() ) + if( !rAxisProps.is() ) return; chart::TimeIncrement aIncrement; - if( (xAxisProps->getPropertyValue("TimeIncrement") >>= aIncrement) ) + if( (rAxisProps->getPropertyValue("TimeIncrement") >>= aIncrement) ) { sal_Int32 nTimeResolution = ::com::sun::star::chart::TimeUnit::DAY; if( aIncrement.TimeResolution >>= nTimeResolution ) @@ -2187,19 +2187,19 @@ void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XProperty } } -void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent ) +void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XPropertySet >& rTitleProps, bool bExportContent ) { - if( !xTitleProps.is() ) + if( !rTitleProps.is() ) return; - std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xTitleProps ); + std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( rTitleProps ); if( bExportContent ) { OUString aText; - Any aAny( xTitleProps->getPropertyValue( + Any aAny( rTitleProps->getPropertyValue( OUString( "String" ))); aAny >>= aText; - Reference< drawing::XShape > xShape( xTitleProps, uno::UNO_QUERY ); + Reference< drawing::XShape > xShape( rTitleProps, uno::UNO_QUERY ); if( xShape.is()) addPosition( xShape ); @@ -2216,11 +2216,11 @@ void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XProperty aPropertyStates.clear(); } -void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent ) +void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet >& rGridProperties, bool bMajor, bool bExportContent ) { - if( !xGridProperties.is() ) + if( !rGridProperties.is() ) return; - std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xGridProperties ); + std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( rGridProperties ); if( bExportContent ) { AddAutoStyleAttribute( aPropertyStates ); @@ -2238,17 +2238,17 @@ namespace { //returns true if a date scale needs to be exported -bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExport& rExport) +bool lcl_exportAxisType( const Reference< chart2::XAxis >& rChart2Axis, SvXMLExport& rExport) { bool bExportDateScale = false; - if( !xChart2Axis.is() ) + if( !rChart2Axis.is() ) return bExportDateScale; const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); if( nCurrentODFVersion <= SvtSaveOptions::ODFVER_012 )//do not export to ODF 1.2 or older return bExportDateScale; - chart2::ScaleData aScale( xChart2Axis->getScaleData() ); + chart2::ScaleData aScale( rChart2Axis->getScaleData() ); //#i25706#todo: change namespace for next ODF version sal_uInt16 nNameSpace = XML_NAMESPACE_CHART_EXT; @@ -2306,8 +2306,8 @@ void disableLinkedNumberFormat( void SchXMLExportHelper_Impl::exportAxis( enum XMLTokenEnum eDimension, enum XMLTokenEnum eAxisName, - const Reference< beans::XPropertySet > xAxisProps, - const Reference< chart2::XAxis >& xChart2Axis, + const Reference< beans::XPropertySet >& rAxisProps, + const Reference< chart2::XAxis >& rChart2Axis, const OUString& rCategoriesRange, bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, bool bExportContent ) @@ -2316,10 +2316,10 @@ void SchXMLExportHelper_Impl::exportAxis( SvXMLElementExport* pAxis = NULL; // get property states for autostyles - if( xAxisProps.is() && mxExpPropMapper.is() ) + if( rAxisProps.is() && mxExpPropMapper.is() ) { - lcl_exportNumberFormat( "NumberFormat", xAxisProps, mrExport ); - aPropertyStates = mxExpPropMapper->Filter( xAxisProps ); + lcl_exportNumberFormat( "NumberFormat", rAxisProps, mrExport ); + aPropertyStates = mxExpPropMapper->Filter( rAxisProps ); if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID) { @@ -2337,7 +2337,7 @@ void SchXMLExportHelper_Impl::exportAxis( mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, eAxisName ); AddAutoStyleAttribute( aPropertyStates ); // write style name if( !rCategoriesRange.isEmpty() ) - bExportDateScale = lcl_exportAxisType( xChart2Axis, mrExport ); + bExportDateScale = lcl_exportAxisType( rChart2Axis, mrExport ); // open axis element pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, true, true ); @@ -2350,12 +2350,12 @@ void SchXMLExportHelper_Impl::exportAxis( //date scale if( bExportDateScale ) - exportDateScale( xAxisProps ); + exportDateScale( rAxisProps ); Reference< beans::XPropertySet > xTitleProps; Reference< beans::XPropertySet > xMajorGridProps; Reference< beans::XPropertySet > xMinorGridProps; - Reference< chart::XAxis > xAxis( xAxisProps, uno::UNO_QUERY ); + Reference< chart::XAxis > xAxis( rAxisProps, uno::UNO_QUERY ); if( xAxis.is() ) { xTitleProps = bHasTitle ? xAxis->getAxisTitle() : 0; diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index ca1f63c02353..2c409e989c88 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -132,12 +132,12 @@ SchXMLImportHelper::~SchXMLImportHelper() SvXMLImportContext* SchXMLImportHelper::CreateChartContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const Reference< frame::XModel > xChartModel, + const Reference< frame::XModel >& rChartModel, const Reference< xml::sax::XAttributeList >& ) { SvXMLImportContext* pContext = 0; - Reference< chart::XChartDocument > xDoc( xChartModel, uno::UNO_QUERY ); + Reference< chart::XChartDocument > xDoc( rChartModel, uno::UNO_QUERY ); if( xDoc.is()) { mxChartDoc = xDoc; |