diff options
-rw-r--r-- | vcl/headless/svpframe.cxx | 6 | ||||
-rw-r--r-- | vcl/headless/svpvd.cxx | 2 | ||||
-rw-r--r-- | vcl/inc/impdel.hxx | 2 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 3 | ||||
-rw-r--r-- | vcl/qt5/QtClipboard.cxx | 3 | ||||
-rw-r--r-- | vcl/qt5/QtDragAndDrop.cxx | 3 | ||||
-rw-r--r-- | vcl/qt5/QtVirtualDevice.cxx | 4 | ||||
-rw-r--r-- | vcl/source/animate/Animation.cxx | 17 | ||||
-rw-r--r-- | vcl/source/app/session.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/vclevent.cxx | 2 | ||||
-rw-r--r-- | vcl/source/components/dtranscomp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 3 | ||||
-rw-r--r-- | vcl/source/edit/textdoc.cxx | 7 | ||||
-rw-r--r-- | vcl/source/helper/displayconnectiondispatch.cxx | 2 | ||||
-rw-r--r-- | vcl/source/helper/lazydelete.cxx | 2 | ||||
-rw-r--r-- | vcl/source/opengl/win/context.cxx | 4 | ||||
-rw-r--r-- | vcl/source/opengl/x11/context.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/errinf.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/event.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/X11_clipboard.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/X11_droptarget.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 4 |
24 files changed, 35 insertions, 54 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index c6993860a7dd..e0971f85b9ac 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -82,7 +82,7 @@ SvpSalFrame::~SvpSalFrame() for( auto& rChild : Children ) rChild->SetParent( m_pParent ); if( m_pParent ) - m_pParent->m_aChildren.erase(std::remove(m_pParent->m_aChildren.begin(), m_pParent->m_aChildren.end(), this), m_pParent->m_aChildren.end()); + std::erase(m_pParent->m_aChildren, this); if( s_pFocusFrame == this ) { @@ -168,7 +168,7 @@ SalGraphics* SvpSalFrame::AcquireGraphics() void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) { SvpSalGraphics* pSvpGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics); - m_aGraphics.erase(std::remove(m_aGraphics.begin(), m_aGraphics.end(), pSvpGraphics), m_aGraphics.end()); + std::erase(m_aGraphics, pSvpGraphics); delete pSvpGraphics; } @@ -475,7 +475,7 @@ void SvpSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ ) void SvpSalFrame::SetParent( SalFrame* pNewParent ) { if( m_pParent ) - m_pParent->m_aChildren.erase(std::remove(m_pParent->m_aChildren.begin(), m_pParent->m_aChildren.end(), this), m_pParent->m_aChildren.end()); + std::erase(m_pParent->m_aChildren, this); m_pParent = static_cast<SvpSalFrame*>(pNewParent); } diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index ffbc3dc37190..c65951e02964 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -60,7 +60,7 @@ SalGraphics* SvpSalVirtualDevice::AcquireGraphics() void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics ) { - m_aGraphics.erase(std::remove(m_aGraphics.begin(), m_aGraphics.end(), dynamic_cast<SvpSalGraphics*>(pGraphics)), m_aGraphics.end()); + std::erase(m_aGraphics, dynamic_cast<SvpSalGraphics*>(pGraphics)); delete pGraphics; } diff --git a/vcl/inc/impdel.hxx b/vcl/inc/impdel.hxx index 62925c24a427..b387c34a0974 100644 --- a/vcl/inc/impdel.hxx +++ b/vcl/inc/impdel.hxx @@ -44,7 +44,7 @@ class DeletionNotifier { m_aListeners.push_back( pListener ); } void removeDel( DeletionListener* pListener ) - { m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), pListener), m_aListeners.end()); } + { std::erase(m_aListeners, pListener); } }; class DeletionListener diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index def963b0510e..151928f873f6 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -436,8 +436,7 @@ void JSDropTarget::removeDropTargetListener( { std::unique_lock aGuard(m_aMutex); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), xListener), - m_aListeners.end()); + std::erase(m_aListeners, xListener); } sal_Bool JSDropTarget::isActive() { return false; } diff --git a/vcl/qt5/QtClipboard.cxx b/vcl/qt5/QtClipboard.cxx index 6e73b3711799..e9eb476fb253 100644 --- a/vcl/qt5/QtClipboard.cxx +++ b/vcl/qt5/QtClipboard.cxx @@ -216,8 +216,7 @@ void QtClipboard::removeClipboardListener( const css::uno::Reference<css::datatransfer::clipboard::XClipboardListener>& listener) { osl::MutexGuard aGuard(m_aMutex); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), - m_aListeners.end()); + std::erase(m_aListeners, listener); } bool QtClipboard::isSupported(const QClipboard::Mode aMode) diff --git a/vcl/qt5/QtDragAndDrop.cxx b/vcl/qt5/QtDragAndDrop.cxx index 0148715e237b..ffabc1bbbaaa 100644 --- a/vcl/qt5/QtDragAndDrop.cxx +++ b/vcl/qt5/QtDragAndDrop.cxx @@ -171,8 +171,7 @@ void QtDropTarget::removeDropTargetListener( { ::osl::Guard<::osl::Mutex> aGuard(m_aMutex); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), xListener), - m_aListeners.end()); + std::erase(m_aListeners, xListener); } sal_Bool QtDropTarget::isActive() { return m_bActive; } diff --git a/vcl/qt5/QtVirtualDevice.cxx b/vcl/qt5/QtVirtualDevice.cxx index 7e0dbab873d4..22844f1df6ab 100644 --- a/vcl/qt5/QtVirtualDevice.cxx +++ b/vcl/qt5/QtVirtualDevice.cxx @@ -39,9 +39,7 @@ SalGraphics* QtVirtualDevice::AcquireGraphics() void QtVirtualDevice::ReleaseGraphics(SalGraphics* pGraphics) { - m_aGraphics.erase( - std::remove(m_aGraphics.begin(), m_aGraphics.end(), dynamic_cast<QtGraphics*>(pGraphics)), - m_aGraphics.end()); + std::erase(m_aGraphics, dynamic_cast<QtGraphics*>(pGraphics)); delete pGraphics; } diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 9063b9846a24..daa9e1f1be4e 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -222,12 +222,9 @@ bool Animation::Start(OutputDevice& rOut, const Point& rDestPt, const Size& rDes void Animation::Stop(const OutputDevice* pOut, tools::Long nRendererId) { - maRenderers.erase( - std::remove_if(maRenderers.begin(), maRenderers.end(), - [=](const std::unique_ptr<AnimationRenderer>& pRenderer) -> bool { - return pRenderer->matches(pOut, nRendererId); - }), - maRenderers.end()); + std::erase_if(maRenderers, [=](const std::unique_ptr<AnimationRenderer>& pRenderer) -> bool { + return pRenderer->matches(pOut, nRendererId); + }); if (maRenderers.empty()) { @@ -351,9 +348,7 @@ void Animation::RenderNextFrameInAllRenderers() * area of output lies out of display area of window. * Mark state is set from view itself. */ - auto removeStart = std::remove_if(maRenderers.begin(), maRenderers.end(), - [](const auto& pRenderer) { return pRenderer->isMarked(); }); - maRenderers.erase(removeStart, maRenderers.cend()); + std::erase_if(maRenderers, [](const auto& pRenderer) { return pRenderer->isMarked(); }); // stop or restart timer if (maRenderers.empty()) @@ -365,9 +360,7 @@ void Animation::RenderNextFrameInAllRenderers() void Animation::PruneMarkedRenderers() { // delete all unmarked views - auto removeStart = std::remove_if(maRenderers.begin(), maRenderers.end(), - [](const auto& pRenderer) { return !pRenderer->isMarked(); }); - maRenderers.erase(removeStart, maRenderers.cend()); + std::erase_if(maRenderers, [](const auto& pRenderer) { return !pRenderer->isMarked(); }); // reset marked state std::for_each(maRenderers.cbegin(), maRenderers.cend(), diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index 3b1bf3565bb2..d61902fcf647 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -288,7 +288,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Referenc SAL_INFO("vcl.se.debug", " m_aListeners.size() = " << m_aListeners.size() ); - m_aListeners.erase(std::remove_if(m_aListeners.begin(), m_aListeners.end(), [&](Listener& listener) {return xListener == listener.m_xListener;}), m_aListeners.end()); + std::erase_if(m_aListeners, [&](Listener& listener) {return xListener == listener.m_xListener;}); } void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 44dfa0ad2a7b..d7624cb111a3 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -751,7 +751,7 @@ void Application::RemoveKeyListener( const Link<VclWindowEvent&,bool>& rKeyListe { ImplSVData* pSVData = ImplGetSVData(); auto & rVec = pSVData->maAppData.maKeyListeners; - rVec.erase( std::remove(rVec.begin(), rVec.end(), rKeyListener ), rVec.end() ); + std::erase(rVec, rKeyListener); } bool Application::HandleKey( VclEventId nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index b99c6987fe97..9e8bdb7d1ed1 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -67,7 +67,7 @@ void VclEventListeners::addListener( const Link<VclSimpleEvent&,void>& rListener void VclEventListeners::removeListener( const Link<VclSimpleEvent&,void>& rListener ) { - m_aListeners.erase( std::remove(m_aListeners.begin(), m_aListeners.end(), rListener ), m_aListeners.end() ); + std::erase(m_aListeners, rListener); m_updated = true; } diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index 1c16a2dd1391..92554d3fb75c 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -180,7 +180,7 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c { std::unique_lock aGuard(m_aMutex); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end()); + std::erase(m_aListeners, listener); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index a99e9733496c..ac06f445e008 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2419,8 +2419,7 @@ void RadioButton::dispose() { if (m_xGroup) { - m_xGroup->erase(std::remove(m_xGroup->begin(), m_xGroup->end(), VclPtr<RadioButton>(this)), - m_xGroup->end()); + std::erase(*m_xGroup, VclPtr<RadioButton>(this)); m_xGroup.reset(); } Button::dispose(); diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index cc1c2be10a78..a6d7bd8c240e 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -126,10 +126,9 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_Int3 void TextCharAttribList::DeleteEmptyAttribs() { - maAttribs.erase( - std::remove_if( maAttribs.begin(), maAttribs.end(), - [] (const std::unique_ptr<TextCharAttrib>& rAttrib) { return rAttrib->IsEmpty(); } ), - maAttribs.end() ); + std::erase_if( + maAttribs, + [] (const std::unique_ptr<TextCharAttrib>& rAttrib) { return rAttrib->IsEmpty(); } ); mbHasEmptyAttribs = false; } diff --git a/vcl/source/helper/displayconnectiondispatch.cxx b/vcl/source/helper/displayconnectiondispatch.cxx index 664446cd8812..b06067b9d79e 100644 --- a/vcl/source/helper/displayconnectiondispatch.cxx +++ b/vcl/source/helper/displayconnectiondispatch.cxx @@ -74,7 +74,7 @@ void SAL_CALL DisplayConnectionDispatch::removeEventHandler( const Any& /*window { std::scoped_lock aGuard( m_aMutex ); - m_aHandlers.erase( std::remove(m_aHandlers.begin(), m_aHandlers.end(), handler), m_aHandlers.end() ); + std::erase(m_aHandlers, handler); } void SAL_CALL DisplayConnectionDispatch::addErrorHandler( const css::uno::Reference< XEventHandler >& ) diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx index 6d39e9765c28..af1f9fcb3308 100644 --- a/vcl/source/helper/lazydelete.cxx +++ b/vcl/source/helper/lazydelete.cxx @@ -29,7 +29,7 @@ DeleteOnDeinitBase::~DeleteOnDeinitBase() if (!pSVData) return; auto& rList = pSVData->maDeinitDeleteList; - rList.erase(std::remove(rList.begin(), rList.end(), this), rList.end()); + std::erase(rList, this); } void DeleteOnDeinitBase::addDeinitContainer(DeleteOnDeinitBase* i_pContainer) diff --git a/vcl/source/opengl/win/context.cxx b/vcl/source/opengl/win/context.cxx index cadd213a1ce3..d9e7dc11b17f 100644 --- a/vcl/source/opengl/win/context.cxx +++ b/vcl/source/opengl/win/context.cxx @@ -164,9 +164,7 @@ void WinOpenGLContext::destroyCurrentContext() { if (m_aGLWin.hRC) { - std::vector<HGLRC>::iterator itr = std::remove(g_vShareList.begin(), g_vShareList.end(), m_aGLWin.hRC); - if (itr != g_vShareList.end()) - g_vShareList.erase(itr); + std::erase(g_vShareList, m_aGLWin.hRC); if (wglGetCurrentContext() != nullptr) { diff --git a/vcl/source/opengl/x11/context.cxx b/vcl/source/opengl/x11/context.cxx index 97822b3105a5..93125f91085a 100644 --- a/vcl/source/opengl/x11/context.cxx +++ b/vcl/source/opengl/x11/context.cxx @@ -414,9 +414,7 @@ void X11OpenGLContext::destroyCurrentContext() if(!m_aGLWin.ctx) return; - std::vector<GLXContext>::iterator itr = std::remove( g_vShareList.begin(), g_vShareList.end(), m_aGLWin.ctx ); - if (itr != g_vShareList.end()) - g_vShareList.erase(itr); + std::erase(g_vShareList, m_aGLWin.ctx); glXMakeCurrent(m_aGLWin.dpy, None, nullptr); g_bAnyCurrent = false; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index d17f2d1d0695..83a8e8babaf2 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1128,7 +1128,7 @@ void Dialog::RemoveFromDlgList() auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs; // remove dialog from the list of dialogs which are being executed - rExecuteDialogs.erase(std::remove_if(rExecuteDialogs.begin(), rExecuteDialogs.end(), [this](VclPtr<Dialog>& dialog){ return dialog.get() == this; }), rExecuteDialogs.end()); + std::erase_if(rExecuteDialogs, [this](VclPtr<Dialog>& dialog){ return dialog.get() == this; }); } void Dialog::EndDialog( tools::Long nResult ) diff --git a/vcl/source/window/errinf.cxx b/vcl/source/window/errinf.cxx index 2aedf08366ab..409f54eb1fdf 100644 --- a/vcl/source/window/errinf.cxx +++ b/vcl/source/window/errinf.cxx @@ -105,8 +105,7 @@ ErrorHandler::ErrorHandler() ErrorHandler::~ErrorHandler() { auto &rErrorHandlers = GetErrorRegistry().errorHandlers; - rErrorHandlers.erase( ::std::remove(rErrorHandlers.begin(), rErrorHandlers.end(), this), - rErrorHandlers.end()); + std::erase(rErrorHandlers, this); } bool ErrorHandler::GetErrorString(const ErrCodeMsg& nErrCode, OUString& rErrStr) @@ -207,7 +206,7 @@ ErrorContext::ErrorContext(weld::Window *pWinP) ErrorContext::~ErrorContext() { auto &rContexts = GetErrorRegistry().contexts; - rContexts.erase( ::std::remove(rContexts.begin(), rContexts.end(), this), rContexts.end()); + std::erase(rContexts, this); } ErrorContext *ErrorContext::GetContext() diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index 22845912fb36..23d910112a74 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -314,7 +314,7 @@ void Window::RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListen if (mpWindowImpl) { auto& rListeners = mpWindowImpl->maEventListeners; - rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() ); + std::erase(rListeners, rEventListener); if (mpWindowImpl->mnEventListenersIteratingCount) mpWindowImpl->maEventListenersDeleted.insert(rEventListener); } @@ -330,7 +330,7 @@ void Window::RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventL if (mpWindowImpl) { auto& rListeners = mpWindowImpl->maChildEventListeners; - rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() ); + std::erase(rListeners, rEventListener); if (mpWindowImpl->mnChildEventListenersIteratingCount) mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener); } diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx index a19cc0812e99..f595de0d579d 100644 --- a/vcl/unx/generic/dtrans/X11_clipboard.cxx +++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx @@ -190,7 +190,7 @@ void SAL_CALL X11Clipboard::addClipboardListener( const Reference< XClipboardLis void SAL_CALL X11Clipboard::removeClipboardListener( const Reference< XClipboardListener >& listener ) { MutexGuard aGuard( m_xSelectionManager->getMutex() ); - m_aListeners.erase( std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end() ); + std::erase(m_aListeners, listener); } Reference< XTransferable > X11Clipboard::getTransferable() diff --git a/vcl/unx/generic/dtrans/X11_droptarget.cxx b/vcl/unx/generic/dtrans/X11_droptarget.cxx index 7ce291902112..e026ad1ab17c 100644 --- a/vcl/unx/generic/dtrans/X11_droptarget.cxx +++ b/vcl/unx/generic/dtrans/X11_droptarget.cxx @@ -83,7 +83,7 @@ void DropTarget::removeDropTargetListener( const Reference< XDropTargetListener { ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); - m_aListeners.erase( std::remove(m_aListeners.begin(), m_aListeners.end(), xListener), m_aListeners.end() ); + std::erase(m_aListeners, xListener); } sal_Bool DropTarget::isActive() diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index e3369c163f44..04e46f12d132 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -1578,7 +1578,7 @@ void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::cl { osl::Guard aGuard( m_aMutex ); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end()); + std::erase(m_aListeners, listener); } Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& arguments) @@ -1678,7 +1678,7 @@ void GtkInstDropTarget::removeDropTargetListener( const Reference< css::datatran { ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); - m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), xListener), m_aListeners.end()); + std::erase(m_aListeners, xListener); } void GtkInstDropTarget::fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde) |