summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-06-01 12:14:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-01 14:15:58 +0200
commitacb65a60be43d5ac146c2fc16c6f2a5f6879be99 (patch)
treed10bc29c40383e1ea68057c763b61a0499f0eca3
parentaeeb0141aca4f1698b09bc8f06ded41247b54279 (diff)
Use more appropriate index variable types
Change-Id: Ic2cf5512cabcda0ad476c43bcbc544d0d6dd2685 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135231 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx6
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx3
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx7
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx11
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx5
-rw-r--r--chart2/source/model/template/BubbleDataInterpreter.cxx8
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx23
-rw-r--r--chart2/source/model/template/DataInterpreter.cxx7
-rw-r--r--chart2/source/model/template/StockChartTypeTemplate.cxx9
-rw-r--r--chart2/source/model/template/StockDataInterpreter.cxx13
-rw-r--r--chart2/source/model/template/XYDataInterpreter.cxx8
-rw-r--r--chart2/source/tools/AxisHelper.cxx3
-rw-r--r--chart2/source/tools/CommonConverters.cxx9
-rw-r--r--chart2/source/tools/DiagramHelper.cxx13
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx3
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx5
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx6
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx3
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.cxx10
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx5
20 files changed, 99 insertions, 58 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
index e613161bf10f..8ad57070a460 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "WrappedGapwidthProperty.hxx"
#include "Chart2ModelContact.hxx"
#include <ChartType.hxx>
@@ -113,7 +117,7 @@ Any WrappedBarPositionProperty_Base::getPropertyValue( const Reference< beans::X
if( m_nDimensionIndex==1 )
{
std::vector< rtl::Reference< ChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( sal_Int32 nN = 0; nN < static_cast<sal_Int32>(aChartTypeList.size()) && !bInnerValueDetected; nN++ )
+ for( std::size_t nN = 0; nN < aChartTypeList.size() && !bInnerValueDetected; nN++ )
{
try
{
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 44e1413befe0..11c6f19d72de 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -46,6 +46,7 @@
#include <comphelper/property.hxx>
#include <algorithm>
+#include <cstddef>
#include <limits>
using namespace ::com::sun::star;
@@ -137,7 +138,7 @@ lcl_tSharedSeqVec lcl_getSharedSequences( const std::vector< rtl::Reference< Dat
{
Reference< chart2::data::XDataSequence > xValues( labeledDataSeq->getValues());
bool bShared = true;
- for( sal_Int32 nSeriesIdx=1; nSeriesIdx<static_cast<sal_Int32>(rSeries.size()); ++nSeriesIdx )
+ for( std::size_t nSeriesIdx=1; nSeriesIdx<rSeries.size(); ++nSeriesIdx )
{
bShared = lcl_SequenceOfSeriesIsShared( rSeries[nSeriesIdx], xValues );
if( !bShared )
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 59d9d5bb93c6..661e9113a1ec 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -44,6 +44,7 @@
#include <utility>
#include <algorithm>
+#include <cstddef>
#include <iterator>
#include <numeric>
@@ -241,15 +242,15 @@ rtl::Reference< ::chart::DataSeries > lcl_CreateNewSeries(
Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
if( xColorScheme.is())
xResult->setPropertyValue( "Color" , uno::Any( xColorScheme->getColorByIndex( nNewSeriesIndex )));
- sal_Int32 nGroupIndex=0;
+ std::size_t nGroupIndex=0;
if( xChartType.is())
{
std::vector< rtl::Reference< ::chart::ChartType > > aCTs(
::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ));
- for( ; nGroupIndex < static_cast<sal_Int32>(aCTs.size()); ++nGroupIndex)
+ for( ; nGroupIndex < aCTs.size(); ++nGroupIndex)
if( aCTs[nGroupIndex] == xChartType )
break;
- if( nGroupIndex == static_cast<sal_Int32>(aCTs.size()))
+ if( nGroupIndex == aCTs.size())
nGroupIndex = 0;
}
xTemplate->applyStyle( xResult, nGroupIndex, nNewSeriesIndex, nTotalNumberOfSeriesInCTGroup );
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index eb697def87a5..f0497ecdc1dd 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include <dlg_ObjectProperties.hxx>
#include <strings.hrc>
#include "tp_AxisLabel.hxx"
@@ -218,9 +222,8 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
Sequence< double > aXValues, aYValues;
bool bXValuesFound = false, bYValuesFound = false;
m_nNbPoints = 0;
- sal_Int32 i = 0;
- for( i=0;
- ! (bXValuesFound && bYValuesFound) && i<static_cast<sal_Int32>(aDataSeqs.size());
+ for( std::size_t i=0;
+ ! (bXValuesFound && bYValuesFound) && i<aDataSeqs.size();
++i )
{
try
@@ -253,7 +256,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
//first category (index 0) matches with real number 1.0
aXValues.realloc( aYValues.getLength() );
auto pXValues = aXValues.getArray();
- for( i=0; i<aXValues.getLength(); ++i )
+ for( sal_Int32 i=0; i<aXValues.getLength(); ++i )
pXValues[i] = i+1;
bXValuesFound = true;
}
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 335fa506a615..5a04b7ae4277 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -38,6 +38,7 @@
#include <map>
#include <algorithm>
+#include <cstddef>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -313,10 +314,10 @@ void ObjectHierarchy::createDataSeriesTree(
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq(
xDiagram->getBaseCoordinateSystems());
- for( sal_Int32 nCooSysIdx=0; nCooSysIdx<static_cast<sal_Int32>(aCooSysSeq.size()); ++nCooSysIdx )
+ for( std::size_t nCooSysIdx=0; nCooSysIdx<aCooSysSeq.size(); ++nCooSysIdx )
{
std::vector< rtl::Reference< ChartType > > aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
- for( sal_Int32 nCTIdx=0; nCTIdx<static_cast<sal_Int32>(aChartTypeSeq.size()); ++nCTIdx )
+ for( std::size_t nCTIdx=0; nCTIdx<aChartTypeSeq.size(); ++nCTIdx )
{
rtl::Reference< ChartType > xChartType( aChartTypeSeq[nCTIdx] );
std::vector< rtl::Reference< DataSeries > > aSeriesSeq( xChartType->getDataSeries2() );
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
index 3c3c33770ce5..7243b43aae96 100644
--- a/chart2/source/model/template/BubbleDataInterpreter.cxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "BubbleDataInterpreter.hxx"
#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
@@ -114,7 +118,7 @@ InterpretedData BubbleDataInterpreter::interpretDataSource(
}
// create DataSeries
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
vector< rtl::Reference< DataSeries > > aSeriesVec;
aSeriesVec.reserve( aSizeValuesVector.size());
@@ -135,7 +139,7 @@ InterpretedData BubbleDataInterpreter::interpretDataSource(
aNewData.push_back(aSizeValuesVector[nN]);
rtl::Reference< DataSeries > xSeries;
- if( nSeriesIndex < static_cast<sal_Int32>(aSeriesToReUse.size()))
+ if( nSeriesIndex < aSeriesToReUse.size())
xSeries = aSeriesToReUse[nSeriesIndex];
else
xSeries = new DataSeries;
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 0791ab59d8b2..bc27bea1e162 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -41,6 +41,7 @@
#include <comphelper/property.hxx>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -257,9 +258,9 @@ void ChartTypeTemplate::changeDiagramData(
xInterpreter->interpretDataSource( xDataSource, aArguments, aFlatSeriesSeq );
// data series
- sal_Int32 i, j, nIndex = 0;
- for( i=0; i<static_cast<sal_Int32>(aData.Series.size()); ++i )
- for( j=0; j<static_cast<sal_Int32>(aData.Series[i].size()); ++j, ++nIndex )
+ sal_Int32 nIndex = 0;
+ for( std::size_t i=0; i<aData.Series.size(); ++i )
+ for( std::size_t j=0; j<aData.Series[i].size(); ++j, ++nIndex )
{
if( nIndex >= nFormerSeriesCount )
{
@@ -274,7 +275,7 @@ void ChartTypeTemplate::changeDiagramData(
std::vector< rtl::Reference< ChartType > > aChartTypes =
DiagramHelper::getChartTypesFromDiagram( xDiagram );
sal_Int32 nMax = std::min( aChartTypes.size(), aData.Series.size());
- for( i=0; i<nMax; ++i )
+ for( sal_Int32 i=0; i<nMax; ++i )
{
aChartTypes[i]->setDataSeries( aData.Series[i] );
}
@@ -310,13 +311,13 @@ bool ChartTypeTemplate::matchesTemplate(
const OUString aChartTypeToMatch = xOldCT->getChartType();
const sal_Int32 nDimensionToMatch = getDimension();
- for( sal_Int32 nCooSysIdx=0; bResult && (nCooSysIdx < static_cast<sal_Int32>(aCooSysSeq.size())); ++nCooSysIdx )
+ for( std::size_t nCooSysIdx=0; bResult && (nCooSysIdx < aCooSysSeq.size()); ++nCooSysIdx )
{
// match dimension
bResult = bResult && (aCooSysSeq[nCooSysIdx]->getDimension() == nDimensionToMatch);
const std::vector< rtl::Reference< ChartType > > & aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
- for( sal_Int32 nCTIdx=0; bResult && (nCTIdx < static_cast<sal_Int32>(aChartTypeSeq.size())); ++nCTIdx )
+ for( std::size_t nCTIdx=0; bResult && (nCTIdx < aChartTypeSeq.size()); ++nCTIdx )
{
// match chart type
bResult = bResult && aChartTypeSeq[nCTIdx]->getChartType() == aChartTypeToMatch;
@@ -393,7 +394,7 @@ void ChartTypeTemplate::applyStyles( const rtl::Reference< ::chart::Diagram >& x
// apply chart-type specific styles, like "symbols on" for example
std::vector< std::vector< rtl::Reference< DataSeries > > > aNewSeriesSeq(
DiagramHelper::getDataSeriesGroups( xDiagram ));
- for( sal_Int32 i=0; i<static_cast<sal_Int32>(aNewSeriesSeq.size()); ++i )
+ for( std::size_t i=0; i<aNewSeriesSeq.size(); ++i )
{
const sal_Int32 nNumSeries = aNewSeriesSeq[i].size();
for( sal_Int32 j=0; j<nNumSeries; ++j )
@@ -501,7 +502,7 @@ void ChartTypeTemplate::createCoordinateSystems(
if( !aCoordinateSystems.empty() )
{
bool bOk = true;
- for( sal_Int32 i=0; bOk && i<static_cast<sal_Int32>(aCoordinateSystems.size()); ++i )
+ for( std::size_t i=0; bOk && i<aCoordinateSystems.size(); ++i )
bOk = bOk && ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() &&
(xCooSys->getDimension() == aCoordinateSystems[i]->getDimension()) );
// coordinate systems are ok
@@ -729,7 +730,7 @@ void ChartTypeTemplate::createChartTypes(
try
{
- sal_Int32 nCooSysIdx=0;
+ std::size_t nCooSysIdx=0;
rtl::Reference< ChartType > xCT;
if( aSeriesSeq.empty() )
{
@@ -739,7 +740,7 @@ void ChartTypeTemplate::createChartTypes(
}
else
{
- for( sal_Int32 nSeriesIdx=0; nSeriesIdx<static_cast<sal_Int32>(aSeriesSeq.size()); ++nSeriesIdx )
+ for( std::size_t nSeriesIdx=0; nSeriesIdx<aSeriesSeq.size(); ++nSeriesIdx )
{
if( nSeriesIdx == nCooSysIdx )
{
@@ -770,7 +771,7 @@ void ChartTypeTemplate::createChartTypes(
}
// spread the series over the available coordinate systems
- if( static_cast<sal_Int32>(rCoordSys.size()) > (nCooSysIdx + 1) )
+ if( rCoordSys.size() > (nCooSysIdx + 1) )
++nCooSysIdx;
}
}
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 36ead62dcf9e..5b8899dcc9f6 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -27,6 +27,7 @@
#include <tools/diagnose_ex.h>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -100,7 +101,7 @@ InterpretedData DataInterpreter::interpretDataSource(
}
// create DataSeries
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
vector< rtl::Reference< DataSeries > > aSeriesVec;
aSeriesVec.reserve( aSequencesVec.size());
@@ -108,7 +109,7 @@ InterpretedData DataInterpreter::interpretDataSource(
{
std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewData { elem };
rtl::Reference< DataSeries > xSeries;
- if( nSeriesIndex < static_cast<sal_Int32>(aSeriesToReUse.size()))
+ if( nSeriesIndex < aSeriesToReUse.size())
xSeries = aSeriesToReUse[nSeriesIndex];
else
xSeries = new DataSeries;
@@ -346,7 +347,7 @@ bool DataInterpreter::HasCategories(
if( rArguments.hasElements() )
GetProperty( rArguments, u"HasCategories" ) >>= bHasCategories;
- for( sal_Int32 nLSeqIdx=0; ! bHasCategories && nLSeqIdx<static_cast<sal_Int32>(rData.size()); ++nLSeqIdx )
+ for( std::size_t nLSeqIdx=0; ! bHasCategories && nLSeqIdx<rData.size(); ++nLSeqIdx )
bHasCategories = ( rData[nLSeqIdx].is() && GetRole( rData[nLSeqIdx]->getValues() ) == "categories");
return bHasCategories;
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index fb514adfa75f..2798f0358b7c 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -35,6 +35,7 @@
#include <tools/diagnose_ex.h>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -285,7 +286,7 @@ void StockChartTypeTemplate::createChartTypes(
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE ) >>= bJapaneseStyle;
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH ) >>= bShowHighLow;
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
std::vector< rtl::Reference< ChartType > > aChartTypeVec;
// Bars (Volume)
@@ -295,7 +296,7 @@ void StockChartTypeTemplate::createChartTypes(
rtl::Reference< ChartType > xCT = new ColumnChartType();
aChartTypeVec.push_back( xCT );
- if( static_cast<sal_Int32>(aSeriesSeq.size()) > nSeriesIndex &&
+ if( aSeriesSeq.size() > nSeriesIndex &&
!aSeriesSeq[nSeriesIndex].empty() )
{
xCT->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
@@ -310,7 +311,7 @@ void StockChartTypeTemplate::createChartTypes(
xCT->setPropertyValue( "ShowFirst", uno::Any( bShowFirst ));
xCT->setPropertyValue( "ShowHighLow", uno::Any( bShowHighLow ));
- if( static_cast<sal_Int32>(aSeriesSeq.size()) > nSeriesIndex &&
+ if( aSeriesSeq.size() > nSeriesIndex &&
!aSeriesSeq[ nSeriesIndex ].empty() )
{
xCT->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
@@ -318,7 +319,7 @@ void StockChartTypeTemplate::createChartTypes(
++nSeriesIndex;
// Lines (remaining series)
- if( static_cast<sal_Int32>(aSeriesSeq.size()) > nSeriesIndex &&
+ if( aSeriesSeq.size() > nSeriesIndex &&
!aSeriesSeq[ nSeriesIndex ].empty() )
{
xCT = new LineChartType();
diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx
index f2d845a18d6d..d0d950b9a6a8 100644
--- a/chart2/source/model/template/StockDataInterpreter.cxx
+++ b/chart2/source/model/template/StockDataInterpreter.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "StockDataInterpreter.hxx"
#include "StockChartTypeTemplate.hxx"
#include <DataSeries.hxx>
@@ -220,7 +224,8 @@ InterpretedData StockDataInterpreter::interpretDataSource(
// create DataSeries
std::vector< std::vector< rtl::Reference< DataSeries > > > aResultSeries( nNumberOfGroups );
- sal_Int32 nGroupIndex, nReUsedSeriesIdx = 0;
+ sal_Int32 nGroupIndex;
+ std::size_t nReUsedSeriesIdx = 0;
for( nGroupIndex=0; nGroupIndex<nNumberOfGroups; ++nGroupIndex )
{
const sal_Int32 nNumSeriesData = aSequences[nGroupIndex].size();
@@ -231,7 +236,7 @@ InterpretedData StockDataInterpreter::interpretDataSource(
try
{
rtl::Reference< DataSeries > xSeries;
- if( nReUsedSeriesIdx < static_cast<sal_Int32>(rSeriesToReUse.size()))
+ if( nReUsedSeriesIdx < rSeriesToReUse.size())
xSeries = rSeriesToReUse[nReUsedSeriesIdx];
else
xSeries = new DataSeries;
@@ -258,7 +263,7 @@ bool StockDataInterpreter::isDataCompatible(
const InterpretedData& aInterpretedData )
{
// high/low/close
- sal_Int32 nNumberOfNecessarySequences = 3;
+ std::size_t nNumberOfNecessarySequences = 3;
// open
StockChartTypeTemplate::StockVariant eVar( GetStockVariant());
if( ( eVar == StockChartTypeTemplate::StockVariant::Open ) ||
@@ -292,7 +297,7 @@ bool StockDataInterpreter::isDataCompatible(
{
try
{
- if( static_cast<sal_Int32>(dataSeries->getDataSequences2().size()) != nNumberOfNecessarySequences )
+ if( dataSeries->getDataSequences2().size() != nNumberOfNecessarySequences )
return false;
}
catch( const uno::Exception & )
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index a4ac12b112cc..d77a3df396b7 100644
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "XYDataInterpreter.hxx"
#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
@@ -105,7 +109,7 @@ InterpretedData XYDataInterpreter::interpretDataSource(
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
Reference< util::XCloneable > xCloneable( xValuesX, uno::UNO_QUERY );
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
for (auto const& elem : aSequencesVec)
{
vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewData;
@@ -118,7 +122,7 @@ InterpretedData XYDataInterpreter::interpretDataSource(
aNewData.push_back(elem);
rtl::Reference< DataSeries > xSeries;
- if( nSeriesIndex < static_cast<sal_Int32>(aSeriesToReUse.size()))
+ if( nSeriesIndex < aSeriesToReUse.size())
xSeries = aSeriesToReUse[nSeriesIndex];
else
xSeries = new DataSeries;
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index e34870052cec..a44fb567a5d9 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -51,6 +51,7 @@
#include <comphelper/sequence.hxx>
#include <tools/diagnose_ex.h>
+#include <cstddef>
#include <map>
namespace chart
@@ -786,7 +787,7 @@ bool AxisHelper::getIndicesForAxis( const rtl::Reference< Axis >& xAxis, const r
rOutAxisIndex = -1;
const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList = xDiagram->getBaseCoordinateSystems();
- for( sal_Int32 nC=0; nC < static_cast<sal_Int32>(aCooSysList.size()); ++nC )
+ for( std::size_t nC=0; nC < aCooSysList.size(); ++nC )
{
if( AxisHelper::getIndicesForAxis( xAxis, aCooSysList[nC], rOutDimensionIndex, rOutAxisIndex ) )
{
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index e10c22cc7d55..6330d2137edd 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -29,6 +29,7 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <cstddef>
#include <limits>
namespace chart
@@ -268,15 +269,15 @@ void addPolygon( std::vector<std::vector<css::drawing::Position3D>>& rRet, const
void appendPoly( std::vector<std::vector<css::drawing::Position3D>>& rRet, const std::vector<std::vector<css::drawing::Position3D>>& rAdd )
{
- sal_Int32 nOuterCount = std::max( rRet.size(), rAdd.size() );
+ std::size_t nOuterCount = std::max( rRet.size(), rAdd.size() );
rRet.resize(nOuterCount);
auto pSequence = rRet.data();
- for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ )
+ for( std::size_t nOuter=0;nOuter<nOuterCount;nOuter++ )
{
sal_Int32 nOldPointCount = rRet[nOuter].size();
sal_Int32 nAddPointCount = 0;
- if(nOuter<static_cast<sal_Int32>(rAdd.size()))
+ if(nOuter<rAdd.size())
nAddPointCount = rAdd[nOuter].size();
if(!nAddPointCount)
continue;
@@ -378,7 +379,7 @@ drawing::PointSequenceSequence PolyToPointSequence(
aRet.realloc( rPolyPolygon.size() );
auto pRet = aRet.getArray();
- for(sal_Int32 nN = 0; nN < static_cast<sal_Int32>(rPolyPolygon.size()); nN++)
+ for(std::size_t nN = 0; nN < rPolyPolygon.size(); nN++)
{
sal_Int32 nInnerLength = rPolyPolygon[nN].size();
pRet[nN].realloc( nInnerLength );
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 258dff61d8db..34c2ad0e7d8c 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -61,6 +61,7 @@
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
+#include <cstddef>
#include <limits>
using namespace ::com::sun::star;
@@ -289,7 +290,7 @@ StackMode DiagramHelper::getStackMode( const rtl::Reference< Diagram > & xDiagra
{
//iterate through all chart types in the current coordinate system
std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
- for( sal_Int32 nT = 0; nT < static_cast<sal_Int32>(aChartTypeList.size()); ++nT )
+ for( std::size_t nT = 0; nT < aChartTypeList.size(); ++nT )
{
rtl::Reference< ChartType > xChartType( aChartTypeList[nT] );
@@ -1177,7 +1178,7 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
bool bFound = false;
const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
- for( sal_Int32 nCS = 0; !bFound && nCS < static_cast<sal_Int32>(aCooSysList.size()); ++nCS )
+ for( std::size_t nCS = 0; !bFound && nCS < aCooSysList.size(); ++nCS )
{
const rtl::Reference< BaseCoordinateSystem > & xCooSys( aCooSysList[nCS] );
@@ -1185,7 +1186,7 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
rtl::Reference< ChartType > xFormerChartType;
- for( sal_Int32 nT = 0; !bFound && nT < static_cast<sal_Int32>(aChartTypeList.size()); ++nT )
+ for( std::size_t nT = 0; !bFound && nT < aChartTypeList.size(); ++nT )
{
rtl::Reference< ChartType > xCurrentChartType( aChartTypeList[nT] );
@@ -1193,13 +1194,13 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
std::vector< rtl::Reference< DataSeries > > aSeriesList = xCurrentChartType->getDataSeries2();
- for( sal_Int32 nS = 0; !bFound && nS < static_cast<sal_Int32>(aSeriesList.size()); ++nS )
+ for( std::size_t nS = 0; !bFound && nS < aSeriesList.size(); ++nS )
{
// We found the series we are interested in!
if( xGivenDataSeries==aSeriesList[nS] )
{
- sal_Int32 nOldSeriesIndex = nS;
+ std::size_t nOldSeriesIndex = nS;
bFound = true;
try
@@ -1245,7 +1246,7 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
}
}
}
- else if( nT+1 < static_cast<sal_Int32>(aChartTypeList.size()) )
+ else if( nT+1 < aChartTypeList.size() )
{
//exchange series with next charttype
rtl::Reference< ChartType > xOtherChartType( aChartTypeList[nT+1] );
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 8508c8453c70..0c95286e9b24 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <cstddef>
#include <iterator>
#include <InternalDataProvider.hxx>
@@ -119,7 +120,7 @@ struct lcl_internalizeSeries
{
const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aOldSeriesData = xSeries->getDataSequences2();
std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewSeriesData( aOldSeriesData.size() );
- for( sal_Int32 i=0; i<static_cast<sal_Int32>(aOldSeriesData.size()); ++i )
+ for( std::size_t i=0; i<aOldSeriesData.size(); ++i )
{
sal_Int32 nNewIndex( m_bDataInColumns ? m_rInternalData.appendColumn() : m_rInternalData.appendRow() );
OUString aIdentifier( OUString::number( nNewIndex ));
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 6b8b9e2809cc..8bc65422c463 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
+#include <cstddef>
#include <map>
#include <ObjectIdentifier.hxx>
@@ -468,9 +469,9 @@ OUString ObjectIdentifier::createParticleForCoordinateSystem(
rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
if( xDiagram.is() )
{
- sal_Int32 nCooSysIndex = 0;
+ std::size_t nCooSysIndex = 0;
const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
- for( ; nCooSysIndex < static_cast<sal_Int32>(aCooSysList.size()); ++nCooSysIndex )
+ for( ; nCooSysIndex < aCooSysList.size(); ++nCooSysIndex )
{
if( xCooSys == aCooSysList[nCooSysIndex] )
{
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 6124007fceb8..60ac5ebd38dd 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include <RegressionCurveHelper.hxx>
#include <MeanValueRegressionCurveCalculator.hxx>
#include <LinearRegressionCurveCalculator.hxx>
@@ -884,7 +888,7 @@ sal_Int32 RegressionCurveHelper::getRegressionCurveIndex(
const std::vector< rtl::Reference< RegressionCurveModel > > & aCurves(
xContainer->getRegressionCurves2());
- for( sal_Int32 i = 0; i < static_cast<sal_Int32>(aCurves.size()); ++i )
+ for( std::size_t i = 0; i < aCurves.size(); ++i )
{
if( xCurve == aCurves[i] )
return i;
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 0b2ad886f68f..50ee67dd473b 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <cstddef>
#include <limits>
#include <memory>
#include <VSeriesPlotter.hxx>
@@ -1301,7 +1302,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer
const std::vector< rtl::Reference< ::chart::RegressionCurveModel > > & aCurveList = xContainer->getRegressionCurves2();
- for(sal_Int32 nN=0; nN<static_cast<sal_Int32>(aCurveList.size()); nN++)
+ for(std::size_t nN=0; nN<aCurveList.size(); nN++)
{
const auto & rCurve = aCurveList[nN];
uno::Reference< XRegressionCurveCalculator > xCalculator( rCurve->getCalculator() );
diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx
index 1e8bd45ee489..1eb6a64a42c5 100644
--- a/chart2/source/view/main/SeriesPlotterContainer.cxx
+++ b/chart2/source/view/main/SeriesPlotterContainer.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "SeriesPlotterContainer.hxx"
#include <ChartView.hxx>
@@ -175,7 +179,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
uno::Reference<XColorScheme> xColorScheme(xDiagram->getDefaultColorScheme());
auto& rCooSysList = xDiagram->getBaseCoordinateSystems();
sal_Int32 nGlobalSeriesIndex = 0; //for automatic symbols
- for (sal_Int32 nCS = 0; nCS < static_cast<sal_Int32>(rCooSysList.size()); ++nCS)
+ for (std::size_t nCS = 0; nCS < rCooSysList.size(); ++nCS)
{
rtl::Reference<BaseCoordinateSystem> xCooSys(rCooSysList[nCS]);
VCoordinateSystem* pVCooSys
@@ -195,7 +199,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
}
//iterate through all chart types in the current coordinate system
std::vector<rtl::Reference<ChartType>> aChartTypeList(xCooSys->getChartTypes2());
- for (sal_Int32 nT = 0; nT < static_cast<sal_Int32>(aChartTypeList.size()); ++nT)
+ for (std::size_t nT = 0; nT < aChartTypeList.size(); ++nT)
{
rtl::Reference<ChartType> xChartType(aChartTypeList[nT]);
if (nDimensionCount == 3
@@ -243,7 +247,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
sal_Int32 ySlot = -1;
const std::vector<rtl::Reference<DataSeries>>& aSeriesList
= xChartType->getDataSeries2();
- for (sal_Int32 nS = 0; nS < static_cast<sal_Int32>(aSeriesList.size()); ++nS)
+ for (std::size_t nS = 0; nS < aSeriesList.size(); ++nS)
{
rtl::Reference<DataSeries> const& xDataSeries = aSeriesList[nS];
if (!bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries))
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index d145feabbda9..7fddc5d018d5 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -58,6 +58,7 @@
#include <sal/log.hxx>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -84,7 +85,7 @@ css::drawing::PolyPolygonShape3D toPolyPolygonShape3D(const std::vector<std::vec
aUnoPoly.SequenceX.realloc(rPoints.size());
aUnoPoly.SequenceY.realloc(rPoints.size());
aUnoPoly.SequenceZ.realloc(rPoints.size());
- for (sal_Int32 nPolygonIndex=0; nPolygonIndex<static_cast<sal_Int32>(rPoints.size()); ++nPolygonIndex)
+ for (std::size_t nPolygonIndex=0; nPolygonIndex<rPoints.size(); ++nPolygonIndex)
{
drawing::DoubleSequence* pOuterSequenceX = &aUnoPoly.SequenceX.getArray()[nPolygonIndex];
drawing::DoubleSequence* pOuterSequenceY = &aUnoPoly.SequenceY.getArray()[nPolygonIndex];
@@ -95,7 +96,7 @@ css::drawing::PolyPolygonShape3D toPolyPolygonShape3D(const std::vector<std::vec
double* pInnerSequenceX = pOuterSequenceX->getArray();
double* pInnerSequenceY = pOuterSequenceY->getArray();
double* pInnerSequenceZ = pOuterSequenceZ->getArray();
- for (sal_Int32 nPointIndex=0; nPointIndex<static_cast<sal_Int32>(rPoints[nPolygonIndex].size()); ++nPointIndex)
+ for (std::size_t nPointIndex=0; nPointIndex<rPoints[nPolygonIndex].size(); ++nPointIndex)
{
auto& rPos = rPoints[nPolygonIndex][nPointIndex];
pInnerSequenceX[nPointIndex] = rPos.PositionX;