[Libreoffice-commits] core.git: framework/inc framework/source include/svtools svtools/source
framework/inc/uielement/langselectionmenucontroller.hxx|6 framework/inc/uielement/newmenucontroller.hxx |6 framework/inc/uielement/toolbarsmenucontroller.hxx |6 framework/source/uielement/controlmenucontroller.cxx | 21 +- framework/source/uielement/fontmenucontroller.cxx | 12 - framework/source/uielement/fontsizemenucontroller.cxx | 12 - framework/source/uielement/headermenucontroller.cxx| 12 - framework/source/uielement/langselectionmenucontroller.cxx | 14 - framework/source/uielement/macrosmenucontroller.cxx|4 framework/source/uielement/newmenucontroller.cxx | 10 - framework/source/uielement/objectmenucontroller.cxx|4 framework/source/uielement/recentfilesmenucontroller.cxx | 16 +- framework/source/uielement/resourcemenucontroller.cxx |6 framework/source/uielement/toolbarmodemenucontroller.cxx | 10 - framework/source/uielement/toolbarsmenucontroller.cxx | 19 +- include/svtools/popupmenucontrollerbase.hxx| 16 -- svtools/source/uno/popupmenucontrollerbase.cxx | 96 ++--- 17 files changed, 128 insertions(+), 142 deletions(-) New commits: commit 5032262fccd0ef7f274323ae481b3230ffd42d3a Author: Noel Grandin AuthorDate: Tue Feb 21 15:05:37 2023 +0200 Commit: Noel Grandin CommitDate: Wed Feb 22 13:24:47 2023 + BaseMutex->std::mutex in PopupMenuControllerBase Change-Id: I26877ac7b6e5e39f511418d978199189c62cca6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147416 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx index c27f42b56431..070054a2f4ac 100644 --- a/framework/inc/uielement/langselectionmenucontroller.hxx +++ b/framework/inc/uielement/langselectionmenucontroller.hxx @@ -44,9 +44,6 @@ namespace framework // XPopupMenuController virtual void SAL_CALL updatePopupMenu() override; -// XInitialization -virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -54,6 +51,9 @@ namespace framework virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: +// XInitialization +virtual void initializeImpl( std::unique_lock& rGuard, const css::uno::Sequence< css::uno::Any >& aArguments ) override; + virtual void impl_setPopupMenu() override; enum Mode { diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx index 57e58239fc19..45b5e8f88696 100644 --- a/framework/inc/uielement/newmenucontroller.hxx +++ b/framework/inc/uielement/newmenucontroller.hxx @@ -40,9 +40,6 @@ namespace framework virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; -// XInitialization -virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -54,6 +51,9 @@ namespace framework virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: +// XInitialization +virtual void initializeImpl( std::unique_lock& rGuard, const css::uno::Sequence< css::uno::Any >& aArguments ) override; + virtual void impl_setPopupMenu() override; void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index 99d64775d6b6..48ae2eacd360 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -48,9 +48,6 @@ namespace framework // XPopupMenuController virtual void SAL_CALL setPopupMenu( const css::uno::Reference< css::awt::XPopupMenu >& PopupMenu ) override; -// XInitialization -virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -71,6 +68,9 @@ namespace framework DECL_STATIC_LINK( ToolbarsMenuController, ExecuteHdl_Impl, void*, void ); private: +// XInitiali
[Libreoffice-commits] core.git: framework/inc framework/source include/svtools svtools/source
framework/inc/services/desktop.hxx|9 ++ framework/source/services/desktop.cxx | 44 ++ include/svtools/transfer.hxx |8 +- svtools/source/misc/transfer.cxx | 15 +++ 4 files changed, 75 insertions(+), 1 deletion(-) New commits: commit 7250bc4721b334714bb0fa1345211c83330f94b2 Author: Markus Mohrhard Date: Fri Jun 30 23:23:36 2017 +0200 notify the clipboard terminate listener before any other terminate listener Otherwise we may have destroyed a service that is needed to generate one of the clipboard formats requested by the system clipboard. Change-Id: Id05de3ac569e3ed38cd97efc4c48326bc6a8db0b Reviewed-on: https://gerrit.libreoffice.org/39429 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx index 2b07a2487d97..a77c816e9d2a 100644 --- a/framework/inc/services/desktop.hxx +++ b/framework/inc/services/desktop.hxx @@ -341,6 +341,15 @@ class Desktop : private cppu::BaseMutex, */ void impl_sendCancelTerminationEvent(const TTerminateListenerList& lCalledListener); +/** calls notifyTermination() on the clipboard listener + * + * The system clipboard may decide that it wants copies + * in several formats of the clipboard content requiring + * nearly all the services + * + */ +void impl_sendTerminateToClipboard(); + /** calls notifyTermination() on every registered termination listener. * * Note: Only normal termination listener (registered in list m_aListenerContainer diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 7c3c2e4b80d1..e96224815441 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -324,6 +324,10 @@ sal_Bool SAL_CALL Desktop::terminate() aWriteLock.clear(); /* UNSAFE AREA - */ +// The clipboard listener needs to be the first. It can create copies of the +// existing document which needs basically all the available infrastructure. +impl_sendTerminateToClipboard(); + impl_sendNotifyTerminationEvent(); { SolarMutexGuard aGuard; @@ -1630,6 +1634,46 @@ void Desktop::impl_sendCancelTerminationEvent(const Desktop::TTerminateListenerL } } +void Desktop::impl_sendTerminateToClipboard() +{ +TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); + +::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); +if ( ! pContainer ) +return; + +::cppu::OInterfaceIteratorHelper aIterator( *pContainer ); +while ( aIterator.hasMoreElements() ) +{ +try +{ +css::uno::Reference< css::lang::XServiceInfo > xInfo( aIterator.next(), css::uno::UNO_QUERY ); +if ( !xInfo.is() ) +continue; + +if ( xInfo->getImplementationName() != "com.sun.star.comp.svt.TransferableHelperTerminateListener" ) +continue; + +css::uno::Reference< css::frame::XTerminateListener > xListener(xInfo, css::uno::UNO_QUERY); +if ( ! xListener.is() ) +continue; + +css::lang::EventObject aEvent( static_cast< ::cppu::OWeakObject* >(this) ); +xListener->notifyTermination( aEvent ); + +// don't notify twice +aIterator.remove(); +} +catch( const css::uno::Exception& ) +{ +// clean up container. +// E.g. dead remote listener objects can make trouble otherwise. +// Iterator implementation allows removing objects during it's used ! +aIterator.remove(); +} +} +} + void Desktop::impl_sendNotifyTerminationEvent() { TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx index bc3c6eceacab..f499a2a1fce4 100644 --- a/include/svtools/transfer.hxx +++ b/include/svtools/transfer.hxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -127,7 +128,7 @@ class SVT_DLLPUBLIC TransferableHelper : public cppu::WeakImplHelper< css::datat private: // nested class to implement the XTerminateListener interface -class TerminateListener : public cppu::WeakImplHelper< css::frame::XTerminateListener > +class TerminateListener : public cppu::WeakImplHelper< css::frame::XTerminateListener, css::lang::XServiceInfo > { private: @@ -142,6 +143,11 @@ private: virtual void SAL_CALL queryTermination( const css::lang::EventObject& aEvent ) override; virtual void SAL_CALL notif