diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 16:12:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 12:50:55 +0200 |
commit | 20571c472528c4f98fe3f55700d134915d32a49a (patch) | |
tree | 9b350824d845b8aaeb13d087ef74febb454b821b /reportdesign/source | |
parent | b401896a56149aa2871b65a330a6f601a9830ccd (diff) |
use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759
Reviewed-on: https://gerrit.libreoffice.org/39763
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source')
4 files changed, 11 insertions, 19 deletions
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index a31fd64ee208..921962a3114b 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -272,13 +272,11 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const break; } } - beans::PropertyValue* pArgIter = m_aArguments.getArray(); - beans::PropertyValue* pArgEnd = pArgIter + m_aArguments.getLength(); - for(;pArgIter != pArgEnd;++pArgIter) + for(beans::PropertyValue & propVal : m_aArguments) { - if ( pArgIter->Name == "HasCategories" ) + if ( propVal.Name == "HasCategories" ) { - pArgIter->Value <<= bHasCategories; + propVal.Value <<= bHasCategories; break; } } diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx index d1b41f36fd70..7b3e73b8cf2b 100644 --- a/reportdesign/source/ui/inspection/metadata.cxx +++ b/reportdesign/source/ui/inspection/metadata.cxx @@ -287,15 +287,13 @@ namespace rptui ,PROPERTY_VERTICALALIGN }; - beans::Property* pPropsIter = aProps.getArray(); - beans::Property* pPropsEnd = pPropsIter + aProps.getLength(); - for (; pPropsIter != pPropsEnd; ++pPropsIter) + for (beans::Property const & prop : aProps) { size_t nPos = 0; - for (; nPos < SAL_N_ELEMENTS(pExcludeProperties) && pExcludeProperties[nPos] != pPropsIter->Name; ++nPos ) + for (; nPos < SAL_N_ELEMENTS(pExcludeProperties) && pExcludeProperties[nPos] != prop.Name; ++nPos ) ; if ( nPos == SAL_N_ELEMENTS(pExcludeProperties) ) - _rExcludeProperties.push_back(*pPropsIter); + _rExcludeProperties.push_back(prop); } } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 846601146e0f..544dfb203638 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -778,12 +778,10 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) else aValues = svx::OMultiColumnTransferable::extractDescriptor(aDropped); - beans::PropertyValue* pIter = aValues.getArray(); - beans::PropertyValue* pEnd = pIter + aValues.getLength(); - for(;pIter != pEnd; ++pIter) + for(beans::PropertyValue & propVal : aValues) { uno::Sequence<beans::PropertyValue> aCurrent; - pIter->Value >>= aCurrent; + propVal.Value >>= aCurrent; sal_Int32 nLength = aCurrent.getLength(); if ( nLength ) { @@ -796,7 +794,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) aCurrent[nLength].Name = "Section"; aCurrent[nLength++].Value <<= getSection(); - pIter->Value <<= aCurrent; + propVal.Value <<= aCurrent; } } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index ecb71d622272..a8c1f9d021ee 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1265,8 +1265,6 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe if ( aAllreadyCopiedObjects.getLength() ) { - beans::NamedValue* pIter = aAllreadyCopiedObjects.getArray(); - const beans::NamedValue* pEnd = pIter + aAllreadyCopiedObjects.getLength(); try { uno::Reference<report::XReportDefinition> xReportDefinition = getView()->getReportView()->getController().getReportDefinition(); @@ -1280,10 +1278,10 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe aNewPos.Y() = 0; Point aPrevious; - for (; pIter != pEnd; ++pIter) + for (beans::NamedValue const & namedVal : aAllreadyCopiedObjects) { uno::Sequence< uno::Reference<report::XReportComponent> > aClones; - pIter->Value >>= aClones; + namedVal.Value >>= aClones; uno::Reference<report::XReportComponent>* pColIter = aClones.getArray(); const uno::Reference<report::XReportComponent>* pColEnd = pColIter + aClones.getLength(); |