diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-10 19:07:30 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-17 14:08:33 +0200 |
commit | edcdfe5477559ca6c62897f0cad47d4d6149d77a (patch) | |
tree | bf97f0a716e760a3de4d95604483d26d943bd69f /reportdesign/source/ui/report/ViewsWindow.cxx | |
parent | 5ad254ed246cf8d11b55e50ed0ccba5736d0cdbb (diff) |
Simplify Sequence iterations in postprocess..sax
Use range-based loops, STL and comphelper functions
Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351
Reviewed-on: https://gerrit.libreoffice.org/77245
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'reportdesign/source/ui/report/ViewsWindow.cxx')
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index f81db3a9a4bf..bbff52d5e05f 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -602,11 +602,9 @@ void OViewsWindow::setMarked(const uno::Reference< report::XSection>& _xSection, void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes, bool _bMark) { bool bFirst = true; - const uno::Reference< report::XReportComponent>* pIter = _aShapes.getConstArray(); - const uno::Reference< report::XReportComponent>* pEnd = pIter + _aShapes.getLength(); - for(;pIter != pEnd;++pIter) + for(const uno::Reference< report::XReportComponent>& rShape : _aShapes) { - const uno::Reference< report::XSection> xSection = (*pIter)->getSection(); + const uno::Reference< report::XSection> xSection = rShape->getSection(); if ( xSection.is() ) { if ( bFirst ) @@ -617,7 +615,7 @@ void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XRepor OSectionWindow* pSectionWindow = getSectionWindow(xSection); if ( pSectionWindow ) { - SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( *pIter ); + SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( rShape ); SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr; OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject for the shape!" ); if ( pObject ) @@ -1607,12 +1605,10 @@ void OViewsWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedP void OViewsWindow::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections) { - const beans::PropertyValue* pIter = _aCollpasedSections.getConstArray(); - const beans::PropertyValue* pEnd = pIter + _aCollpasedSections.getLength(); - for (; pIter != pEnd; ++pIter) + for (const beans::PropertyValue& rSection : _aCollpasedSections) { sal_uInt16 nPos = sal_uInt16(-1); - if ( (pIter->Value >>= nPos) && nPos < m_aSections.size() ) + if ( (rSection.Value >>= nPos) && nPos < m_aSections.size() ) { m_aSections[nPos]->setCollapsed(true); } |