From 979c8c56b7d52fe9a5d4b1fbfdab0adaba04c470 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 25 Jun 2017 18:20:04 +0200 Subject: loplugin:oncevar in oox..sax Change-Id: I0fee8bcddaeea48335e3be05761d2ad2c45020e2 Reviewed-on: https://gerrit.libreoffice.org/39238 Tested-by: Jenkins Reviewed-by: Noel Grandin --- oox/source/export/ColorPropertySet.cxx | 3 +-- oox/source/export/chartexport.cxx | 15 +++++---------- oox/source/export/shapes.cxx | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) (limited to 'oox/source/export') diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx index 768763bf91d4..ec25b10c3c49 100644 --- a/oox/source/export/ColorPropertySet.cxx +++ b/oox/source/export/ColorPropertySet.cxx @@ -120,8 +120,7 @@ uno::Any SAL_CALL ColorPropertySet::getPropertyValue( const OUString& aPropertyN { if( aPropertyName == "FillStyle" && m_bIsFillColor ) { - css::drawing::FillStyle aFillStyle = css::drawing::FillStyle_SOLID; - return uno::makeAny(aFillStyle); + return uno::makeAny(css::drawing::FillStyle_SOLID); } else if (aPropertyName == m_aColorPropName) return uno::makeAny( m_nColor ); diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index d893cc678cb8..2d2d5fdd3536 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -781,8 +781,7 @@ void ChartExport::exportExternalData( const Reference< css::chart::XChartDocumen // Converting absolute path to relative path. if( externalDataPath[ 0 ] != '.' && externalDataPath[ 1 ] != '.') { - sal_Int32 nStartPos = 0; - sal_Int32 nSepPos = externalDataPath.indexOf( '/', nStartPos ); + sal_Int32 nSepPos = externalDataPath.indexOf( '/', 0 ); if( nSepPos > 0) { relationPath = relationPath.copy( nSepPos, ::std::max< sal_Int32 >( externalDataPath.getLength(), 0 ) - nSepPos ); @@ -1630,9 +1629,8 @@ void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xC // firstSliceAng exportFirstSliceAng( ); //FIXME: holeSize - sal_Int32 nHoleSize = 50; pFS->singleElement( FSNS( XML_c, XML_holeSize ), - XML_val, I32S( nHoleSize ), + XML_val, I32S( 50 ), FSEND ); pFS->endElement( FSNS( XML_c, XML_doughnutChart ) ); @@ -1876,9 +1874,8 @@ void ChartExport::exportUpDownBars( const Reference< chart2::XChartType >& xChar pFS->startElement( FSNS( XML_c, XML_upDownBars ), FSEND ); // TODO: gapWidth - sal_Int32 nGapWidth = 150; pFS->singleElement( FSNS( XML_c, XML_gapWidth ), - XML_val, I32S( nGapWidth ), + XML_val, I32S( 150 ), FSEND ); Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getUpBar(); @@ -2626,9 +2623,8 @@ void ChartExport::_exportAxis( if( bLogarithmic ) { // default value is 10? - sal_Int32 nLogBase = 10; pFS->singleElement( FSNS( XML_c, XML_logBase ), - XML_val, I32S( nLogBase ), + XML_val, I32S( 10 ), FSEND ); } } @@ -2871,9 +2867,8 @@ void ChartExport::_exportAxis( } // FIXME: seems not support? lblOffset - sal_Int32 nLblOffset = 100; pFS->singleElement( FSNS( XML_c, XML_lblOffset ), - XML_val, I32S( nLblOffset ), + XML_val, I32S( 100 ), FSEND ); } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 4775b1bfb901..ff909e7bc625 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -970,9 +970,8 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); if( nAdjustmentValuesIndex != -1 ) { - sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0; WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed, - nAdjustmentsWhichNeedsToBeConverted, aGeometrySeq[ nAdjustmentValuesIndex ] ); + 0/*nAdjustmentsWhichNeedsToBeConverted*/, aGeometrySeq[ nAdjustmentValuesIndex ] ); } else WritePresetShape( sPresetShape ); -- cgit