diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-11-22 20:39:13 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-11-23 07:05:46 +0100 |
commit | 4ccddab6ef74cb07c2998eaf420785eeceda5a8d (patch) | |
tree | 21564564f4622969cc83d61b0cf86f6df902bcf9 /vcl/headless | |
parent | 3c508bf9fc1b2704080a71d7374bf3720343beb5 (diff) |
Replace some lists by vectors in vcl/headless
+use for range loops when loops included "std::list"
Change-Id: Ic261571ef64b1a710233ff949c4feeb3cc4756cd
Reviewed-on: https://gerrit.libreoffice.org/45109
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpframe.cxx | 7 | ||||
-rw-r--r-- | vcl/headless/svpvd.cxx | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 12fbf88ba63b..711806226c49 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -156,7 +156,7 @@ SalGraphics* SvpSalFrame::AcquireGraphics() void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) { SvpSalGraphics* pSvpGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics); - m_aGraphics.remove( pSvpGraphics ); + m_aGraphics.erase(std::remove(m_aGraphics.begin(), m_aGraphics.end(), pSvpGraphics), m_aGraphics.end()); delete pSvpGraphics; } @@ -275,10 +275,9 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u aFrameSize.getY()); // update device in existing graphics - for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin(); - it != m_aGraphics.end(); ++it ) + for (auto const& graphic : m_aGraphics) { - (*it)->setSurface(m_pSurface, aFrameSize); + graphic->setSurface(m_pSurface, aFrameSize); } } if( m_bVisible ) diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index 660185da1d41..cf78ebc8eb7d 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -45,7 +45,7 @@ SalGraphics* SvpSalVirtualDevice::AcquireGraphics() void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics ) { - m_aGraphics.remove( dynamic_cast<SvpSalGraphics*>(pGraphics) ); + m_aGraphics.erase(std::remove(m_aGraphics.begin(), m_aGraphics.end(), dynamic_cast<SvpSalGraphics*>(pGraphics)), m_aGraphics.end()); delete pGraphics; } @@ -96,9 +96,8 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, #endif // update device in existing graphics - for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin(); - it != m_aGraphics.end(); ++it ) - (*it)->setSurface(m_pSurface, m_aFrameSize); + for (auto const& graphic : m_aGraphics) + graphic->setSurface(m_pSurface, m_aFrameSize); } return true; } |