From 9fd89a5952a48b473cee03a2681eb5d4cd6d1742 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hryniuk Date: Sun, 4 Jan 2015 22:50:05 +0100 Subject: fdo#39440 reduce scope of local variables Beside scope changes, it fixes lack of initialization in a few places. Change-Id: Ia09fdb9845d8ac17256330a5ec5168401c84f0f2 Reviewed-on: https://gerrit.libreoffice.org/13755 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- chart2/source/controller/main/DrawCommandDispatch.cxx | 2 +- chart2/source/tools/AxisHelper.cxx | 2 +- chart2/source/tools/DiagramHelper.cxx | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index af43e753ef57..8804bb9fcb26 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -287,13 +287,13 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea ChartDrawMode eDrawMode = CHARTDRAW_SELECT; SdrObjKind eKind = OBJ_NONE; - bool bCreate = false; sal_uInt16 nFeatureId = 0; OUString aBaseCommand; OUString aCustomShapeType; if ( parseCommandURL( rCommand, &nFeatureId, &aBaseCommand, &aCustomShapeType ) ) { + bool bCreate = false; m_nFeatureId = nFeatureId; m_aCustomShapeType = aCustomShapeType; diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index fc475d6b67a5..70b4a803c6ef 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -136,7 +136,6 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( , bool bSearchForParallelAxisIfNothingIsFound ) { sal_Int32 nNumberFormatKey(0); - bool bNumberFormatKeyFoundViaAttachedData = false; sal_Int32 nAxisIndex = 0; sal_Int32 nDimensionIndex = 1; AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex ); @@ -235,6 +234,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( { typedef ::std::map< sal_Int32, sal_Int32 > tNumberformatFrequency; tNumberformatFrequency aKeyMap; + bool bNumberFormatKeyFoundViaAttachedData = false; try { diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 77058510ca34..82dca03fcd16 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -1297,11 +1297,10 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed( { uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY ); - //find position of series. - bool bFound = false; - if( xGivenDataSeries.is() && xCooSysContainer.is() ) { + //find position of series. + bool bFound = false; uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); for( sal_Int32 nCS = 0; !bFound && nCS < aCooSysList.getLength(); ++nCS ) -- cgit