summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/comp/exprtree.cxx4
-rw-r--r--basic/source/comp/token.cxx5
-rw-r--r--basic/source/uno/dlgcont.cxx6
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx5
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx40
-rw-r--r--chart2/source/tools/XMLRangeHelper.cxx6
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx100
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx103
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx37
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx51
-rw-r--r--chart2/source/view/charttypes/NetChart.cxx96
-rw-r--r--comphelper/source/property/propagg.cxx28
-rw-r--r--comphelper/source/property/property.cxx13
-rw-r--r--connectivity/source/commontools/paramwrapper.cxx8
-rw-r--r--dbaccess/source/core/api/query.cxx17
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx16
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx6
-rw-r--r--dbaccess/source/ui/browser/exsrcbrw.cxx32
-rw-r--r--dbaccess/source/ui/browser/formadapter.cxx24
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx15
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx40
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx9
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx8
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx7
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx14
-rw-r--r--dbaccess/source/ui/misc/stringlistitem.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx11
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx15
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx36
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx10
-rw-r--r--desktop/source/migration/migration.cxx53
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx11
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx121
-rw-r--r--editeng/source/misc/acorrcfg.cxx3
-rw-r--r--editeng/source/uno/unotext.cxx68
-rw-r--r--extensions/source/bibliography/datman.cxx68
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx11
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx79
-rw-r--r--extensions/source/propctrlr/taborder.cxx14
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx5
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.cxx21
-rw-r--r--forms/source/component/ComboBox.cxx25
-rw-r--r--forms/source/component/DatabaseForm.cxx25
-rw-r--r--forms/source/component/GroupManager.cxx8
-rw-r--r--forms/source/misc/InterfaceContainer.cxx18
45 files changed, 485 insertions, 814 deletions
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 43fac26a6e22..6c960170870b 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -138,10 +138,8 @@ static SbiSymDef* AddSym ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExp
if( pPar )
{
// generate dummy parameters
- sal_Int32 n = 1;
- for( short i = 0; i < pPar->GetSize(); i++ )
+ for( sal_Int32 n = 1; n <= pPar->GetSize(); n++ )
{
- n += 1;
OUStringBuffer aPar("PAR");
aPar.append(n);
pProc->GetParams().AddSym( aPar.makeStringAndClear() );
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index b5e2babb3181..371c9bb4269f 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -195,9 +195,8 @@ TokenLabelInfo::TokenLabelInfo()
// Token accepted as label by VBA
static const SbiToken eLabelToken[] = { ACCESS, ALIAS, APPEND, BASE, BINARY, CLASSMODULE,
COMPARE, COMPATIBLE, DEFERR, ERROR_, BASIC_EXPLICIT, LIB, LINE, LPRINT, NAME,
- TOBJECT, OUTPUT, PROPERTY, RANDOM, READ, STEP, STOP, TEXT, VBASUPPORT, NIL };
- SbiToken eTok;
- for( const SbiToken* pTok = eLabelToken ; (eTok = *pTok) != NIL ; ++pTok )
+ TOBJECT, OUTPUT, PROPERTY, RANDOM, READ, STEP, STOP, TEXT, VBASUPPORT };
+ for( SbiToken eTok : eLabelToken )
{
m_pTokenCanBeLabelTab[eTok] = true;
}
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 1faac70c0fe1..5e3fd9c7995d 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -243,12 +243,10 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
// Export the images to the storage
Reference< document::XGraphicObjectResolver > xGraphicResolver =
document::GraphicObjectResolver::createWithStorage( mxContext, xStorage );
- std::vector< OUString >::iterator it = vEmbeddedImageURLs.begin();
- std::vector< OUString >::iterator it_end = vEmbeddedImageURLs.end();
if ( xGraphicResolver.is() )
{
- for ( sal_Int32 count = 0; it != it_end; ++it, ++count )
- xGraphicResolver->resolveGraphicObjectURL( *it );
+ for ( const OUString& rURL : vEmbeddedImageURLs )
+ xGraphicResolver->resolveGraphicObjectURL( rURL );
}
}
}
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index fa64f29277fe..ff9ecc746ebd 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -217,11 +217,10 @@ sal_Int16 SAL_CALL CreationWizardUnoDlg::execute( )
void SAL_CALL CreationWizardUnoDlg::initialize( const uno::Sequence< uno::Any >& aArguments )
{
- const uno::Any* pArguments = aArguments.getConstArray();
- for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
+ for(const uno::Any& rArgument : aArguments)
{
beans::PropertyValue aProperty;
- if(*pArguments >>= aProperty)
+ if(rArgument >>= aProperty)
{
if( aProperty.Name == "ParentWindow" )
{
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
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index d0bf32064738..2a8d773244e0 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -530,44 +530,34 @@ void AreaChart::impl_createSeriesShapes()
//the polygon shapes for each series need to be created before
//iterate through all series again to create the series shapes
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
std::map< sal_Int32, drawing::PolyPolygonShape3D* > aPreviousSeriesPolyMap;//a PreviousSeriesPoly for each different nAttachedAxisIndex
drawing::PolyPolygonShape3D* pSeriesPoly = nullptr;
//iterate through all series
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- createRegressionCurvesShapes( **aSeriesIter, m_xErrorBarTarget, m_xRegressionCurveEquationTarget,
+ createRegressionCurvesShapes( *pSeries, m_xErrorBarTarget, m_xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
- pSeriesPoly = &(*aSeriesIter)->m_aPolyPolygonShape3D;
+ pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
if( m_bArea )
{
- if( !impl_createArea( *aSeriesIter, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
+ if( !impl_createArea( pSeries, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
continue;
}
if( m_bLine )
{
- if( !impl_createLine( *aSeriesIter, pSeriesPoly, pPosHelper ) )
+ if( !impl_createLine( pSeries, pSeriesPoly, pPosHelper ) )
continue;
}
aPreviousSeriesPolyMap[nAttachedAxisIndex] = pSeriesPoly;
@@ -666,25 +656,14 @@ void AreaChart::createShapes()
bool bDateCategory = (m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis());
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
std::vector<std::map< sal_Int32, double > > aLogicYSumMapByX(nEndIndex);//one for each different nAttachedAxisIndex
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category to get 100percent sum
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::iterator aSeriesIter = rSeriesList.begin();
- std::vector<VDataSeries*>::iterator aSeriesEnd = rSeriesList.end();
-
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -711,31 +690,23 @@ void AreaChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ sal_Int32 nZ=1;
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::const_iterator aXSlotIter = aZSlotIter->begin();
- std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//for the area chart there should be at most one x slot (no side by side stacking available)
//attention different: xSlots are always interpreted as independent areas one behind the other: @todo this doesn't work why not???
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- const std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::const_iterator aSeriesIter = rSeriesList.begin();
- const std::vector<VDataSeries*>::const_iterator aSeriesEnd = rSeriesList.end();
-
std::vector<std::map< sal_Int32, double > > aLogicYForNextSeriesMapByX(nEndIndex); //one for each different nAttachedAxisIndex
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(*aSeriesIter, m_xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries, m_xSeriesTarget);
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
@@ -743,7 +714,7 @@ void AreaChart::createShapes()
if(m_nDimension==3)
fLogicZ = nZ+0.5;
- (*aSeriesIter)->m_fLogicZPos = fLogicZ;
+ pSeries->m_fLogicZPos = fLogicZ;
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
@@ -751,16 +722,16 @@ void AreaChart::createShapes()
/* #i70133# ignore points outside of series length in standard area
charts. Stacked area charts will use missing points as zeros. In
standard charts, pSeriesList contains only one series. */
- if( m_bArea && (rSeriesList.size() == 1) && (nIndex >= (*aSeriesIter)->getTotalPointCount()) )
+ if( m_bArea && (rXSlot.m_aSeriesVector.size() == 1) && (nIndex >= pSeries->getTotalPointCount()) )
continue;
//collect data point information (logic coordinates, style ):
- double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ double fLogicX = pSeries->getXValue(nIndex);
if (bDateCategory)
fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
- double fLogicY = (*aSeriesIter)->getYValue(nIndex);
+ double fLogicY = pSeries->getYValue(nIndex);
- if( m_nDimension==3 && m_bArea && rSeriesList.size()!=1 )
+ if( m_nDimension==3 && m_bArea && rXSlot.m_aSeriesVector.size()!=1 )
fLogicY = fabs( fLogicY );
std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex];
@@ -773,10 +744,10 @@ void AreaChart::createShapes()
|| ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
|| ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
- sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
+ drawing::PolyPolygonShape3D& rPolygon = pSeries->m_aPolyPolygonShape3D;
+ sal_Int32& rIndex = pSeries->m_nPolygonIndex;
if( 0<= rIndex && rIndex < rPolygon.SequenceX.getLength() )
{
if( rPolygon.SequenceX[ rIndex ].getLength() )
@@ -800,10 +771,10 @@ void AreaChart::createShapes()
//remind minimal and maximal x values for area 'grounding' points
//only for filled area
{
- double& rfMinX = (*aSeriesIter)->m_fLogicMinX;
+ double& rfMinX = pSeries->m_fLogicMinX;
if(!nIndex||fLogicX<rfMinX)
rfMinX=fLogicX;
- double& rfMaxX = (*aSeriesIter)->m_fLogicMaxX;
+ double& rfMaxX = pSeries->m_fLogicMaxX;
if(!nIndex||fLogicX>rfMaxX)
rfMaxX=fLogicX;
}
@@ -833,7 +804,7 @@ void AreaChart::createShapes()
//for area and/or line (symbols only do not need this)
if( isValidPosition(aScaledLogicPosition) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
}
//create a single datapoint if point is visible
@@ -864,7 +835,7 @@ void AreaChart::createShapes()
}
}
- Symbol* pSymbolProperties = m_bSymbol ? (*aSeriesIter)->getSymbolProperties( nIndex ) : nullptr;
+ Symbol* pSymbolProperties = m_bSymbol ? pSeries->getSymbolProperties( nIndex ) : nullptr;
bool bCreateSymbol = pSymbolProperties && (pSymbolProperties->Style != SymbolStyle_NONE);
if( !bCreateSymbol && !bCreateYErrorBar &&
@@ -873,7 +844,7 @@ void AreaChart::createShapes()
//create a group shape for this point and add to the series shape:
OUString aPointCID = ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(), nIndex );
+ pSeries->getPointCID_Stub(), nIndex );
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
uno::Reference<drawing::XShape> xPointGroupShape_Shape =
@@ -917,13 +888,13 @@ void AreaChart::createShapes()
}
//create error bars
if (bCreateXErrorBar)
- createErrorBar_X( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget );
+ createErrorBar_X( aUnscaledLogicPosition, *pSeries, nIndex, m_xErrorBarTarget );
if (bCreateYErrorBar)
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget, nullptr );
+ createErrorBar_Y( aUnscaledLogicPosition, *pSeries, nIndex, m_xErrorBarTarget, nullptr );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -970,7 +941,7 @@ void AreaChart::createShapes()
.transformSceneToScreenPosition( aScenePosition3D ) );
}
- createDataLabel( m_xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( m_xTextTarget, *pSeries, nIndex
, fLogicValueForLabeDisplay
, rLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
}
@@ -983,6 +954,7 @@ void AreaChart::createShapes()
}//next series in x slot (next y slot)
}//next x slot
+ ++nZ;
}//next z slot
impl_createSeriesShapes();
@@ -991,7 +963,7 @@ void AreaChart::createShapes()
//remove and delete point-group-shape if empty
if(!xSeriesGroupShape_Shapes->getCount())
{
- (*aSeriesIter)->m_xShape.set(NULL);
+ pSeries->m_xShape.set(NULL);
m_xLogicTarget->remove(xSeriesGroupShape_Shape);
}
*/
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 476dc39d36fb..41002429d900 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -450,28 +450,22 @@ void BarChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nPointIndex = nStartIndex; nPointIndex < nEndIndex; nPointIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
//sum up the values for all series in a complete z slot per attached axis
std::map< sal_Int32, double > aLogicYSumMap;
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( aXSlotIter = aZSlotIter->begin(); aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto& rXSlot : rZSlot )
{
- sal_Int32 nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ sal_Int32 nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
if( aLogicYSumMap.find(nAttachedAxisIndex)==aLogicYSumMap.end() )
aLogicYSumMap[nAttachedAxisIndex]=0.0;
- const sal_Int32 nSlotPoints = aXSlotIter->getPointCount();
+ const sal_Int32 nSlotPoints = rXSlot.getPointCount();
if( nPointIndex >= nSlotPoints )
continue;
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
+ rXSlot.calculateYMinAndMaxForCategory( nPointIndex
, isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
if( !::rtl::math::isNan( fMaximumY ) && fMaximumY > 0)
@@ -481,39 +475,33 @@ void BarChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ sal_Int32 nZ=1;
+ for( auto& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category
double fSlotX=0;
- for( aXSlotIter = aZSlotIter->begin(); aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto& rXSlot : rZSlot )
{
sal_Int32 nAttachedAxisIndex = 0;
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
- {
- nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
- //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
- pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
- if(!pPosHelper)
- pPosHelper = m_pMainPosHelper.get();
- }
+
+ nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
+ //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
+ pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
+ if(!pPosHelper)
+ pPosHelper = m_pMainPosHelper.get();
+
PlotterBase::m_pPosHelper = pPosHelper;
//update/create information for current group
- pPosHelper->updateSeriesCount( aZSlotIter->size() );
+ pPosHelper->updateSeriesCount( rZSlot.size() );
double fLogicBaseWidth = pPosHelper->getScaledSlotWidth();
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
// get distance from base value to maximum and minimum
double fMinimumY = 0.0, fMaximumY = 0.0;
- if( nPointIndex < aXSlotIter->getPointCount())
- aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
+ if( nPointIndex < rXSlot.getPointCount())
+ rXSlot.calculateYMinAndMaxForCategory( nPointIndex
, isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
double fLogicPositiveYSum = 0.0;
@@ -547,17 +535,14 @@ void BarChart::createShapes()
}
double fBaseValue = 0.0;
- if( !pPosHelper->isPercentY() && pSeriesList->size()<=1 )
+ if( !pPosHelper->isPercentY() && rXSlot.m_aSeriesVector.size()<=1 )
fBaseValue = pPosHelper->getBaseValueY();
double fPositiveLogicYForNextSeries = fBaseValue;
double fNegativeLogicYForNextSeries = fBaseValue;
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -566,7 +551,7 @@ void BarChart::createShapes()
bOnlyConnectionLinesForThisPoint = false;
if(nPointIndex==nStartIndex)//do not create a regression line for each point
- createRegressionCurvesShapes( **aSeriesIter, xRegressionCurveTarget, xRegressionCurveEquationTarget,
+ createRegressionCurvesShapes( *pSeries, xRegressionCurveTarget, xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
if( !bDrawConnectionLinesInited )
@@ -574,7 +559,7 @@ void BarChart::createShapes()
bDrawConnectionLines = pSeries->getConnectBars();
if( m_nDimension==3 )
bDrawConnectionLines = false;
- if( bDrawConnectionLines && pSeriesList->size()==1 )
+ if( bDrawConnectionLines && rXSlot.m_aSeriesVector.size()==1 )
{
//detect whether we have a stacked chart or not:
StackingDirection eDirection = pSeries->getStackingDirection();
@@ -585,10 +570,10 @@ void BarChart::createShapes()
}
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes(
- getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ getSeriesGroupShape(pSeries, xSeriesTarget) );
//collect data point information (logic coordinates, style ):
- double fUnscaledLogicX = (*aSeriesIter)->getXValue( nPointIndex );
+ double fUnscaledLogicX = pSeries->getXValue( nPointIndex );
fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
if(fUnscaledLogicX<pPosHelper->getLogicMinX())
continue;//point not visible
@@ -598,7 +583,7 @@ void BarChart::createShapes()
continue;//point not visible
double fLogicX = pPosHelper->getScaledSlotPos( fUnscaledLogicX, fSlotX );
- double fLogicBarHeight = (*aSeriesIter)->getYValue( nPointIndex );
+ double fLogicBarHeight = pSeries->getYValue( nPointIndex );
if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
continue;
@@ -634,7 +619,7 @@ void BarChart::createShapes()
// uno::Reference<drawing::XShape> xPointGroupShape_Shape =
// uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
//as long as we do not iterate we do not need to create an additional group for each point
- uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nPointIndex ) );
+ uno::Reference< beans::XPropertySet > xDataPointProperties( pSeries->getPropertiesOfPoint( nPointIndex ) );
sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
if(m_nDimension==3) try
{
@@ -724,9 +709,9 @@ void BarChart::createShapes()
drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUnclippedUpperYValue,fLogicZ );
if( isValidPosition(aLeftUpperPoint) )
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aLeftUpperPoint );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aLeftUpperPoint );
if( isValidPosition(aRightUpperPoint) )
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aRightUpperPoint );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aRightUpperPoint );
}
if( bOnlyConnectionLinesForThisPoint )
@@ -813,14 +798,14 @@ void BarChart::createShapes()
//set name/classified ObjectID (CID)
ShapeFactory::setShapeName(xShape
, ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(),nPointIndex) );
+ pSeries->getPointCID_Stub(),nPointIndex) );
}
//create error bar
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nPointIndex, m_xLogicTarget, &fLogicX );
+ createErrorBar_Y( aUnscaledLogicPosition, *pSeries, nPointIndex, m_xLogicTarget, &fLogicX );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nPointIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nPointIndex) )
{
double fLogicSum = aLogicYSumMap[nAttachedAxisIndex];
@@ -849,29 +834,26 @@ void BarChart::createShapes()
nOffset = 260;
}
createDataLabel(
- xTextTarget, **aSeriesIter, nPointIndex,
+ xTextTarget, *pSeries, nPointIndex,
fLogicValueForLabeDisplay, fLogicSum, aScreenPosition2D, eAlignment, nOffset);
}
}//end iteration through partial points
}//next series in x slot (next y slot)
+ fSlotX+=1.0;
}//next x slot
+ ++nZ;
}//next z slot
}//next category
if( bDrawConnectionLines )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
+ if( rZSlot.size() )
{
- sal_Int32 nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
@@ -880,16 +862,11 @@ void BarChart::createShapes()
PlotterBase::m_pPosHelper = pPosHelper;
//iterate through all x slots in this category
- for( double fSlotX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
drawing::PolyPolygonShape3D* pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
@@ -906,7 +883,7 @@ void BarChart::createShapes()
pPosHelper->transformScaledLogicToScene( aPoly );
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes(
- getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ getSeriesGroupShape(pSeries, xSeriesTarget) );
uno::Reference< drawing::XShape > xShape( m_pShapeFactory->createLine2D(
xSeriesGroupShape_Shapes, PolyToPointSequence( aPoly ) ) );
setMappedProperties( xShape, pSeries->getPropertiesOfSeries()
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index 85ff761f40d2..ced8ddb2f657 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -69,20 +69,12 @@ void BubbleChart::calculateMaximumLogicBubbleSize()
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -207,31 +199,20 @@ void BubbleChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
bool bHasBorderColorMapping = pSeries->hasPropertyMapping("LineColor");
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
@@ -324,7 +305,7 @@ void BubbleChart::createShapes()
::chart::AbstractShapeFactory::setShapeName( xShape, "MarkHandles" );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -366,7 +347,7 @@ void BubbleChart::createShapes()
sal_Int32 nOffset = 0;
if(eAlignment!=LABEL_ALIGN_CENTER)
nOffset = 100;//add some spacing //@todo maybe get more intelligent values
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fBubbleSize, fBubbleSize, aScreenPosition2D, eAlignment, nOffset );
}
}
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 079c907c4fa2..1419c9ef4968 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -137,18 +137,13 @@ void CandleStickChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=0; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
sal_Int32 nAttachedAxisIndex = 0;
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
+ if( rZSlot.size() )
{
- nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
@@ -157,29 +152,26 @@ void CandleStickChart::createShapes()
PlotterBase::m_pPosHelper = pPosHelper;
//update/create information for current group
- pPosHelper->updateSeriesCount( aZSlotIter->size() );
+ pPosHelper->updateSeriesCount( rZSlot.size() );
+ double fSlotX=0;
//iterate through all x slots in this category
- for( double fSlotX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* const pSeries : rXSlot.m_aSeriesVector )
{
//collect data point information (logic coordinates, style ):
- double fUnscaledX = (*aSeriesIter)->getXValue( nIndex );
+ double fUnscaledX = pSeries->getXValue( nIndex );
if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
fUnscaledX = DateHelper::RasterizeDateValue( fUnscaledX, m_aNullDate, m_nTimeResolution );
if(fUnscaledX<pPosHelper->getLogicMinX() || fUnscaledX>pPosHelper->getLogicMaxX())
continue;//point not visible
double fScaledX = pPosHelper->getScaledSlotPos( fUnscaledX, fSlotX );
- double fUnscaledY_First = (*aSeriesIter)->getY_First( nIndex );
- double fUnscaledY_Last = (*aSeriesIter)->getY_Last( nIndex );
- double fUnscaledY_Min = (*aSeriesIter)->getY_Min( nIndex );
- double fUnscaledY_Max = (*aSeriesIter)->getY_Max( nIndex );
+ double fUnscaledY_First = pSeries->getY_First( nIndex );
+ double fUnscaledY_Last = pSeries->getY_Last( nIndex );
+ double fUnscaledY_Min = pSeries->getY_Min( nIndex );
+ double fUnscaledY_Max = pSeries->getY_Max( nIndex );
bool bBlack=false;
if(fUnscaledY_Last<=fUnscaledY_First)
@@ -216,11 +208,11 @@ void CandleStickChart::createShapes()
if(bBlack)
xLossGainTarget = xLossTarget;
- uno::Reference< beans::XPropertySet > xPointProp( (*aSeriesIter)->getPropertiesOfPoint( nIndex ));
+ uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint( nIndex ));
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(nullptr);
{
- OUString aPointCID = ObjectIdentifier::createPointCID( (*aSeriesIter)->getPointCID_Stub(), nIndex );
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes( getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ OUString aPointCID = ObjectIdentifier::createPointCID( pSeries->getPointCID_Stub(), nIndex );
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes( getSeriesGroupShape(pSeries, xSeriesTarget) );
xPointGroupShape_Shapes = createGroupShape(xSeriesGroupShape_Shapes,aPointCID);
}
@@ -296,22 +288,23 @@ void CandleStickChart::createShapes()
}
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
if(isValidPosition(aPosMiddleFirst))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
if(isValidPosition(aPosMiddleLast))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
if(isValidPosition(aPosMiddleMinimum))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
if(isValidPosition(aPosMiddleMaximum))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
}
}//next series in x slot (next y slot)
+ fSlotX+=1.0;
}//next x slot
}//next z slot
}//next category
@@ -319,7 +312,7 @@ void CandleStickChart::createShapes()
//remove and delete point-group-shape if empty
if(!xSeriesGroupShape_Shapes->getCount())
{
- (*aSeriesIter)->m_xShape.set(NULL);
+ pSeries->m_xShape.set(NULL);
m_xLogicTarget->remove(xSeriesGroupShape_Shape);
}
*/
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index e9ebb0c459d6..40cbf6a641ea 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -243,41 +243,31 @@ void NetChart::impl_createSeriesShapes()
//the polygon shapes for each series need to be created before
//iterate through all series again to create the series shapes
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
std::map< sal_Int32, drawing::PolyPolygonShape3D* > aPreviousSeriesPolyMap;//a PreviousSeriesPoly for each different nAttachedAxisIndex
drawing::PolyPolygonShape3D* pSeriesPoly = nullptr;
//iterate through all series
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- pSeriesPoly = &(*aSeriesIter)->m_aPolyPolygonShape3D;
+ pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
if( m_bArea )
{
- if( !impl_createArea( *aSeriesIter, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
+ if( !impl_createArea( pSeries, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
continue;
}
if( m_bLine )
{
- if( !impl_createLine( *aSeriesIter, pSeriesPoly, pPosHelper ) )
+ if( !impl_createLine( pSeries, pSeriesPoly, pPosHelper ) )
continue;
}
aPreviousSeriesPolyMap[nAttachedAxisIndex] = pSeriesPoly;
@@ -374,25 +364,14 @@ void NetChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
std::map< sal_Int32, double > aLogicYSumMap;//one for each different nAttachedAxisIndex
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category to get 100percent sum
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::iterator aSeriesIter = rSeriesList.begin();
- std::vector<VDataSeries*>::iterator aSeriesEnd = rSeriesList.end();
-
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -415,55 +394,46 @@ void NetChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::const_iterator aXSlotIter = aZSlotIter->begin();
- std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//for the area chart there should be at most one x slot (no side by side stacking available)
//attention different: xSlots are always interpreted as independent areas one behind the other: @todo this doesn't work why not???
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- const std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::const_iterator aSeriesIter = rSeriesList.begin();
- const std::vector<VDataSeries*>::const_iterator aSeriesEnd = rSeriesList.end();
-
std::map< sal_Int32, double > aLogicYForNextSeriesMap;//one for each different nAttachedAxisIndex
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
/* #i70133# ignore points outside of series length in standard area
charts. Stacked area charts will use missing points as zeros. In
standard charts, pSeriesList contains only one series. */
- if( m_bArea && (rSeriesList.size() == 1) && (nIndex >= (*aSeriesIter)->getTotalPointCount()) )
+ if( m_bArea && (rXSlot.m_aSeriesVector.size() == 1) && (nIndex >= pSeries->getTotalPointCount()) )
continue;
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(*aSeriesIter, m_xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries, m_xSeriesTarget);
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- (*aSeriesIter)->m_fLogicZPos = fLogicZ;
+ pSeries->m_fLogicZPos = fLogicZ;
//collect data point information (logic coordinates, style ):
- double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ double fLogicX = pSeries->getXValue(nIndex);
if (bDateCategory)
fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
- double fLogicY = (*aSeriesIter)->getYValue(nIndex);
+ double fLogicY = pSeries->getYValue(nIndex);
if( m_bArea && ( ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY) ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- if( rSeriesList.size() == 1 || nSeriesIndex == 0 )
+ if( rXSlot.m_aSeriesVector.size() == 1 || pSeries == rXSlot.m_aSeriesVector.front() )
{
fLogicY = pPosHelper->getLogicMinY();
if( !pPosHelper->isMathematicalOrientationY() )
@@ -483,10 +453,10 @@ void NetChart::createShapes()
|| ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
|| ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
- sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
+ drawing::PolyPolygonShape3D& rPolygon = pSeries->m_aPolyPolygonShape3D;
+ sal_Int32& rIndex = pSeries->m_nPolygonIndex;
if( 0<= rIndex && rIndex < rPolygon.SequenceX.getLength() )
{
if( rPolygon.SequenceX[ rIndex ].getLength() )
@@ -509,10 +479,10 @@ void NetChart::createShapes()
//remind minimal and maximal x values for area 'grounding' points
//only for filled area
{
- double& rfMinX = (*aSeriesIter)->m_fLogicMinX;
+ double& rfMinX = pSeries->m_fLogicMinX;
if(!nIndex||fLogicX<rfMinX)
rfMinX=fLogicX;
- double& rfMaxX = (*aSeriesIter)->m_fLogicMaxX;
+ double& rfMaxX = pSeries->m_fLogicMaxX;
if(!nIndex||fLogicX>rfMaxX)
rfMaxX=fLogicX;
}
@@ -542,7 +512,7 @@ void NetChart::createShapes()
//for area and/or line (symbols only do not need this)
if( isValidPosition(aScaledLogicPosition) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
//prepare clipping for filled net charts
if( !bIsVisible && m_bArea )
@@ -551,8 +521,8 @@ void NetChart::createShapes()
pPosHelper->clipScaledLogicValues( nullptr, &aClippedPos.PositionY, nullptr );
if( pPosHelper->isLogicVisible( aClippedPos.PositionX, aClippedPos.PositionY, aClippedPos.PositionZ ) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aClippedPos, (*aSeriesIter)->m_nPolygonIndex );
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aClippedPos, pSeries->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
}
}
}
@@ -562,7 +532,7 @@ void NetChart::createShapes()
if( !bIsVisible )
continue;
- Symbol* pSymbolProperties = (*aSeriesIter)->getSymbolProperties( nIndex );
+ Symbol* pSymbolProperties = pSeries->getSymbolProperties( nIndex );
bool bCreateSymbol = pSymbolProperties && (pSymbolProperties->Style != SymbolStyle_NONE);
if( !bCreateSymbol && !pSeries->getDataPointLabelIfLabel(nIndex) )
@@ -570,7 +540,7 @@ void NetChart::createShapes()
//create a group shape for this point and add to the series shape:
OUString aPointCID = ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(), nIndex );
+ pSeries->getPointCID_Stub(), nIndex );
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
uno::Reference<drawing::XShape> xPointGroupShape_Shape =
@@ -611,7 +581,7 @@ void NetChart::createShapes()
}
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -669,7 +639,7 @@ void NetChart::createShapes()
.transformSceneToScreenPosition( aScenePosition3D ) );
}
- createDataLabel( m_xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( m_xTextTarget, *pSeries, nIndex
, fLogicValueForLabeDisplay
, aLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
}
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index 8bda3f26bf1f..8068d4afedb1 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -406,16 +406,15 @@ void SAL_CALL OPropertySetAggregationHelper::propertiesChange(const css::uno::Se
std::unique_ptr< css::uno::Any[]> pNewValues(new css::uno::Any[nLen]);
std::unique_ptr< css::uno::Any[]> pOldValues(new css::uno::Any[nLen]);
- const css::beans::PropertyChangeEvent* pEvents = _rEvents.getConstArray();
sal_Int32 nDest = 0;
- for (sal_Int32 nSource=0; nSource<nLen; ++nSource, ++pEvents)
+ for (const css::beans::PropertyChangeEvent& rEvent : _rEvents)
{
- sal_Int32 nHandle = rPH.getHandleByName(pEvents->PropertyName);
+ sal_Int32 nHandle = rPH.getHandleByName(rEvent.PropertyName);
if ( ( nHandle != -1 ) && !isCurrentlyForwardingProperty( nHandle ) )
{ // same as above : -1 is valid (73247) ...
pHandles[nDest] = nHandle;
- pNewValues[nDest] = pEvents->NewValue;
- pOldValues[nDest] = pEvents->OldValue;
+ pNewValues[nDest] = rEvent.NewValue;
+ pOldValues[nDest] = rEvent.OldValue;
++nDest;
}
}
@@ -607,13 +606,12 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
OPropertyArrayAggregationHelper& rPH = static_cast< OPropertyArrayAggregationHelper& >( getInfoHelper() );
// determine which properties belong to the aggregate, and which ones to the delegator
- const OUString* pNames = _rPropertyNames.getConstArray();
sal_Int32 nAggCount(0);
sal_Int32 nLen(_rPropertyNames.getLength());
- for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames )
+ for ( const OUString& rName : _rPropertyNames )
{
- OPropertyArrayAggregationHelper::PropertyOrigin ePropOrg = rPH.classifyProperty( *pNames );
+ OPropertyArrayAggregationHelper::PropertyOrigin ePropOrg = rPH.classifyProperty( rName );
if ( OPropertyArrayAggregationHelper::PropertyOrigin::Unknown == ePropOrg )
throw WrappedTargetException( OUString(), static_cast< XMultiPropertySet* >( this ), Any( UnknownPropertyException( ) ) );
// due to a flaw in the API design, this method is not allowed to throw an UnknownPropertyException
@@ -623,8 +621,6 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
++nAggCount;
}
- pNames = _rPropertyNames.getConstArray(); // reset, we'll need it again below ...
-
// all properties belong to the aggregate
if (nAggCount == nLen)
m_xAggregateMultiSet->setPropertyValues(_rPropertyNames, _rValues);
@@ -655,17 +651,17 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
Sequence< Any > DelValues( nLen - nAggCount );
Any* pDelValues = DelValues.getArray();
- for ( sal_Int32 i = 0; i < nLen; ++i, ++pNames, ++pValues )
+ for ( const OUString& rName : _rPropertyNames )
{
- if ( OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate == rPH.classifyProperty( *pNames ) )
+ if ( OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate == rPH.classifyProperty( rName ) )
{
- *pAggNames++ = *pNames;
- *pAggValues++ = *pValues;
+ *pAggNames++ = rName;
+ *pAggValues++ = *pValues++;
}
else
{
- *pDelNames++ = *pNames;
- *pDelValues++ = *pValues;
+ *pDelNames++ = rName;
+ *pDelValues++ = *pValues++;
}
}
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index f5e369808d2a..8f222f56f8de 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -71,20 +71,19 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
Reference< XPropertySetInfo > xDestProps = _rxDest->getPropertySetInfo();
Sequence< Property > aSourceProps = xSourceProps->getProperties();
- const Property* pSourceProps = aSourceProps.getConstArray();
Property aDestProp;
- for (sal_Int32 i=0; i<aSourceProps.getLength(); ++i, ++pSourceProps)
+ for (const Property& rSourceProp : aSourceProps)
{
- if ( xDestProps->hasPropertyByName(pSourceProps->Name) )
+ if ( xDestProps->hasPropertyByName(rSourceProp.Name) )
{
try
{
- aDestProp = xDestProps->getPropertyByName(pSourceProps->Name);
+ aDestProp = xDestProps->getPropertyByName(rSourceProp.Name);
if (0 == (aDestProp.Attributes & PropertyAttribute::READONLY) )
{
- const Any aSourceValue = _rxSource->getPropertyValue(pSourceProps->Name);
+ const Any aSourceValue = _rxSource->getPropertyValue(rSourceProp.Name);
if ( 0 != (aDestProp.Attributes & PropertyAttribute::MAYBEVOID) || aSourceValue.hasValue() )
- _rxDest->setPropertyValue(pSourceProps->Name, aSourceValue);
+ _rxDest->setPropertyValue(rSourceProp.Name, aSourceValue);
}
}
catch (Exception&)
@@ -92,7 +91,7 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
#if OSL_DEBUG_LEVEL > 0
OUStringBuffer aBuffer;
aBuffer.append( "::comphelper::copyProperties: could not copy property '" );
- aBuffer.append( pSourceProps->Name );
+ aBuffer.append(rSourceProp.Name );
aBuffer.append( "' to the destination set (a '" );
Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY );
diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx
index 25e45cd94946..b204e8d4727e 100644
--- a/connectivity/source/commontools/paramwrapper.cxx
+++ b/connectivity/source/commontools/paramwrapper.cxx
@@ -131,12 +131,10 @@ namespace param
OUString ParameterWrapper::impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const
{
Reference< XPropertySetInfo > xInfo = const_cast<ParameterWrapper*>( this )->getPropertySetInfo();
- Sequence< Property > aProperties = xInfo->getProperties();
- const Property* pProperties = aProperties.getConstArray();
- for ( sal_Int32 i = 0; i < aProperties.getLength(); ++i, ++pProperties )
+ for ( const Property& rProperty : xInfo->getProperties() )
{
- if ( pProperties->Handle == _nHandle )
- return pProperties->Name;
+ if ( rProperty.Handle == _nHandle )
+ return rProperty.Name;
}
OSL_FAIL( "ParameterWrapper::impl_getPseudoAggregatePropertyName: invalid argument!" );
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index efd3eb0748c0..d1ade9cc26d5 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -170,26 +170,23 @@ void OQuery::rebuildColumns()
throw RuntimeException();
}
- Sequence< OUString> aNames = xColumns->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
- for ( sal_Int32 i = 0;pIter != pEnd; ++pIter,++i)
+ for ( const OUString& rName : xColumns->getElementNames() )
{
- Reference<XPropertySet> xSource(xColumns->getByName( *pIter ),UNO_QUERY);
- OUString sLabel = *pIter;
- if ( xColumnDefinitions.is() && xColumnDefinitions->hasByName(*pIter) )
+ Reference<XPropertySet> xSource(xColumns->getByName( rName ),UNO_QUERY);
+ OUString sLabel = rName;
+ if ( xColumnDefinitions.is() && xColumnDefinitions->hasByName(rName) )
{
- Reference<XPropertySet> xCommandColumn(xColumnDefinitions->getByName( *pIter ),UNO_QUERY);
+ Reference<XPropertySet> xCommandColumn(xColumnDefinitions->getByName( rName ),UNO_QUERY);
xCommandColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
}
OQueryColumn* pColumn = new OQueryColumn( xSource, m_xConnection, sLabel);
Reference< XChild > xChild( *pColumn, UNO_QUERY_THROW );
xChild->setParent( *this );
- implAppendColumn( *pIter, pColumn );
+ implAppendColumn( rName, pColumn );
Reference< XPropertySet > xDest( *pColumn, UNO_QUERY_THROW );
if ( m_pColumnMediator.is() )
- m_pColumnMediator->notifyElementCreated( *pIter, xDest );
+ m_pColumnMediator->notifyElementCreated( rName, xDest );
}
}
catch( const SQLContext& e )
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index b2cc08996dbf..0432b9a2e665 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -466,18 +466,14 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl
if (xSetInfo.is())
aProperties = xSetInfo->getProperties();
- if (aProperties.getLength())
+ for ( const Property& rProperty : aProperties )
{
- const Property* pProperties = aProperties.getConstArray();
- for ( sal_Int32 i=0; i<aProperties.getLength(); ++i, ++pProperties )
+ if ( ( ( rProperty.Attributes & PropertyAttribute::TRANSIENT) != 0 )
+ && ( ( rProperty.Attributes & PropertyAttribute::READONLY) == 0 )
+ )
{
- if ( ( ( pProperties->Attributes & PropertyAttribute::TRANSIENT) != 0 )
- && ( ( pProperties->Attributes & PropertyAttribute::READONLY) == 0 )
- )
- {
- // found such a property
- aRememberProps.put( pProperties->Name, xSource->getPropertyValue( pProperties->Name ) );
- }
+ // found such a property
+ aRememberProps.put( rProperty.Name, xSource->getPropertyValue( rProperty.Name ) );
}
}
}
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index e5c34a8f53e7..e074f78c818f 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -383,12 +383,10 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
{
// Export the images to the storage
Reference< XGraphicObjectResolver > xGraphicResolver = GraphicObjectResolver::createWithStorage(rxContext, xTmpPic);
- std::vector< OUString >::const_iterator it = vEmbedImgUrls.begin();
- std::vector< OUString >::const_iterator it_end = vEmbedImgUrls.end();
if ( xGraphicResolver.is() )
{
- for ( sal_Int32 count = 0; it != it_end; ++it, ++count )
- xGraphicResolver->resolveGraphicObjectURL( *it );
+ for ( const OUString& rURL : vEmbedImgUrls )
+ xGraphicResolver->resolveGraphicObjectURL( rURL );
}
// delete old 'Pictures' storage and copy the contents of tempPictures into xStorage
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index 6c5b5d5dcc59..a3aca9051c72 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -132,39 +132,38 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent)
void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, const Sequence< css::beans::PropertyValue>& aArgs)
{
- const css::beans::PropertyValue* pArguments = aArgs.getConstArray();
if ( aURL.Complete == ".uno:FormSlots/AddGridColumn" )
{
// search the argument describing the column to create
OUString sControlType;
sal_Int32 nControlPos = -1;
Sequence< css::beans::PropertyValue> aControlProps;
- for ( sal_Int32 i = 0; i < aArgs.getLength(); ++i, ++pArguments )
+ for ( const css::beans::PropertyValue& rArgument : aArgs )
{
- if ( pArguments->Name == "ColumnType" )
+ if ( rArgument.Name == "ColumnType" )
{
- auto s = o3tl::tryAccess<OUString>(pArguments->Value);
+ auto s = o3tl::tryAccess<OUString>(rArgument.Value);
OSL_ENSURE(s, "invalid type for argument \"ColumnType\" !");
if (s)
sControlType = *s;
}
- else if ( pArguments->Name == "ColumnPosition" )
+ else if ( rArgument.Name == "ColumnPosition" )
{
- auto n = o3tl::tryAccess<sal_Int16>(pArguments->Value);
+ auto n = o3tl::tryAccess<sal_Int16>(rArgument.Value);
OSL_ENSURE(n, "invalid type for argument \"ColumnPosition\" !");
if (n)
nControlPos = *n;
}
- else if ( pArguments->Name == "ColumnProperties" )
+ else if ( rArgument.Name == "ColumnProperties" )
{
auto s = o3tl::tryAccess<Sequence<css::beans::PropertyValue>>(
- pArguments->Value);
+ rArgument.Value);
OSL_ENSURE(s, "invalid type for argument \"ColumnProperties\" !");
if (s)
aControlProps = *s;
}
else
- SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (" << pArguments->Name << ") !");
+ SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (" << rArgument.Name << ") !");
}
if (sControlType.isEmpty())
{
@@ -182,17 +181,16 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
// set its properties
if (xNewColProperties.is())
{
- const css::beans::PropertyValue* pControlProps = aControlProps.getConstArray();
- for (sal_Int32 i=0; i<aControlProps.getLength(); ++i, ++pControlProps)
+ for (const css::beans::PropertyValue& rControlProp : aControlProps)
{
try
{
- if (xNewColProperties->hasPropertyByName(pControlProps->Name))
- xNewCol->setPropertyValue(pControlProps->Name, pControlProps->Value);
+ if (xNewColProperties->hasPropertyByName(rControlProp.Name))
+ xNewCol->setPropertyValue(rControlProp.Name, rControlProp.Value);
}
catch (const Exception&)
{
- SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch : could not set a column property (" << pControlProps->Name << ")!");
+ SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch : could not set a column property (" << rControlProp.Name << ")!");
}
}
}
@@ -219,11 +217,11 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
Reference< XRowSet > xMasterForm;
// search the arguments for the master form
- for (sal_Int32 i=0; i<aArgs.getLength(); ++i, ++pArguments)
+ for (const css::beans::PropertyValue& rArgument : aArgs)
{
- if ( (pArguments->Name == "MasterForm") && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE) )
+ if ( (rArgument.Name == "MasterForm") && (rArgument.Value.getValueTypeClass() == TypeClass_INTERFACE) )
{
- xMasterForm.set(pArguments->Value, UNO_QUERY);
+ xMasterForm.set(rArgument.Value, UNO_QUERY);
break;
}
}
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index 7fd72dbd7464..1fd7948ceafc 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -1206,14 +1206,11 @@ Reference< css::beans::XPropertySetInfo > SAL_CALL SbaXFormAdapter::getPropertyS
if (-1 == m_nNamePropHandle)
{
// we need to determine the handle for the NAME property
- Sequence< css::beans::Property> aProps = xReturn->getProperties();
- const css::beans::Property* pProps = aProps.getConstArray();
-
- for (sal_Int32 i=0; i<aProps.getLength(); ++i, ++pProps)
+ for (const css::beans::Property& rProp : xReturn->getProperties())
{
- if (pProps->Name == PROPERTY_NAME)
+ if (rProp.Name == PROPERTY_NAME)
{
- m_nNamePropHandle = pProps->Handle;
+ m_nNamePropHandle = rProp.Handle;
break;
}
}
@@ -1234,16 +1231,14 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< OUSt
if (!xSet.is())
return Sequence< Any>(aPropertyNames.getLength());
- Sequence< Any> aReturn = xSet->getPropertyValues(aPropertyNames);
+ Sequence< Any> aReturn = xSet->getPropertyValues(aPropertyNames);
// search for (and fake) the NAME property
- const OUString* pNames = aPropertyNames.getConstArray();
- Any* pValues = aReturn.getArray();
OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !");
- for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i, ++pNames, ++pValues)
- if (*pNames == PROPERTY_NAME)
+ for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i)
+ if (aPropertyNames[i] == PROPERTY_NAME)
{
- (*pValues) <<= m_sName;
+ aReturn[i] <<= m_sName;
break;
}
@@ -1336,9 +1331,8 @@ Sequence< css::beans::PropertyState> SAL_CALL SbaXFormAdapter::getPropertyStates
// set them all to DEFAULT
Sequence< css::beans::PropertyState> aReturn(aPropertyName.getLength());
- css::beans::PropertyState* pStates = aReturn.getArray();
- for (sal_Int32 i=0; i<aPropertyName.getLength(); ++i, ++pStates)
- *pStates = css::beans::PropertyState_DEFAULT_VALUE;
+ for (css::beans::PropertyState& rState : aReturn)
+ rState = css::beans::PropertyState_DEFAULT_VALUE;
return aReturn;
}
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 2d5d39cab684..3d0e8a75aa46 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -427,22 +427,21 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa
SolarMutexGuard aGuard;
sal_Int16 nColId = -1;
- const PropertyValue* pArgs = aArgs.getConstArray();
- for (sal_Int32 i=0; i<aArgs.getLength(); ++i, ++pArgs)
+ for (const PropertyValue& rArg : aArgs)
{
- if (pArgs->Name == "ColumnViewPos")
+ if (rArg.Name == "ColumnViewPos")
{
- nColId = pGrid->GetColumnIdFromViewPos(::comphelper::getINT16(pArgs->Value));
+ nColId = pGrid->GetColumnIdFromViewPos(::comphelper::getINT16(rArg.Value));
break;
}
- if (pArgs->Name == "ColumnModelPos")
+ if (rArg.Name == "ColumnModelPos")
{
- nColId = pGrid->GetColumnIdFromModelPos(::comphelper::getINT16(pArgs->Value));
+ nColId = pGrid->GetColumnIdFromModelPos(::comphelper::getINT16(rArg.Value));
break;
}
- if (pArgs->Name == "ColumnId")
+ if (rArg.Name == "ColumnId")
{
- nColId = ::comphelper::getINT16(pArgs->Value);
+ nColId = ::comphelper::getINT16(rArg.Value);
break;
}
}
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 3f70fdb4e1b0..689c4d2fc480 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -657,16 +657,13 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
OUString aCurrentModelType;
Reference<XColumnsSupplier> xSupCols(getRowSet(),UNO_QUERY);
Reference<XNameAccess> xColumns = xSupCols->getColumns();
- Sequence< OUString> aNames = xColumns->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
OUString sDefaultProperty;
Reference< XPropertySet > xColumn;
Reference< XPropertySetInfo > xColPSI;
- for (sal_uInt16 i=0; pIter != pEnd; ++i,++pIter)
+ for (const OUString& rName : xColumns->getElementNames())
{
- xColumn.set( xColumns->getByName( *pIter ), UNO_QUERY_THROW );
+ xColumn.set( xColumns->getByName( rName ), UNO_QUERY_THROW );
xColPSI.set( xColumn->getPropertySetInfo(), UNO_SET_THROW );
// ignore the column when it is a rowversion one
@@ -730,13 +727,13 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
break;
}
- aInitialValues.emplace_back( PROPERTY_CONTROLSOURCE, makeAny( *pIter ) );
+ aInitialValues.emplace_back( PROPERTY_CONTROLSOURCE, makeAny( rName ) );
OUString sLabel;
xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
if ( !sLabel.isEmpty() )
aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( sLabel ) );
else
- aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( *pIter ) );
+ aInitialValues.emplace_back( PROPERTY_LABEL, makeAny( rName ) );
Reference< XPropertySet > xGridCol( xColFactory->createColumn( aCurrentModelType ), UNO_SET_THROW );
Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW );
@@ -799,7 +796,7 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
)
xGridCol->setPropertyValue( *copyPropertyName, xColumn->getPropertyValue( *copyPropertyName ) );
- xColContainer->insertByName(*pIter, makeAny(xGridCol));
+ xColContainer->insertByName(rName, makeAny(xGridCol));
}
}
}
@@ -2083,11 +2080,8 @@ void SbaTableQueryBrowser::initializeTreeModel()
OUString sQueriesName, sTablesName;
// fill the model with the names of the registered datasources
- Sequence< OUString > aDatasources = m_xDatabaseContext->getElementNames();
- const OUString* pIter = aDatasources.getConstArray();
- const OUString* pEnd = pIter + aDatasources.getLength();
- for (; pIter != pEnd; ++pIter)
- implAddDatasource( *pIter, aDBImage, sQueriesName, aQueriesImage, sTablesName, aTablesImage, SharedConnection() );
+ for (const OUString& rDatasource : m_xDatabaseContext->getElementNames())
+ implAddDatasource( rDatasource, aDBImage, sQueriesName, aQueriesImage, sTablesName, aTablesImage, SharedConnection() );
}
}
@@ -2101,22 +2095,19 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce
try
{
- Sequence< OUString > aNames = _xNameAccess->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
- for (; pIter != pEnd; ++pIter)
+ for (const OUString& rName : _xNameAccess->getElementNames())
{
- if( !m_pTreeView->getListBox().GetEntryPosByName(*pIter,_pParent))
+ if( !m_pTreeView->getListBox().GetEntryPosByName(rName,_pParent))
{
DBTreeListUserData* pEntryData = new DBTreeListUserData;
pEntryData->eType = _eEntryType;
if ( _eEntryType == etQuery )
{
- Reference<XNameAccess> xChild(_xNameAccess->getByName(*pIter),UNO_QUERY);
+ Reference<XNameAccess> xChild(_xNameAccess->getByName(rName),UNO_QUERY);
if ( xChild.is() )
pEntryData->eType = etQueryContainer;
}
- implAppendEntry( _pParent, *pIter, pEntryData, pEntryData->eType );
+ implAppendEntry( _pParent, rName, pEntryData, pEntryData->eType );
}
}
}
@@ -3591,14 +3582,11 @@ void SbaTableQueryBrowser::frameAction(const css::frame::FrameActionEvent& aEven
void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _xColContainer)
{
// first we have to clear the grid
- Sequence< OUString > aNames = _xColContainer->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
Reference< XInterface > xColumn;
- for (; pIter != pEnd;++pIter)
+ for (const OUString& rName : _xColContainer->getElementNames())
{
- _xColContainer->getByName(*pIter) >>= xColumn;
- _xColContainer->removeByName(*pIter);
+ _xColContainer->getByName(rName) >>= xColumn;
+ _xColContainer->removeByName(rName);
::comphelper::disposeComponent(xColumn);
}
}
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index bb47bb39b41f..78249cacf006 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -589,18 +589,17 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr
catch(Exception&) { }
// collect the names of the additional settings
- const PropertyValue* pAdditionalInfo = aAdditionalInfo.getConstArray();
PropertyValueSet aInfos;
- for (sal_Int32 i=0; i<aAdditionalInfo.getLength(); ++i, ++pAdditionalInfo)
+ for (const PropertyValue& rAdditionalInfo : aAdditionalInfo)
{
- if( pAdditionalInfo->Name == "JDBCDRV" )
+ if( rAdditionalInfo.Name == "JDBCDRV" )
{ // compatibility
- PropertyValue aCompatibility(*pAdditionalInfo);
+ PropertyValue aCompatibility(rAdditionalInfo);
aCompatibility.Name = "JavaDriverClass";
aInfos.insert(aCompatibility);
}
else
- aInfos.insert(*pAdditionalInfo);
+ aInfos.insert(rAdditionalInfo);
}
// go through all known translations and check if we have such a setting
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 17036195cf44..0a496280ba2f 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -281,20 +281,16 @@ void ODbaseIndexDialog::Init()
// first assume for all indexes they're free
- Sequence< OUString> aFolderContent( ::utl::LocalFileHelper::GetFolderContents(m_aDSN,bFolder));
-
OUString const aIndexExt("ndx");
OUString const aTableExt("dbf");
std::vector< OUString > aUsedIndexes;
- const OUString *pBegin = aFolderContent.getConstArray();
- const OUString *pEnd = pBegin + aFolderContent.getLength();
aURL.SetSmartProtocol(INetProtocol::File);
- for(;pBegin != pEnd;++pBegin)
+ for(const OUString& rURL : ::utl::LocalFileHelper::GetFolderContents(m_aDSN, bFolder))
{
OUString aName;
- osl::FileBase::getSystemPathFromFileURL(pBegin->getStr(),aName);
+ osl::FileBase::getSystemPathFromFileURL(rURL,aName);
aURL.SetSmartURL(aName);
OUString aExt = aURL.getExtension();
if (aExt == aIndexExt)
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 3832c9183287..1f974a83de6c 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -159,13 +159,12 @@ namespace dbaui
SvTreeListEntry* pRootEntry = m_pTablesList->getAllObjectsEntry();
- const OUString* pIncludeTable = _rTables.getConstArray();
- for (sal_Int32 i=0; i<_rTables.getLength(); ++i, ++pIncludeTable)
+ for (const OUString& rIncludeTable : _rTables)
{
if (xMeta.is())
- qualifiedNameComponents(xMeta, pIncludeTable->getStr(), sCatalog, sSchema, sName,::dbtools::EComposeRule::InDataManipulation);
+ qualifiedNameComponents(xMeta, rIncludeTable.getStr(), sCatalog, sSchema, sName,::dbtools::EComposeRule::InDataManipulation);
else
- sName = *pIncludeTable;
+ sName = rIncludeTable;
bool bAllTables = (1 == sName.getLength()) && ('%' == sName[0]);
bool bAllSchemas = (1 == sSchema.getLength()) && ('%' == sSchema[0]);
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 00c2eaf5dddf..bae06ba9c1ca 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -879,8 +879,8 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
{
const sal_uInt32* pDeletedKeys = pInfoItem->GetDelArray();
- for (sal_uInt32 i=0; i< pInfoItem->GetDelCount(); ++i, ++pDeletedKeys)
- _pFormatter->DeleteEntry(*pDeletedKeys);
+ for (sal_uInt32 i=0; i< pInfoItem->GetDelCount(); ++i)
+ _pFormatter->DeleteEntry(pDeletedKeys[i]);
}
}
}
@@ -916,16 +916,14 @@ bool appendToFilter(const Reference<XConnection>& _xConnection,
xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= aFilter;
// first check if we have something like SCHEMA.%
bool bHasToInsert = true;
- const OUString* pBegin = aFilter.getConstArray();
- const OUString* pEnd = pBegin + aFilter.getLength();
- for (;pBegin != pEnd; ++pBegin)
+ for (const OUString& rItem : aFilter)
{
- if(pBegin->indexOf('%') != -1)
+ if(rItem.indexOf('%') != -1)
{
sal_Int32 nLen;
- if((nLen = pBegin->lastIndexOf('.')) != -1 && !pBegin->compareTo(_sName,nLen))
+ if((nLen = rItem.lastIndexOf('.')) != -1 && !rItem.compareTo(_sName,nLen))
bHasToInsert = false;
- else if(pBegin->getLength() == 1)
+ else if(rItem.getLength() == 1)
bHasToInsert = false;
}
}
diff --git a/dbaccess/source/ui/misc/stringlistitem.cxx b/dbaccess/source/ui/misc/stringlistitem.cxx
index 32649443b14e..fb865df54bb4 100644
--- a/dbaccess/source/ui/misc/stringlistitem.cxx
+++ b/dbaccess/source/ui/misc/stringlistitem.cxx
@@ -44,11 +44,8 @@ bool OStringListItem::operator==(const SfxPoolItem& _rItem) const
return false;
// compare all strings individually
- const OUString* pMyStrings = m_aList.getConstArray();
- const OUString* pCompareStrings = pCompare->m_aList.getConstArray();
-
- for (sal_Int32 i=0; i<m_aList.getLength(); ++i, ++pMyStrings, ++pCompareStrings)
- if (*pMyStrings != *pCompareStrings)
+ for (sal_Int32 i=0; i<m_aList.getLength(); ++i)
+ if (m_aList[i] != pCompare->m_aList[i])
return false;
return true;
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 5144525f2c97..d721ed7da46d 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -139,13 +139,10 @@ namespace
OUString sRelatedColumn;
// iterate through all foreignkey columns to create the connections
- Sequence< OUString> aElements(_rxSourceForeignKeyColumns->getElementNames());
- const OUString* pIter = aElements.getConstArray();
- const OUString* pEnd = pIter + aElements.getLength();
- for(sal_Int32 i=0;pIter != pEnd;++pIter,++i)
+ for(const OUString& rElement : _rxSourceForeignKeyColumns->getElementNames())
{
Reference<XPropertySet> xColumn;
- if ( !( _rxSourceForeignKeyColumns->getByName(*pIter) >>= xColumn ) )
+ if ( !( _rxSourceForeignKeyColumns->getByName(rElement) >>= xColumn ) )
{
OSL_FAIL( "addConnections: invalid foreign key column!" );
continue;
@@ -154,7 +151,7 @@ namespace
xColumn->getPropertyValue(PROPERTY_RELATEDCOLUMN) >>= sRelatedColumn;
{
- Sequence< sal_Int16> aFind(::comphelper::findValue(_rSource.GetOriginalColumns()->getElementNames(),*pIter,true));
+ Sequence< sal_Int16> aFind(::comphelper::findValue(_rSource.GetOriginalColumns()->getElementNames(),rElement,true));
if(aFind.getLength())
pNewConnData->SetFieldIndex(JTCS_FROM,aFind[0]+1);
else
@@ -170,7 +167,7 @@ namespace
else
OSL_FAIL("Column not found!");
}
- pNewConnData->AppendConnLine(*pIter,sRelatedColumn);
+ pNewConnData->AppendConnLine(rElement,sRelatedColumn);
// now add the Conn itself
ScopedVclPtrInstance< OQueryTableConnection > aNewConn(_pView, aNewConnData);
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 3bb0804ae42b..233141474c4c 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -315,12 +315,11 @@ namespace
{
osl_setThreadName("RelationLoader");
- const OUString* pIter = m_aTableList.getConstArray() + m_nStartIndex;
- for(sal_Int32 i = m_nStartIndex; i < m_nEndIndex;++i,++pIter)
+ for(sal_Int32 i = m_nStartIndex; i < m_nEndIndex; ++i)
{
OUString sCatalog,sSchema,sTable;
::dbtools::qualifiedNameComponents(m_xMetaData,
- *pIter,
+ m_aTableList[i],
sCatalog,
sSchema,
sTable,
@@ -335,7 +334,7 @@ namespace
if ( xResult.is() && xResult->next() )
{
::comphelper::disposeComponent(xResult);
- loadTableData(m_xTables->getByName(*pIter));
+ loadTableData(m_xTables->getByName(m_aTableList[i]));
}
}
catch( const Exception& )
@@ -406,14 +405,12 @@ namespace
// insert columns
const Reference<XColumnsSupplier> xColsSup(xKey,UNO_QUERY);
OSL_ENSURE(xColsSup.is(),"Key is no XColumnsSupplier!");
- const Reference<XNameAccess> xColumns = xColsSup->getColumns();
+ const Reference<XNameAccess> xColumns = xColsSup->getColumns();
const Sequence< OUString> aNames = xColumns->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
OUString sColumnName,sRelatedName;
- for(sal_uInt16 j=0;pIter != pEnd;++pIter,++j)
+ for(sal_Int32 j=0;j<aNames.getLength();++j)
{
- const Reference<XPropertySet> xPropSet(xColumns->getByName(*pIter),UNO_QUERY);
+ const Reference<XPropertySet> xPropSet(xColumns->getByName(aNames[j]),UNO_QUERY);
OSL_ENSURE(xPropSet.is(),"Invalid column found in KeyColumns!");
if ( xPropSet.is() )
{
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 438497169b3f..86bcbbdd2692 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -781,14 +781,11 @@ void OTableController::loadData()
// For Add and Drop all rows can be edited
// sal_Bool bReadOldRow = xMetaData->supportsAlterTableWithAddColumn() && xMetaData->supportsAlterTableWithDropColumn();
bool bIsAlterAllowed = isAlterAllowed();
- Sequence< OUString> aColumns = xColumns->getElementNames();
- const OUString* pIter = aColumns.getConstArray();
- const OUString* pEnd = pIter + aColumns.getLength();
- for(;pIter != pEnd;++pIter)
+ for(const OUString& rColumn : xColumns->getElementNames())
{
Reference<XPropertySet> xColumn;
- xColumns->getByName(*pIter) >>= xColumn;
+ xColumns->getByName(rColumn) >>= xColumn;
sal_Int32 nType = 0;
sal_Int32 nScale = 0;
sal_Int32 nPrecision = 0;
@@ -855,19 +852,13 @@ void OTableController::loadData()
Reference<XNameAccess> xKeyColumns = getKeyColumns();
if(xKeyColumns.is())
{
- Sequence< OUString> aKeyColumns = xKeyColumns->getElementNames();
- const OUString* pKeyBegin = aKeyColumns.getConstArray();
- const OUString* pKeyEnd = pKeyBegin + aKeyColumns.getLength();
-
- for(;pKeyBegin != pKeyEnd;++pKeyBegin)
+ for(const OUString& rKeyColumn : xKeyColumns->getElementNames())
{
- std::vector< std::shared_ptr<OTableRow> >::const_iterator rowIter = m_vRowList.begin();
- std::vector< std::shared_ptr<OTableRow> >::const_iterator rowEnd = m_vRowList.end();
- for(;rowIter != rowEnd;++rowIter)
+ for(std::shared_ptr<OTableRow> const& pRow : m_vRowList)
{
- if((*rowIter)->GetActFieldDescr()->GetName() == *pKeyBegin)
+ if(pRow->GetActFieldDescr()->GetName() == rKeyColumn)
{
- (*rowIter)->SetPrimaryKey(true);
+ pRow->SetPrimaryKey(true);
break;
}
}
@@ -1176,17 +1167,14 @@ void OTableController::alterColumns()
// now we have to look for the columns who could be deleted
if ( xDrop.is() )
{
- Sequence< OUString> aColumnNames = xColumns->getElementNames();
- const OUString* pIter = aColumnNames.getConstArray();
- const OUString* pEnd = pIter + aColumnNames.getLength();
- for(;pIter != pEnd;++pIter)
+ for(const OUString& rColumnName : xColumns->getElementNames())
{
- if(aColumns.find(*pIter) == aColumns.end()) // found a column to delete
+ if(aColumns.find(rColumnName) == aColumns.end()) // found a column to delete
{
- if(xKeyColumns.is() && xKeyColumns->hasByName(*pIter)) // check if this column is a member of the primary key
+ if(xKeyColumns.is() && xKeyColumns->hasByName(rColumnName)) // check if this column is a member of the primary key
{
OUString aMsgT(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN));
- aMsgT = aMsgT.replaceFirst("$column$",*pIter);
+ aMsgT = aMsgT.replaceFirst("$column$",rColumnName);
OUString aTitle(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,MessBoxStyle::YesNo| MessBoxStyle::DefaultYes);
if(aMsg->Execute() == RET_YES)
@@ -1202,12 +1190,12 @@ void OTableController::alterColumns()
}
try
{
- xDrop->dropByName(*pIter);
+ xDrop->dropByName(rColumnName);
}
catch (const SQLException&)
{
OUString sError( DBA_RES( STR_TABLEDESIGN_COULD_NOT_DROP_COL ) );
- sError = sError.replaceFirst( "$column$", *pIter );
+ sError = sError.replaceFirst( "$column$", rColumnName );
SQLException aNewException;
aNewException.Message = sError;
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 636cd7124947..c13c75f8cfc4 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1166,8 +1166,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
}
++nRowCount;
- ODatabaseExport::TPositions::const_iterator aPosIter = aColumnPositions.begin();
- ODatabaseExport::TPositions::const_iterator aPosEnd = aColumnPositions.end();
aCopyEvent.Error.clear();
try
@@ -1180,9 +1178,9 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
sal_Int32 nSourceColumn( 1 );
ValueTransfer aTransfer( nSourceColumn, nDestColumn, aSourceColTypes, xRow, xStatementParams );
- for ( ; aPosIter != aPosEnd; ++aPosIter )
+ for ( auto const& rColumnPos : aColumnPositions )
{
- nDestColumn = aPosIter->first;
+ nDestColumn = rColumnPos.first;
if ( nDestColumn == COLUMN_POSITION_NOT_FOUND )
{
++nSourceColumn;
@@ -1432,9 +1430,7 @@ OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference<
const OUString sQuote = xDestMetaData->getIdentifierQuoteString();
OUStringBuffer sColumns;
// 1st check if the columns matching
- const OCopyTableWizard& rWizard = impl_getDialog_throw();
- ODatabaseExport::TPositions const & rColumnPositions = rWizard.GetColumnPositions();
- for ( auto const & rColumnPositionPair : rColumnPositions )
+ for ( auto const & rColumnPositionPair : impl_getDialog_throw().GetColumnPositions() )
{
if ( COLUMN_POSITION_NOT_FOUND != rColumnPositionPair.second )
{
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 043fe62e6c8d..86925c518a15 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -389,55 +389,49 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName)
// get migration description from org.openoffice.Setup/Migration
// and build vector of migration steps
uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName("MigrationSteps"), uno::UNO_QUERY_THROW);
- uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames();
uno::Reference< XNameAccess > tmpAccess;
uno::Sequence< OUString > tmpSeq;
migrations_vr vrMigrations(new migrations_v);
- for (sal_Int32 i = 0; i < seqMigrations.getLength(); i++) {
+ for (const OUString& rMigrationStep : theNameAccess->getElementNames()) {
// get current migration step
- theNameAccess->getByName(seqMigrations[i]) >>= tmpAccess;
+ theNameAccess->getByName(rMigrationStep) >>= tmpAccess;
migration_step tmpStep;
- tmpStep.name = seqMigrations[i];
+ tmpStep.name = rMigrationStep;
// read included files from current step description
- OUString aSeqEntry;
if (tmpAccess->getByName("IncludedFiles") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++) {
- aSeqEntry = tmpSeq[j];
- tmpStep.includeFiles.push_back(aSeqEntry);
- }
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.includeFiles.push_back(rSeqEntry);
}
// excluded files...
if (tmpAccess->getByName("ExcludedFiles") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.excludeFiles.push_back(tmpSeq[j]);
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.excludeFiles.push_back(rSeqEntry);
}
// included nodes...
if (tmpAccess->getByName("IncludedNodes") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.includeConfig.push_back(tmpSeq[j]);
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.includeConfig.push_back(rSeqEntry);
}
// excluded nodes...
if (tmpAccess->getByName("ExcludedNodes") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.excludeConfig.push_back(tmpSeq[j]);
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.excludeConfig.push_back(rSeqEntry);
}
// included extensions...
if (tmpAccess->getByName("IncludedExtensions") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
- tmpStep.includeExtensions.push_back(tmpSeq[j]);
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.includeExtensions.push_back(rSeqEntry);
}
// excluded extensions...
if (tmpAccess->getByName("ExcludedExtensions") >>= tmpSeq) {
- for (sal_Int32 j=0; j<tmpSeq.getLength(); j++) {
- aSeqEntry = tmpSeq[j];
- tmpStep.excludeExtensions.push_back(aSeqEntry);
- }
+ for (const OUString& rSeqEntry : tmpSeq)
+ tmpStep.excludeExtensions.push_back(rSeqEntry);
}
// generic service
@@ -714,20 +708,17 @@ uno::Sequence< OUString > setToSeq(std::set< OUString > const & set)
void MigrationImpl::copyConfig()
{
Components comps;
- for (migrations_v::const_iterator i(m_vrMigrations->begin());
- i != m_vrMigrations->end(); ++i) {
- for (strings_v::const_iterator j(i->includeConfig.begin());
- j != i->includeConfig.end(); ++j) {
+ for (auto const& rMigrationStep : *m_vrMigrations) {
+ for (const OUString& rIncludePath : rMigrationStep.includeConfig) {
OUString comp;
- if (getComponent(*j, &comp)) {
- comps[comp].includedPaths.insert(*j);
+ if (getComponent(rIncludePath, &comp)) {
+ comps[comp].includedPaths.insert(rIncludePath);
}
}
- for (strings_v::const_iterator j(i->excludeConfig.begin());
- j != i->excludeConfig.end(); ++j) {
+ for (const OUString& rExcludePath : rMigrationStep.excludeConfig) {
OUString comp;
- if (getComponent(*j, &comp)) {
- comps[comp].excludedPaths.insert(*j);
+ if (getComponent(rExcludePath, &comp)) {
+ comps[comp].excludedPaths.insert(rExcludePath);
}
}
}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index a9eb2cdb1488..6ed4cd3cd3a7 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -284,16 +284,11 @@ void CommandEnvironmentImpl::handle(
}
// select:
- Sequence< Reference<task::XInteractionContinuation> > conts(
- xRequest->getContinuations() );
- Reference<task::XInteractionContinuation> const * pConts =
- conts.getConstArray();
- sal_Int32 len = conts.getLength();
- for ( sal_Int32 pos = 0; pos < len; ++pos )
+ for ( auto const& rCont : xRequest->getContinuations() )
{
if (approve) {
Reference<task::XInteractionApprove> xInteractionApprove(
- pConts[ pos ], UNO_QUERY );
+ rCont, UNO_QUERY );
if (xInteractionApprove.is()) {
xInteractionApprove->select();
break;
@@ -301,7 +296,7 @@ void CommandEnvironmentImpl::handle(
}
else if (abort) {
Reference<task::XInteractionAbort> xInteractionAbort(
- pConts[ pos ], UNO_QUERY );
+ rCont, UNO_QUERY );
if (xInteractionAbort.is()) {
xInteractionAbort->select();
break;
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 2348709303b1..d985d6648cea 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1218,12 +1218,9 @@ namespace accessibility
::comphelper::SequenceAsHashMap aPropHashMap( getDefaultAttributes( aPropertyNames ) );
// ... and override them with the direct attributes from the specific position
- uno::Sequence< beans::PropertyValue > aRunAttribs( getRunAttributes( nIndex, aPropertyNames ) );
- sal_Int32 nRunAttribs = aRunAttribs.getLength();
- const beans::PropertyValue *pRunAttrib = aRunAttribs.getConstArray();
- for (sal_Int32 k = 0; k < nRunAttribs; ++k)
+ const uno::Sequence< beans::PropertyValue > aRunAttribs( getRunAttributes( nIndex, aPropertyNames ) );
+ for (auto const& rRunAttrib : aRunAttribs)
{
- const beans::PropertyValue &rRunAttrib = pRunAttrib[k];
aPropHashMap[ rRunAttrib.Name ] = rRunAttrib.Value; //!! should not only be the value !!
}
@@ -1234,16 +1231,13 @@ namespace accessibility
// since SequenceAsHashMap ignores property handles and property state
// we have to restore the property state here (property handles are
// of no use to the accessibility API).
- sal_Int32 nRes = aRes.getLength();
- beans::PropertyValue *pRes = aRes.getArray();
- for (sal_Int32 i = 0; i < nRes; ++i)
+ for (beans::PropertyValue & rRes : aRes)
{
- beans::PropertyValue &rRes = pRes[i];
bool bIsDirectVal = false;
- for (sal_Int32 k = 0; k < nRunAttribs && !bIsDirectVal; ++k)
+ for (auto const& rRunAttrib : aRunAttribs)
{
- if (rRes.Name == pRunAttrib[k].Name)
- bIsDirectVal = true;
+ if ((bIsDirectVal = rRes.Name == rRunAttrib.Name))
+ break;
}
rRes.Handle = -1;
rRes.State = bIsDirectVal ? PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;
@@ -1252,10 +1246,9 @@ namespace accessibility
{
_correctValues( aRes );
// NumberingPrefix
- nRes = aRes.getLength();
+ sal_Int32 nRes = aRes.getLength();
aRes.realloc( nRes + 1 );
- pRes = aRes.getArray();
- beans::PropertyValue &rRes = pRes[nRes];
+ beans::PropertyValue &rRes = aRes[nRes];
rRes.Name = "NumberingPrefix";
OUString numStr;
if (aBulletInfo.nType != SVX_NUM_CHAR_SPECIAL && aBulletInfo.nType != SVX_NUM_BITMAP)
@@ -1269,32 +1262,30 @@ namespace accessibility
{
nRes = aRes.getLength();
aRes.realloc( nRes + 1 );
- pRes = aRes.getArray();
- beans::PropertyValue &rResField = pRes[nRes];
- beans::PropertyValue aFieldType;
+ beans::PropertyValue &rResField = aRes[nRes];
rResField.Name = "FieldType";
rResField.Value <<= strFieldType.toAsciiLowerCase();
rResField.Handle = -1;
rResField.State = PropertyState_DIRECT_VALUE;
- }
- //sort property values
- // build sorted index array
- sal_Int32 nLength = aRes.getLength();
- const beans::PropertyValue* pPairs = aRes.getConstArray();
- std::unique_ptr<sal_Int32[]> pIndices(new sal_Int32[nLength]);
- sal_Int32 i = 0;
- for( i = 0; i < nLength; i++ )
- pIndices[i] = i;
- sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
- // create sorted sequences according to index array
- uno::Sequence<beans::PropertyValue> aNewValues( nLength );
- beans::PropertyValue* pNewValues = aNewValues.getArray();
- for( i = 0; i < nLength; i++ )
- {
- pNewValues[i] = pPairs[pIndices[i]];
- }
+ }
+ //sort property values
+ // build sorted index array
+ sal_Int32 nLength = aRes.getLength();
+ const beans::PropertyValue* pPairs = aRes.getConstArray();
+ std::unique_ptr<sal_Int32[]> pIndices(new sal_Int32[nLength]);
+ sal_Int32 i = 0;
+ for( i = 0; i < nLength; i++ )
+ pIndices[i] = i;
+ sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
+ // create sorted sequences according to index array
+ uno::Sequence<beans::PropertyValue> aNewValues( nLength );
+ beans::PropertyValue* pNewValues = aNewValues.getArray();
+ for( i = 0; i < nLength; i++ )
+ {
+ pNewValues[i] = pPairs[pIndices[i]];
+ }
- return aNewValues;
+ return aNewValues;
}
return aRes;
}
@@ -2352,20 +2343,16 @@ namespace accessibility
xPropSet->SetSelection( MakeSelection(nStartIndex, nEndIndex) );
// convert from PropertyValue to Any
- sal_Int32 i, nLength( aAttributeSet.getLength() );
- const beans::PropertyValue* pPropArray = aAttributeSet.getConstArray();
- for(i=0; i<nLength; ++i)
+ for(const beans::PropertyValue& rProp : aAttributeSet)
{
try
{
- xPropSet->setPropertyValue(pPropArray->Name, pPropArray->Value);
+ xPropSet->setPropertyValue(rProp.Name, rProp.Value);
}
catch (const uno::Exception&)
{
OSL_FAIL("AccessibleEditableTextPara::setAttributes exception in setPropertyValue");
}
-
- ++pPropArray;
}
rCacheTF.QuickFormatDoc();
@@ -2410,21 +2397,18 @@ namespace accessibility
( static_cast< XAccessible* > (this) ) ); // disambiguate hierarchy
// build sequence of available properties to check
- sal_Int32 nLenReqAttr = rRequestedAttributes.getLength();
uno::Sequence< beans::Property > aProperties;
- if (nLenReqAttr)
+ if (const sal_Int32 nLenReqAttr = rRequestedAttributes.getLength())
{
- const OUString *pRequestedAttributes = rRequestedAttributes.getConstArray();
-
aProperties.realloc( nLenReqAttr );
beans::Property *pProperties = aProperties.getArray();
sal_Int32 nCurLen = 0;
- for (sal_Int32 i = 0; i < nLenReqAttr; ++i)
+ for (const OUString& rRequestedAttribute : rRequestedAttributes)
{
beans::Property aProp;
try
{
- aProp = xPropSetInfo->getPropertyByName( pRequestedAttributes[i] );
+ aProp = xPropSetInfo->getPropertyByName( rRequestedAttribute );
}
catch (const beans::UnknownPropertyException&)
{
@@ -2437,19 +2421,16 @@ namespace accessibility
else
aProperties = xPropSetInfo->getProperties();
- sal_Int32 nLength = aProperties.getLength();
- const beans::Property *pProperties = aProperties.getConstArray();
-
// build resulting sequence
- uno::Sequence< beans::PropertyValue > aOutSequence( nLength );
+ uno::Sequence< beans::PropertyValue > aOutSequence( aProperties.getLength() );
beans::PropertyValue* pOutSequence = aOutSequence.getArray();
sal_Int32 nOutLen = 0;
- for (sal_Int32 i = 0; i < nLength; ++i)
+ for (const beans::Property& rProperty : aProperties)
{
// calling implementation functions:
// _getPropertyState and _getPropertyValue (see below) to provide
// the proper paragraph number when retrieving paragraph attributes
- PropertyState eState = xPropSet->_getPropertyState( pProperties->Name, mnParagraphIndex );
+ PropertyState eState = xPropSet->_getPropertyState( rProperty.Name, mnParagraphIndex );
if ( eState == PropertyState_AMBIGUOUS_VALUE )
{
OSL_FAIL( "ambiguous property value encountered" );
@@ -2460,15 +2441,14 @@ namespace accessibility
// properties spanning the whole paragraph should be returned
// and declared as default value
{
- pOutSequence->Name = pProperties->Name;
- pOutSequence->Handle = pProperties->Handle;
- pOutSequence->Value = xPropSet->_getPropertyValue( pProperties->Name, mnParagraphIndex );
+ pOutSequence->Name = rProperty.Name;
+ pOutSequence->Handle = rProperty.Handle;
+ pOutSequence->Value = xPropSet->_getPropertyValue( rProperty.Name, mnParagraphIndex );
pOutSequence->State = PropertyState_DEFAULT_VALUE;
++pOutSequence;
++nOutLen;
}
- ++pProperties;
}
aOutSequence.realloc( nOutLen );
@@ -2503,21 +2483,18 @@ namespace accessibility
( static_cast< XAccessible* > (this) ) ); // disambiguate hierarchy
// build sequence of available properties to check
- sal_Int32 nLenReqAttr = rRequestedAttributes.getLength();
uno::Sequence< beans::Property > aProperties;
- if (nLenReqAttr)
+ if (const sal_Int32 nLenReqAttr = rRequestedAttributes.getLength())
{
- const OUString *pRequestedAttributes = rRequestedAttributes.getConstArray();
-
aProperties.realloc( nLenReqAttr );
beans::Property *pProperties = aProperties.getArray();
sal_Int32 nCurLen = 0;
- for (sal_Int32 i = 0; i < nLenReqAttr; ++i)
+ for (const OUString& rRequestedAttribute : rRequestedAttributes)
{
beans::Property aProp;
try
{
- aProp = xPropSetInfo->getPropertyByName( pRequestedAttributes[i] );
+ aProp = xPropSetInfo->getPropertyByName( rRequestedAttribute );
}
catch (const beans::UnknownPropertyException&)
{
@@ -2530,28 +2507,24 @@ namespace accessibility
else
aProperties = xPropSetInfo->getProperties();
- sal_Int32 nLength = aProperties.getLength();
- const beans::Property *pProperties = aProperties.getConstArray();
-
// build resulting sequence
- uno::Sequence< beans::PropertyValue > aOutSequence( nLength );
+ uno::Sequence< beans::PropertyValue > aOutSequence( aProperties.getLength() );
beans::PropertyValue* pOutSequence = aOutSequence.getArray();
sal_Int32 nOutLen = 0;
- for (sal_Int32 i = 0; i < nLength; ++i)
+ for (const beans::Property& rProperty : aProperties)
{
// calling 'regular' functions that will operate on the selection
- PropertyState eState = xPropSet->getPropertyState( pProperties->Name );
+ PropertyState eState = xPropSet->getPropertyState( rProperty.Name );
if (eState == PropertyState_DIRECT_VALUE)
{
- pOutSequence->Name = pProperties->Name;
- pOutSequence->Handle = pProperties->Handle;
- pOutSequence->Value = xPropSet->getPropertyValue( pProperties->Name );
+ pOutSequence->Name = rProperty.Name;
+ pOutSequence->Handle = rProperty.Handle;
+ pOutSequence->Value = xPropSet->getPropertyValue( rProperty.Name );
pOutSequence->State = eState;
++pOutSequence;
++nOutLen;
}
- ++pProperties;
}
aOutSequence.realloc( nOutLen );
diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index 3f8df4907ed5..5bd97c67a197 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -59,8 +59,7 @@ SvxAutoCorrCfg::SvxAutoCorrCfg() :
Reference < ucb::XCommandEnvironment > xEnv;
::utl::UCBContentHelper::ensureFolder(comphelper::getProcessComponentContext(), xEnv, sUserPath, aContent);
- OUString* pS = &sSharePath;
- for( sal_uInt16 n = 0; n < 2; ++n, pS = &sUserPath )
+ for( OUString* pS : { &sSharePath, &sUserPath } )
{
INetURLObject aPath( *pS );
aPath.insertName("acor");
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 82a90486bc65..aced15ee0f53 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1042,43 +1042,32 @@ uno::Sequence< beans::PropertyState > SAL_CALL SvxUnoTextRangeBase::getPropertyS
uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(const uno::Sequence< OUString >& PropertyName, sal_Int32 nPara /* = -1 */)
{
- const sal_Int32 nCount = PropertyName.getLength();
- const OUString* pNames = PropertyName.getConstArray();
-
- uno::Sequence< beans::PropertyState > aRet( nCount );
- beans::PropertyState* pState = aRet.getArray();
+ uno::Sequence< beans::PropertyState > aRet( PropertyName.getLength() );
SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
if( pForwarder )
{
- SfxItemSet* pSet = nullptr;
+ std::unique_ptr<SfxItemSet> pSet;
if( nPara != -1 )
{
- pSet = new SfxItemSet( pForwarder->GetParaAttribs( nPara ) );
+ pSet.reset(new SfxItemSet( pForwarder->GetParaAttribs( nPara ) ));
}
else
{
ESelection aSel( GetSelection() );
CheckSelection( aSel, pForwarder );
- pSet = new SfxItemSet( pForwarder->GetAttribs( aSel, EditEngineAttribs::OnlyHard ) );
+ pSet.reset(new SfxItemSet( pForwarder->GetAttribs( aSel, EditEngineAttribs::OnlyHard ) ));
}
- bool bUnknownPropertyFound = false;
- for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
+ beans::PropertyState* pState = aRet.getArray();
+ for( const OUString& rName : PropertyName )
{
- const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( *pNames++ );
- if( nullptr == pMap )
+ const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( rName );
+ if( !_getOnePropertyStates(pSet.get(), pMap, *pState++) )
{
- bUnknownPropertyFound = true;
- break;
+ throw beans::UnknownPropertyException();
}
- bUnknownPropertyFound = !_getOnePropertyStates(pSet, pMap, *pState++);
}
-
- delete pSet;
-
- if( bUnknownPropertyFound )
- throw beans::UnknownPropertyException();
}
return aRet;
@@ -1302,22 +1291,20 @@ void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault()
void SAL_CALL SvxUnoTextRangeBase::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
{
- sal_Int32 nCount = aPropertyNames.getLength();
- for( const OUString* pName = aPropertyNames.getConstArray(); nCount; pName++, nCount-- )
+ for( const OUString& rName : aPropertyNames )
{
- setPropertyToDefault( *pName );
+ setPropertyToDefault( rName );
}
}
uno::Sequence< uno::Any > SAL_CALL SvxUnoTextRangeBase::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
{
- sal_Int32 nCount = aPropertyNames.getLength();
- uno::Sequence< uno::Any > ret( nCount );
+ uno::Sequence< uno::Any > ret( aPropertyNames.getLength() );
uno::Any* pDefaults = ret.getArray();
- for( const OUString* pName = aPropertyNames.getConstArray(); nCount; pName++, nCount--, pDefaults++ )
+ for( const OUString& rName : aPropertyNames )
{
- *pDefaults = getPropertyDefault( *pName );
+ *pDefaults++ = getPropertyDefault( rName );
}
return ret;
@@ -2004,13 +1991,11 @@ void SvxPropertyValuesToItemSet(
SvxTextForwarder *pForwarder /*needed for WID_NUMLEVEL*/,
sal_Int32 nPara /*needed for WID_NUMLEVEL*/)
{
- sal_Int32 nProps = rPropertyVaules.getLength();
- const beans::PropertyValue *pProps = rPropertyVaules.getConstArray();
- for (sal_Int32 i = 0; i < nProps; ++i)
+ for (const beans::PropertyValue& rProp : rPropertyVaules)
{
- const SfxItemPropertySimpleEntry *pEntry = pPropSet->getPropertyMap().getByName( pProps[i].Name );
+ const SfxItemPropertySimpleEntry *pEntry = pPropSet->getPropertyMap().getByName( rProp.Name );
if (!pEntry)
- throw beans::UnknownPropertyException( "Unknown property: " + pProps[i].Name, static_cast < cppu::OWeakObject * > ( nullptr ) );
+ throw beans::UnknownPropertyException( "Unknown property: " + rProp.Name, static_cast < cppu::OWeakObject * > ( nullptr ) );
// Note: there is no need to take special care of the properties
// TextField (EE_FEATURE_FIELD) and
// TextPortionType (WID_PORTIONTYPE)
@@ -2018,13 +2003,13 @@ void SvxPropertyValuesToItemSet(
if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
// should be PropertyVetoException which is not yet defined for the new import API's functions
- throw uno::RuntimeException("Property is read-only: " + pProps[i].Name, static_cast < cppu::OWeakObject * > ( nullptr ) );
- //throw PropertyVetoException ("Property is read-only: " + pProps[i].Name, static_cast < cppu::OWeakObject * > ( 0 ) );
+ throw uno::RuntimeException("Property is read-only: " + rProp.Name, static_cast < cppu::OWeakObject * > ( nullptr ) );
+ //throw PropertyVetoException ("Property is read-only: " + rProp.Name, static_cast < cppu::OWeakObject * > ( 0 ) );
if (pEntry->nWID == WID_FONTDESC)
{
awt::FontDescriptor aDesc;
- if (pProps[i].Value >>= aDesc)
+ if (rProp.Value >>= aDesc)
SvxUnoFontDescriptor::FillItemSet( aDesc, rItemSet );
}
else if (pEntry->nWID == WID_NUMLEVEL)
@@ -2032,7 +2017,7 @@ void SvxPropertyValuesToItemSet(
if (pForwarder)
{
sal_Int16 nLevel = -1;
- pProps[i].Value >>= nLevel;
+ rProp.Value >>= nLevel;
// #101004# Call interface method instead of unsafe cast
if (!pForwarder->SetDepth( nPara, nLevel ))
@@ -2044,7 +2029,7 @@ void SvxPropertyValuesToItemSet(
if( pForwarder )
{
sal_Int16 nStartValue = -1;
- if( !(pProps[i].Value >>= nStartValue) )
+ if( !(rProp.Value >>= nStartValue) )
throw lang::IllegalArgumentException();
pForwarder->SetNumberingStartValue( nPara, nStartValue );
@@ -2055,14 +2040,14 @@ void SvxPropertyValuesToItemSet(
if( pForwarder )
{
bool bParaIsNumberingRestart = false;
- if( !(pProps[i].Value >>= bParaIsNumberingRestart) )
+ if( !(rProp.Value >>= bParaIsNumberingRestart) )
throw lang::IllegalArgumentException();
pForwarder->SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
}
}
else
- pPropSet->setPropertyValue( pProps[i].Name, pProps[i].Value, rItemSet );
+ pPropSet->setPropertyValue( rProp.Name, rProp.Value, rItemSet );
}
}
@@ -2144,9 +2129,8 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendTextPortion(
SvxUnoTextRange* pRange = new SvxUnoTextRange( *this );
xRet = pRange;
pRange->SetSelection( aSel );
- const beans::PropertyValue* pProps = rCharAndParaProps.getConstArray();
- for( sal_Int32 nProp = 0; nProp < rCharAndParaProps.getLength(); ++nProp )
- pRange->setPropertyValue( pProps[nProp].Name, pProps[nProp].Value );
+ for( const beans::PropertyValue& rProp : rCharAndParaProps )
+ pRange->setPropertyValue( rProp.Name, rProp.Value );
}
return xRet;
}
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index a49f854013f2..c189ffc3c300 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -329,12 +329,8 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa
DBG_ASSERT(xFields.is(), "MappingDialog_Impl::MappingDialog_Impl : gave me an invalid form !");
if(xFields.is())
{
- Sequence< OUString > aNames = xFields->getElementNames();
- sal_Int32 nFieldsCount = aNames.getLength();
- const OUString* pNames = aNames.getConstArray();
-
- for(sal_Int32 nField = 0; nField < nFieldsCount; nField++)
- aListBoxes[0]->InsertEntry(pNames[nField]);
+ for(const OUString& rName : xFields->getElementNames())
+ aListBoxes[0]->InsertEntry(rName);
}
Link<ListBox&,void> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl);
@@ -486,10 +482,8 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(vcl::Window* pParent, BibDataManager* p
try
{
OUString sActiveSource = pDatMan->getActiveDataSource();
- const Sequence< OUString >& rSources = aConfig.GetDataSourceNames();
- const OUString* pSourceNames = rSources.getConstArray();
- for (sal_Int32 i = 0; i < rSources.getLength(); ++i)
- m_pSelectionLB->InsertEntry(pSourceNames[i]);
+ for (const OUString& rSourceName : aConfig.GetDataSourceNames())
+ m_pSelectionLB->InsertEntry(rSourceName);
m_pSelectionLB->SelectEntry(sActiveSource);
}
@@ -566,10 +560,9 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
{
Sequence< Reference< XDispatch> > aReturn( aDescripts.getLength() );
Reference< XDispatch >* pReturn = aReturn.getArray();
- const DispatchDescriptor* pDescripts = aDescripts.getConstArray();
- for ( sal_Int32 i=0; i<aDescripts.getLength(); ++i, ++pReturn, ++pDescripts )
+ for ( const DispatchDescriptor& rDescript : aDescripts )
{
- *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
+ *pReturn++ = queryDispatch( rDescript.FeatureURL, rDescript.FrameName, rDescript.SearchFlags );
}
return aReturn;
}
@@ -650,11 +643,8 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
// remove the old fields
if ( xColContainer->hasElements() )
{
- Sequence< OUString > aNames = xColContainer->getElementNames();
- const OUString* pNames = aNames.getConstArray();
- const OUString* pNamesEnd = pNames + aNames.getLength();
- for ( ; pNames != pNamesEnd; ++pNames )
- xColContainer->removeByName( *pNames );
+ for ( OUString& rName : xColContainer->getElementNames() )
+ xColContainer->removeByName( rName );
}
Reference< XNameAccess > xFields = getColumns( m_xForm );
@@ -665,13 +655,9 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
Reference< XPropertySet > xField;
- Sequence< OUString > aFields( xFields->getElementNames() );
- const OUString* pFields = aFields.getConstArray();
- const OUString* pFieldsEnd = pFields + aFields.getLength();
-
- for ( ; pFields != pFieldsEnd; ++pFields )
+ for ( const OUString& rField : xFields->getElementNames() )
{
- xFields->getByName( *pFields ) >>= xField;
+ xFields->getByName( rField ) >>= xField;
OUString sCurrentModelType;
const OUString sType("Type");
@@ -713,11 +699,11 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
Any aFormatted(bFormattedIsNumeric);
xCurrentCol->setPropertyValue("TreatAsNumber", aFormatted);
}
- Any aColName = makeAny( *pFields );
+ Any aColName = makeAny( rField );
xCurrentCol->setPropertyValue(FM_PROP_CONTROLSOURCE, aColName);
xCurrentCol->setPropertyValue(FM_PROP_LABEL, aColName);
- xColContainer->insertByName( *pFields, makeAny( xCurrentCol ) );
+ xColContainer->insertByName( rField, makeAny( xCurrentCol ) );
}
}
catch (const Exception&)
@@ -796,12 +782,11 @@ Reference< XForm > BibDataManager::createDatabaseForm(BibDBDescriptor& rDesc)
if(aTableNameSeq.getLength() > 0)
{
- const OUString* pTableNames = aTableNameSeq.getConstArray();
if(!rDesc.sTableOrQuery.isEmpty())
aActiveDataTable = rDesc.sTableOrQuery;
else
{
- rDesc.sTableOrQuery = aActiveDataTable = pTableNames[0];
+ rDesc.sTableOrQuery = aActiveDataTable = aTableNameSeq[0];
rDesc.nCommandType = CommandType::TABLE;
}
@@ -918,11 +903,10 @@ OUString BibDataManager::getQueryField()
OUString aFieldString = pConfig->getQueryField();
if(aFieldString.isEmpty())
{
- Sequence< OUString > aSeq = getQueryFields();
- const OUString* pFields = aSeq.getConstArray();
+ const Sequence< OUString > aSeq = getQueryFields();
if(aSeq.getLength()>0)
{
- aFieldString=pFields[0];
+ aFieldString=aSeq[0];
}
}
return aFieldString;
@@ -986,8 +970,7 @@ void BibDataManager::setActiveDataSource(const OUString& rURL)
}
if(aTableNameSeq.getLength() > 0)
{
- const OUString* pTableNames = aTableNameSeq.getConstArray();
- aActiveDataTable = pTableNames[0];
+ aActiveDataTable = aTableNameSeq[0];
aVal <<= aActiveDataTable;
aPropertySet->setPropertyValue("Command", aVal);
aPropertySet->setPropertyValue("CommandType", makeAny(CommandType::TABLE));
@@ -1431,17 +1414,12 @@ void BibDataManager::SetMeAsUidListener()
if (!xFields.is())
return;
- Sequence< OUString > aFields(xFields->getElementNames());
- const OUString* pFields = aFields.getConstArray();
- sal_Int32 nCount=aFields.getLength();
OUString theFieldName;
- for( sal_Int32 i=0; i<nCount; i++ )
+ for( const OUString& rName : xFields->getElementNames() )
{
- const OUString& rName = pFields[i];
-
if (rName.equalsIgnoreAsciiCase(STR_UID))
{
- theFieldName=pFields[i];
+ theFieldName=rName;
break;
}
}
@@ -1472,18 +1450,12 @@ void BibDataManager::RemoveMeAsUidListener()
if (!xFields.is())
return;
-
- Sequence< OUString > aFields(xFields->getElementNames());
- const OUString* pFields = aFields.getConstArray();
- sal_Int32 nCount=aFields.getLength();
OUString theFieldName;
- for( sal_Int32 i=0; i<nCount; i++ )
+ for(const OUString& rName : xFields->getElementNames() )
{
- const OUString& rName = pFields[i];
-
if (rName.equalsIgnoreAsciiCase(STR_UID))
{
- theFieldName=pFields[i];
+ theFieldName=rName;
break;
}
}
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 90df51b7c7ac..0cb98a68d822 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -712,22 +712,17 @@ namespace pcr
continue;
// loop through all methods
- Sequence< OUString > aMethods( comphelper::getEventMethodsForType( rListener ) );
-
- const OUString* pMethods = aMethods.getConstArray();
- sal_uInt32 methodCount = aMethods.getLength();
-
- for (sal_uInt32 method = 0 ; method < methodCount ; ++method, ++pMethods )
+ for (const OUString& rMethod : comphelper::getEventMethodsForType( rListener ))
{
EventDescription aEvent;
- if ( !lcl_getEventDescriptionForMethod( *pMethods, aEvent ) )
+ if ( !lcl_getEventDescriptionForMethod( rMethod, aEvent ) )
continue;
if ( !impl_filterMethod_nothrow( aEvent ) )
continue;
m_aEvents.emplace(
- lcl_getEventPropertyName( sListenerClassName, *pMethods ), aEvent );
+ lcl_getEventPropertyName( sListenerClassName, rMethod ), aEvent );
}
}
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 0f7ebacb8689..89c44b73054b 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -272,21 +272,17 @@ namespace pcr
Sequence< OUString > aStrings;
aPropertyValue >>= aStrings;
- const OUString* pStrings = aStrings.getConstArray();
- sal_Int32 nCount = aStrings.getLength();
-
std::vector< OUString > aResolvedStrings;
- aResolvedStrings.resize( nCount );
+ aResolvedStrings.reserve( aStrings.getLength() );
try
{
- for ( sal_Int32 i = 0; i < nCount; ++i )
+ for ( const OUString& rIdStr : aStrings )
{
- OUString aIdStr = pStrings[i];
- OUString aPureIdStr = aIdStr.copy( 1 );
+ OUString aPureIdStr = rIdStr.copy( 1 );
if( xStringResourceResolver->hasEntryForId( aPureIdStr ) )
- aResolvedStrings[i] = xStringResourceResolver->resolveString( aPureIdStr );
+ aResolvedStrings.push_back(xStringResourceResolver->resolveString( aPureIdStr ));
else
- aResolvedStrings[i] = aIdStr;
+ aResolvedStrings.push_back(rIdStr);
}
}
catch( const resource::MissingResourceException & )
@@ -333,10 +329,8 @@ namespace pcr
// special handling, the value is a faked value we generated ourself in impl_executeFontDialog_nothrow
Sequence< NamedValue > aFontPropertyValues;
OSL_VERIFY( _rValue >>= aFontPropertyValues );
- const NamedValue* fontPropertyValue = aFontPropertyValues.getConstArray();
- const NamedValue* fontPropertyValueEnd = fontPropertyValue + aFontPropertyValues.getLength();
- for ( ; fontPropertyValue != fontPropertyValueEnd; ++fontPropertyValue )
- m_xComponent->setPropertyValue( fontPropertyValue->Name, fontPropertyValue->Value );
+ for ( const NamedValue& fontPropertyValue : aFontPropertyValues )
+ m_xComponent->setPropertyValue( fontPropertyValue.Name, fontPropertyValue.Value );
}
else
{
@@ -374,8 +368,7 @@ namespace pcr
Sequence< OUString > aNewStrings;
_rValue >>= aNewStrings;
- const OUString* pNewStrings = aNewStrings.getConstArray();
- sal_Int32 nNewCount = aNewStrings.getLength();
+ const sal_Int32 nNewCount = aNewStrings.getLength();
// Create new Ids
std::unique_ptr<OUString[]> pNewPureIds(new OUString[nNewCount]);
@@ -399,8 +392,6 @@ namespace pcr
// Move strings to new Ids for all locales
Sequence< Locale > aLocaleSeq = xStringResourceManager->getLocales();
- const Locale* pLocale = aLocaleSeq.getConstArray();
- sal_Int32 nLocaleCount = aLocaleSeq.getLength();
Sequence< OUString > aOldIdStrings;
aPropertyValue >>= aOldIdStrings;
try
@@ -418,20 +409,18 @@ namespace pcr
}
OUString aNewPureIdStr = pNewPureIds[i];
- for ( sal_Int32 iLocale = 0; iLocale < nLocaleCount; ++iLocale )
+ for ( const Locale& rLocale : aLocaleSeq )
{
- Locale aLocale = pLocale[iLocale];
-
OUString aResourceStr;
if( !aOldPureIdStr.isEmpty() )
{
- if( xStringResourceManager->hasEntryForIdAndLocale( aOldPureIdStr, aLocale ) )
+ if( xStringResourceManager->hasEntryForIdAndLocale( aOldPureIdStr, rLocale ) )
{
aResourceStr = xStringResourceManager->
- resolveStringForLocale( aOldPureIdStr, aLocale );
+ resolveStringForLocale( aOldPureIdStr, rLocale );
}
}
- xStringResourceManager->setStringForLocale( aNewPureIdStr, aResourceStr, aLocale );
+ xStringResourceManager->setStringForLocale( aNewPureIdStr, aResourceStr, rLocale );
}
}
}
@@ -446,8 +435,8 @@ namespace pcr
OUString* pNewIdStrings = aNewIdStrings.getArray();
for ( i = 0; i < nNewCount; ++i )
{
- OUString aPureIdStr = pNewPureIds[i];
- OUString aStr = pNewStrings[i];
+ const OUString& aPureIdStr = pNewPureIds[i];
+ const OUString& aStr = aNewStrings[i];
xStringResourceManager->setString( aPureIdStr, aStr );
pNewIdStrings[i] = "&" + aPureIdStr;
@@ -455,18 +444,14 @@ namespace pcr
aValue <<= aNewIdStrings;
// Remove old ids from resource for all locales
- const OUString* pOldIdStrings = aOldIdStrings.getConstArray();
- sal_Int32 nOldIdCount = aOldIdStrings.getLength();
- for( i = 0 ; i < nOldIdCount ; ++i )
+ for( const OUString& rIdStr : aOldIdStrings )
{
- OUString aIdStr = pOldIdStrings[i];
- OUString aPureIdStr = aIdStr.copy( 1 );
- for ( sal_Int32 iLocale = 0; iLocale < nLocaleCount; ++iLocale )
+ OUString aPureIdStr = rIdStr.copy( 1 );
+ for ( const Locale& rLocale : aLocaleSeq )
{
- Locale aLocale = pLocale[iLocale];
try
{
- xStringResourceManager->removeIdForLocale( aPureIdStr, aLocale );
+ xStringResourceManager->removeIdForLocale( aPureIdStr, rLocale );
}
catch( const resource::MissingResourceException & )
{}
@@ -2316,11 +2301,8 @@ namespace pcr
sal_Int32 nObjectType = CommandType::COMMAND;
OSL_VERIFY( xFormSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nObjectType );
- Sequence< OUString > aFields( ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName ) );
-
- const OUString* pFields = aFields.getConstArray();
- for ( sal_Int32 i = 0; i < aFields.getLength(); ++i, ++pFields )
- _rFieldNames.push_back( *pFields );
+ for ( const OUString& rField : ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName ) )
+ _rFieldNames.push_back( rField );
}
}
catch (const Exception&)
@@ -2454,12 +2436,8 @@ namespace pcr
if ( !xTableNames.is() )
return;
- Sequence< OUString> aTableNames = xTableNames->getElementNames();
- sal_uInt32 nCount = aTableNames.getLength();
- const OUString* pTableNames = aTableNames.getConstArray();
-
- for ( sal_uInt32 i=0; i<nCount; ++i ,++pTableNames )
- _out_rNames.push_back( *pTableNames );
+ for ( const OUString& rTableName : xTableNames->getElementNames() )
+ _out_rNames.push_back( rTableName );
}
@@ -2483,12 +2461,9 @@ namespace pcr
if ( !_xQueryNames.is() )
return;
- Sequence< OUString> aQueryNames = _xQueryNames->getElementNames();
- sal_uInt32 nCount = aQueryNames.getLength();
- const OUString* pQueryNames = aQueryNames.getConstArray();
bool bAdd = !_sName.isEmpty();
- for ( sal_uInt32 i=0; i<nCount; i++, ++pQueryNames )
+ for ( const OUString& rQueryName : _xQueryNames->getElementNames() )
{
OUStringBuffer sTemp;
if ( bAdd )
@@ -2496,8 +2471,8 @@ namespace pcr
sTemp.append(_sName);
sTemp.append("/");
}
- sTemp.append(*pQueryNames);
- Reference< XNameAccess > xSubQueries(_xQueryNames->getByName(*pQueryNames),UNO_QUERY);
+ sTemp.append(rQueryName);
+ Reference< XNameAccess > xSubQueries(_xQueryNames->getByName(rQueryName),UNO_QUERY);
if ( xSubQueries.is() )
impl_fillQueryNames_throw(xSubQueries,_out_rNames,sTemp.makeStringAndClear());
else
@@ -2696,8 +2671,8 @@ namespace pcr
{
const sal_uInt32* pDeletedKeys = pInfoItem->GetDelArray();
- for (sal_uInt32 i=0; i< pInfoItem->GetDelCount(); ++i, ++pDeletedKeys)
- pFormatter->DeleteEntry(*pDeletedKeys);
+ for (sal_uInt32 i=0; i< pInfoItem->GetDelCount(); ++i)
+ pFormatter->DeleteEntry(pDeletedKeys[i]);
}
pItem = nullptr;
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 157e6aaaf0fb..719ca2cc1431 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -177,15 +177,12 @@ namespace pcr
try
{
- Sequence< Reference< XControlModel > > aControlModels( m_xTempModel->getControlModels() );
- const Reference< XControlModel >* pControlModels = aControlModels.getConstArray();
-
OUString aName;
Image aImage;
- for ( sal_Int32 i=0; i < aControlModels.getLength(); ++i, ++pControlModels )
+ for ( auto const& rControlModel : m_xTempModel->getControlModels() )
{
- Reference< XPropertySet > xControl( *pControlModels, UNO_QUERY );
+ Reference< XPropertySet > xControl( rControlModel, UNO_QUERY );
Reference< XPropertySetInfo > xPI;
if ( xControl.is() )
xPI = xControl->getPropertySetInfo();
@@ -261,18 +258,17 @@ namespace pcr
Sequence< Reference< XControlModel > > aSortedControlModelSeq( nEntryCount );
Sequence< Reference< XControlModel > > aControlModels( m_xTempModel->getControlModels());
Reference< XControlModel > * pSortedControlModels = aSortedControlModelSeq.getArray();
- const Reference< XControlModel > * pControlModels = aControlModels.getConstArray();
for (sal_uLong i=0; i < nEntryCount; i++)
{
SvTreeListEntry* pEntry = m_pLB_Controls->GetEntry(i);
- for( sal_Int32 j=0; j<aControlModels.getLength(); j++ )
+ for( auto const& rControlModel : aControlModels )
{
- Reference< XPropertySet > xSet(pControlModels[j], UNO_QUERY);
+ Reference< XPropertySet > xSet(rControlModel, UNO_QUERY);
if (xSet.get() == static_cast<XPropertySet*>(pEntry->GetUserData()))
{
- pSortedControlModels[i] = pControlModels[j];
+ pSortedControlModels[i] = rControlModel;
break;
}
}
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index 807d01138b04..0e55cd318141 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -307,11 +307,10 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute( )
void SAL_CALL XMLFilterDialogComponent::initialize( const Sequence< Any >& aArguments )
{
- const Any* pArguments = aArguments.getConstArray();
- for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
+ for(const Any& rArgument : aArguments)
{
PropertyValue aProperty;
- if(*pArguments >>= aProperty)
+ if(rArgument >>= aProperty)
{
if( aProperty.Name == "ParentWindow" )
{
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index 03935a726b8c..5e26875c2f09 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -326,35 +326,36 @@ void XMLFilterTestDialog::onExportBrowse()
continue;
OUString aInterfaceName;
- PropertyValue* pValues = aValues.getArray();
OUString aType, aService;
sal_Int32 nFlags( 0 );
int nFound = 0;
- for( sal_Int32 nValue = 0; (nValue < aValues.getLength()) && (nFound != 15); nValue++, pValues++ )
+ for( const PropertyValue& rValue : aValues )
{
- if ( pValues->Name == "Type" )
+ if ( rValue.Name == "Type" )
{
- pValues->Value >>= aType;
+ rValue.Value >>= aType;
nFound |= 1;
}
- else if ( pValues->Name == "DocumentService" )
+ else if ( rValue.Name == "DocumentService" )
{
- pValues->Value >>= aService;
+ rValue.Value >>= aService;
nFound |= 2;
}
- else if ( pValues->Name == "Flags" )
+ else if ( rValue.Name == "Flags" )
{
- pValues->Value >>= nFlags;
+ rValue.Value >>= nFlags;
nFound |= 4;
}
- if ( pValues->Name == "UIName" )
+ else if ( rValue.Name == "UIName" )
{
- pValues->Value >>= aInterfaceName;
+ rValue.Value >>= aInterfaceName;
nFound |= 8;
}
+ if (nFound == 15)
+ break;
}
if( (nFound == 15) && (!aType.isEmpty() && aService == m_pFilterInfo->maDocumentService) )
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 5df2b3572de8..615970106d19 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -417,10 +417,8 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>&
m_aListSource.clear();
css::uno::Sequence<OUString> aListSource;
_rxInStream >> aListSource;
- const OUString* pToken = aListSource.getConstArray();
- sal_Int32 nLen = aListSource.getLength();
- for (sal_Int32 i = 0; i < nLen; ++i, ++pToken)
- m_aListSource += *pToken;
+ for (const OUString& rToken : aListSource)
+ m_aListSource += rToken;
}
sal_Int16 nListSourceType;
@@ -647,12 +645,8 @@ void OComboBoxModel::loadData( bool _bForce )
Reference<XNameAccess> xFieldNames = getTableFields(xConnection, m_aListSource);
if (xFieldNames.is())
{
- css::uno::Sequence<OUString> seqNames = xFieldNames->getElementNames();
- sal_Int32 nFieldsCount = seqNames.getLength();
- const OUString* pustrNames = seqNames.getConstArray();
-
- for (sal_Int32 k=0; k<nFieldsCount; ++k)
- aStringList.push_back(pustrNames[k]);
+ for (const OUString& rustrNames : xFieldNames->getElementNames())
+ aStringList.push_back(rustrNames);
}
}
break;
@@ -770,20 +764,19 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset )
css::uno::Sequence<OUString> aStringItemList;
if ( getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= aStringItemList )
{
- const OUString* pStringItems = aStringItemList.getConstArray();
- sal_Int32 i;
- for (i=0; i<aStringItemList.getLength(); ++i, ++pStringItems)
+ bool bFound = false;
+ for (const OUString& rStringItem : aStringItemList)
{
- if ( *pStringItems == sNewValue )
+ if ( (bFound = rStringItem == sNewValue) )
break;
}
// not found -> add
- if (i >= aStringItemList.getLength())
+ if (!bFound)
{
sal_Int32 nOldLen = aStringItemList.getLength();
aStringItemList.realloc( nOldLen + 1 );
- aStringItemList.getArray()[ nOldLen ] = sNewValue;
+ aStringItemList[ nOldLen ] = sNewValue;
setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( aStringItemList ) );
setFastPropertyValue( PROPERTY_ID_TYPEDITEMLIST, makeAny( css::uno::Sequence<css::uno::Any>() ) );
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 2c154ac795b8..7a026b688e92 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -645,16 +645,12 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
Reference<XControlContainer> xControlContainer(rxSubmitButton->getContext(), UNO_QUERY);
if( !xControlContainer.is() ) break;
- Sequence<Reference<XControl> > aControlSeq = xControlContainer->getControls();
- Reference<XControl> xControl;
-
// Find the right control
- sal_Int32 i;
- for( i=0; i<aControlSeq.getLength(); i++ )
+ bool bFound = false;
+ for( auto const& xControl : xControlContainer->getControls() )
{
- xControl = aControlSeq.getConstArray()[i];
Reference<XPropertySet> xModel(xControl->getModel(), UNO_QUERY);
- if (xModel == xComponentSet)
+ if ((bFound = xModel == xComponentSet))
{
Reference<XTextComponent> xTextComponent(xControl, UNO_QUERY);
if( xTextComponent.is() )
@@ -663,7 +659,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
}
}
// Couldn't find control or it does not exist (edit in the grid)
- if (i == aControlSeq.getLength())
+ if (!bFound)
xComponentSet->getPropertyValue( PROPERTY_TEXT ) >>= sText;
}
else
@@ -2410,17 +2406,15 @@ void SAL_CALL ODatabaseForm::setControlModels(const Sequence<Reference<XControlM
::osl::ResettableMutexGuard aGuard(m_aMutex);
// Set TabIndex in the order of the sequence
- const Reference<XControlModel>* pControls = rControls.getConstArray();
sal_Int32 nCount = getCount();
- sal_Int32 nNewCount = rControls.getLength();
// HiddenControls and forms are not listed
- if (nNewCount <= nCount)
+ if (rControls.getLength() <= nCount)
{
sal_Int16 nTabIndex = 1;
- for (sal_Int32 i=0; i < nNewCount; ++i, ++pControls)
+ for (auto const& rControl : rControls)
{
- Reference<XFormComponent> xComp(*pControls, UNO_QUERY);
+ Reference<XFormComponent> xComp(rControl, UNO_QUERY);
if (xComp.is())
{
// Find component in the list
@@ -2455,13 +2449,12 @@ void SAL_CALL ODatabaseForm::setGroup( const Sequence<Reference<XControlModel> >
// The controls are grouped by adjusting their names to the name of the
// first control of the sequence
- const Reference<XControlModel>* pControls = _rGroup.getConstArray();
Reference< XPropertySet > xSet;
OUString sGroupName( Name );
- for( sal_Int32 i=0; i<_rGroup.getLength(); ++i, ++pControls )
+ for( auto const& rControl : _rGroup )
{
- xSet.set(*pControls, css::uno::UNO_QUERY);
+ xSet.set(rControl, css::uno::UNO_QUERY);
if ( !xSet.is() )
{
// can't throw an exception other than a RuntimeException (which would not be appropriate),
diff --git a/forms/source/component/GroupManager.cxx b/forms/source/component/GroupManager.cxx
index 94620bbb1313..d801ac6d425e 100644
--- a/forms/source/component/GroupManager.cxx
+++ b/forms/source/component/GroupManager.cxx
@@ -172,14 +172,12 @@ void OGroup::RemoveComponent( const Reference<XPropertySet>& rxElement )
Sequence< Reference<XControlModel> > OGroup::GetControlModels() const
{
- sal_Int32 nLen = m_aCompArray.size();
- Sequence<Reference<XControlModel> > aControlModelSeq( nLen );
+ Sequence<Reference<XControlModel> > aControlModelSeq( m_aCompArray.size() );
Reference<XControlModel>* pModels = aControlModelSeq.getArray();
- OGroupCompArr::const_iterator aGroupComps = m_aCompArray.begin();
- for (sal_Int32 i = 0; i < nLen; ++i, ++pModels, ++aGroupComps)
+ for (auto const& rGroupComp : m_aCompArray)
{
- *pModels = aGroupComps->GetControlModel();
+ *pModels++ = rGroupComp.GetControlModel();
}
return aControlModelSeq;
}
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 6c4885260afb..3d5ffd73083b 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -81,11 +81,9 @@ namespace
bool
lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
{
- const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
- const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
- for ( ; pDesc != pEnd; ++pDesc )
+ for ( auto const& rDesc : sEvents )
{
- if ( pDesc->ScriptType == "VBAInterop" )
+ if ( rDesc.ScriptType == "VBAInterop" )
return true;
}
return false;
@@ -95,19 +93,17 @@ Sequence< ScriptEventDescriptor >
lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
{
Sequence< ScriptEventDescriptor > sStripped( sEvents.getLength() );
+ ScriptEventDescriptor* pStripped = sStripped.getArray();
- const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
- const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
sal_Int32 nCopied = 0;
- for ( ; pDesc != pEnd; ++pDesc )
+ for ( auto const& rDesc : sEvents )
{
- if ( pDesc->ScriptType != "VBAInterop" )
+ if ( rDesc.ScriptType != "VBAInterop" )
{
- sStripped[ nCopied++ ] = *pDesc;
+ pStripped[ nCopied++ ] = rDesc;
}
}
- if ( nCopied )
- sStripped.realloc( nCopied );
+ sStripped.realloc( nCopied );
return sStripped;
}