summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-12-17 23:00:24 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-18 07:36:32 +0100
commit4e144751f12a06e358e4f7efa7c8f13954e6cfd7 (patch)
treec6df66d58d02ecaf5caa437a944665fe83959402 /chart2/source/tools
parent39c618caf5aa19da95285bec6cab7108bee3984c (diff)
loplugin:unusedindex
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx40
-rw-r--r--chart2/source/tools/XMLRangeHelper.cxx6
2 files changed, 20 insertions, 26 deletions
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 7ade8542e4b7..768b75c7ca3c 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -196,31 +196,29 @@ void DataSourceHelper::readArguments( const uno::Sequence< beans::PropertyValue
, OUString & rRangeRepresentation, uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories )
{
- const beans::PropertyValue* pArguments = rArguments.getConstArray();
- for(sal_Int32 i=0; i<rArguments.getLength(); ++i, ++pArguments)
+ for(const beans::PropertyValue& rProperty : rArguments)
{
- const beans::PropertyValue& aProperty = *pArguments;
- if ( aProperty.Name == "DataRowSource" )
+ if ( rProperty.Name == "DataRowSource" )
{
css::chart::ChartDataRowSource eRowSource;
- if( aProperty.Value >>= eRowSource )
+ if( rProperty.Value >>= eRowSource )
bUseColumns = (eRowSource==css::chart::ChartDataRowSource_COLUMNS);
}
- else if ( aProperty.Name == "FirstCellAsLabel" )
+ else if ( rProperty.Name == "FirstCellAsLabel" )
{
- aProperty.Value >>= bFirstCellAsLabel;
+ rProperty.Value >>= bFirstCellAsLabel;
}
- else if ( aProperty.Name == "HasCategories" )
+ else if ( rProperty.Name == "HasCategories" )
{
- aProperty.Value >>= bHasCategories;
+ rProperty.Value >>= bHasCategories;
}
- else if ( aProperty.Name == "CellRangeRepresentation" )
+ else if ( rProperty.Name == "CellRangeRepresentation" )
{
- aProperty.Value >>= rRangeRepresentation;
+ rProperty.Value >>= rRangeRepresentation;
}
- else if ( aProperty.Name == "SequenceMapping" )
+ else if ( rProperty.Name == "SequenceMapping" )
{
- aProperty.Value >>= rSequenceMapping;
+ rProperty.Value >>= rSequenceMapping;
}
}
}
@@ -398,26 +396,24 @@ bool DataSourceHelper::allArgumentsForRectRangeDetected(
{
const uno::Sequence< beans::PropertyValue > aArguments(
xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument )));
- const beans::PropertyValue* pArguments = aArguments.getConstArray();
- for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
+ for(const beans::PropertyValue& rProperty : aArguments)
{
- const beans::PropertyValue& aProperty = *pArguments;
- if ( aProperty.Name == "DataRowSource" )
+ if ( rProperty.Name == "DataRowSource" )
{
bHasDataRowSource =
- (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(
+ (rProperty.Value.hasValue() && rProperty.Value.isExtractableTo(
cppu::UnoType<css::chart::ChartDataRowSource>::get()));
}
- else if ( aProperty.Name == "FirstCellAsLabel" )
+ else if ( rProperty.Name == "FirstCellAsLabel" )
{
bHasFirstCellAsLabel =
- (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(cppu::UnoType<bool>::get()));
+ (rProperty.Value.hasValue() && rProperty.Value.isExtractableTo(cppu::UnoType<bool>::get()));
}
- else if ( aProperty.Name == "CellRangeRepresentation" )
+ else if ( rProperty.Name == "CellRangeRepresentation" )
{
OUString aRange;
bHasCellRangeRepresentation =
- (aProperty.Value.hasValue() && (aProperty.Value >>= aRange) && !aRange.isEmpty());
+ (rProperty.Value.hasValue() && (rProperty.Value >>= aRange) && !aRange.isEmpty());
}
}
}
diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx
index 95d91181d2e7..72f9df8c6280 100644
--- a/chart2/source/tools/XMLRangeHelper.cxx
+++ b/chart2/source/tools/XMLRangeHelper.cxx
@@ -296,17 +296,15 @@ CellRange getCellRangeFromXMLString( const OUString & rXMLString )
static const sal_Unicode aDollar( '$' );
static const sal_Unicode aBackslash( '\\' );
- sal_Int32 nStartPos = 0;
- sal_Int32 nEndPos = nStartPos;
const sal_Int32 nLength = rXMLString.getLength();
// reset
CellRange aResult;
// iterate over different ranges
- for( sal_Int32 i = 0;
+ for( sal_Int32 nStartPos = 0, nEndPos = nStartPos;
nEndPos < nLength;
- nStartPos = ++nEndPos, i++ )
+ nStartPos = ++nEndPos )
{
// find start point of next range