basic/source/comp/exprtree.cxx | 4 basic/source/comp/token.cxx | 5 basic/source/uno/dlgcont.cxx | 6 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx | 5 chart2/source/tools/DataSourceHelper.cxx | 40 +-- chart2/source/tools/XMLRangeHelper.cxx | 6 chart2/source/view/charttypes/AreaChart.cxx | 100 +++------ chart2/source/view/charttypes/BarChart.cxx | 103 +++------- chart2/source/view/charttypes/BubbleChart.cxx | 37 --- chart2/source/view/charttypes/CandleStickChart.cxx | 51 ++--- chart2/source/view/charttypes/NetChart.cxx | 96 +++------ comphelper/source/property/propagg.cxx | 28 +- comphelper/source/property/property.cxx | 13 - connectivity/source/commontools/paramwrapper.cxx | 8 dbaccess/source/core/api/query.cxx | 17 - dbaccess/source/core/dataaccess/databasecontext.cxx | 16 - dbaccess/source/core/dataaccess/databasedocument.cxx | 6 dbaccess/source/ui/browser/exsrcbrw.cxx | 32 +-- dbaccess/source/ui/browser/formadapter.cxx | 24 -- dbaccess/source/ui/browser/sbagrid.cxx | 15 - dbaccess/source/ui/browser/unodatbr.cxx | 40 +-- dbaccess/source/ui/dlg/DbAdminImpl.cxx | 9 dbaccess/source/ui/dlg/dbfindex.cxx | 8 dbaccess/source/ui/dlg/tablespage.cxx | 7 dbaccess/source/ui/misc/UITools.cxx | 14 - dbaccess/source/ui/misc/stringlistitem.cxx | 7 dbaccess/source/ui/querydesign/QueryTableView.cxx | 11 - dbaccess/source/ui/relationdesign/RelationController.cxx | 15 - dbaccess/source/ui/tabledesign/TableController.cxx | 36 +-- dbaccess/source/ui/uno/copytablewizard.cxx | 10 desktop/source/migration/migration.cxx | 53 ++--- desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 11 - editeng/source/accessibility/AccessibleEditableTextPara.cxx | 121 ++++-------- editeng/source/misc/acorrcfg.cxx | 3 editeng/source/uno/unotext.cxx | 68 ++---- extensions/source/bibliography/datman.cxx | 68 +----- extensions/source/propctrlr/eventhandler.cxx | 11 - extensions/source/propctrlr/formcomponenthandler.cxx | 79 ++----- extensions/source/propctrlr/taborder.cxx | 14 - filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 5 filter/source/xsltdialog/xmlfiltertestdialog.cxx | 21 +- forms/source/component/ComboBox.cxx | 25 -- forms/source/component/DatabaseForm.cxx | 25 -- forms/source/component/GroupManager.cxx | 8 forms/source/misc/InterfaceContainer.cxx | 18 - 45 files changed, 485 insertions(+), 814 deletions(-)
New commits: commit 4e144751f12a06e358e4f7efa7c8f13954e6cfd7 Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Sun Dec 17 23:00:24 2017 +0300 loplugin:unusedindex Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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, ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits