diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-10-25 19:56:34 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-10-26 07:28:00 +0200 |
commit | f4df7d2df596bd88e434759a5c108d458a8324b7 (patch) | |
tree | a951f517669f826b7b2d9e5e98c8d8354dc09c3a /vcl/unx/generic | |
parent | 51e2dc5139e0c34672eb433421cbe89e7854e6dd (diff) |
Simplify and remove useless aRemovePrinters list (vcl)
Change-Id: I33120b62b114bbac62752888301e62268f45768c
Reviewed-on: https://gerrit.libreoffice.org/43852
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/printer/cupsmgr.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 621afce153a1..328e9246e9f5 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -349,21 +349,21 @@ void CUPSManager::initialize() // remove everything that is not a CUPS printer and not // a special purpose printer (PDF, Fax) - std::list< OUString > aRemovePrinters; - for( std::unordered_map< OUString, Printer >::iterator it = m_aPrinters.begin(); - it != m_aPrinters.end(); ++it ) + std::unordered_map< OUString, Printer >::iterator it = m_aPrinters.begin(); + while(it != m_aPrinters.end()) { if( m_aCUPSDestMap.find( it->first ) != m_aCUPSDestMap.end() ) + { + ++it; continue; + } if( !it->second.m_aInfo.m_aFeatures.isEmpty() ) + { + ++it; continue; - aRemovePrinters.push_back( it->first ); - } - while( aRemovePrinters.begin() != aRemovePrinters.end() ) - { - m_aPrinters.erase( aRemovePrinters.front() ); - aRemovePrinters.pop_front(); + } + it = m_aPrinters.erase(it); } cupsSetPasswordCB( setPasswordCallback ); |