diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-12-10 12:58:40 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-12-10 14:44:57 +0100 |
commit | f5c9593a7bab7af14feb88a74d757b2640e3149f (patch) | |
tree | 043cf0ca26b302fe7a6c1f87540a1458e9cfd4e2 /vcl/unx/generic/window | |
parent | 6c42e3961ed29d3b6aa505c46b7d65024055a08e (diff) |
Use some for range loops in vcl
Change-Id: I58a334e4d1252b2addd6784ab60d15b60593f722
Reviewed-on: https://gerrit.libreoffice.org/46184
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/unx/generic/window')
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 38 | ||||
-rw-r--r-- | vcl/unx/generic/window/salobj.cxx | 4 |
2 files changed, 18 insertions, 24 deletions
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index f88e9b6219a8..8d489cbe46c9 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -1348,11 +1348,10 @@ void X11SalFrame::Show( bool bVisible, bool bNoActivate ) && ! IsFloatGrabWindow() ) { - for( std::list< X11SalFrame* >::const_iterator it = maChildren.begin(); - it != maChildren.end(); ++it ) + for (auto const& child : maChildren) { - if( (*it)->mbTransientForRoot ) - GetDisplay()->getWMAdaptor()->changeReferenceFrame( *it, this ); + if( child->mbTransientForRoot ) + GetDisplay()->getWMAdaptor()->changeReferenceFrame( child, this ); } } /* @@ -2140,9 +2139,8 @@ void X11SalFrame::SetApplicationID( const OUString &rWMClass ) { m_sWMClass = rWMClass; updateWMClass(); - std::list< X11SalFrame* >::const_iterator it; - for( it = maChildren.begin(); it != maChildren.end(); ++it ) - (*it)->SetApplicationID(rWMClass); + for (auto const& child : maChildren) + child->SetApplicationID(rWMClass); } } @@ -2515,8 +2513,8 @@ void X11SalFrame::createNewWindow( ::Window aNewParent, SalX11Screen nXScreen ) Show( true ); std::list< X11SalFrame* > aChildren = maChildren; - for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) - (*it)->createNewWindow( None, m_nXScreen ); + for (auto const& child : aChildren) + child->createNewWindow( None, m_nXScreen ); // FIXME: SalObjects } @@ -3448,32 +3446,29 @@ void X11SalFrame::RestackChildren( ::Window* pTopLevelWindows, int nTopLevelWind if( nWindow < 0 ) return; - std::list< X11SalFrame* >::const_iterator it; - for( it = maChildren.begin(); it != maChildren.end(); ++it ) + for (auto const& child : maChildren) { - X11SalFrame* pData = *it; - if( pData->bMapped_ ) + if( child->bMapped_ ) { int nChild = nWindow; while( nChild-- ) { - if( pTopLevelWindows[nChild] == pData->GetStackingWindow() ) + if( pTopLevelWindows[nChild] == child->GetStackingWindow() ) { // if a child is behind its parent, place it above the // parent (for insane WMs like Dtwm and olwm) XWindowChanges aCfg; aCfg.sibling = GetStackingWindow(); aCfg.stack_mode = Above; - XConfigureWindow( GetXDisplay(), pData->GetStackingWindow(), CWSibling|CWStackMode, &aCfg ); + XConfigureWindow( GetXDisplay(), child->GetStackingWindow(), CWSibling|CWStackMode, &aCfg ); break; } } } } - for( it = maChildren.begin(); it != maChildren.end(); ++it ) + for (auto const& child : maChildren) { - X11SalFrame* pData = *it; - pData->RestackChildren( pTopLevelWindows, nTopLevelWindows ); + child->RestackChildren( pTopLevelWindows, nTopLevelWindows ); } } } @@ -3994,11 +3989,10 @@ bool X11SalFrame::Dispatch( XEvent *pEvent ) && ! IsFloatGrabWindow() ) { - for( std::list< X11SalFrame* >::const_iterator it = maChildren.begin(); - it != maChildren.end(); ++it ) + for (auto const& child : maChildren) { - if( (*it)->mbTransientForRoot ) - pDisplay_->getWMAdaptor()->changeReferenceFrame( *it, this ); + if( child->mbTransientForRoot ) + pDisplay_->getWMAdaptor()->changeReferenceFrame( child, this ); } } diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx index 9d0833094c1d..425bec45ec26 100644 --- a/vcl/unx/generic/window/salobj.cxx +++ b/vcl/unx/generic/window/salobj.cxx @@ -384,9 +384,9 @@ bool X11SalObject::Dispatch( XEvent* pEvent ) { std::list< SalObject* >& rObjects = vcl_sal::getSalDisplay(GetGenericUnixSalData())->getSalObjects(); - for( std::list< SalObject* >::iterator it = rObjects.begin(); it != rObjects.end(); ++it ) + for (auto const& elem : rObjects) { - X11SalObject* pObject = static_cast<X11SalObject*>(*it); + X11SalObject* pObject = static_cast<X11SalObject*>(elem); if( pEvent->xany.window == pObject->maPrimary || pEvent->xany.window == pObject->maSecondary ) { |