diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-12-13 13:42:14 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-12-13 13:42:14 +0100 |
commit | 98e9b844f2f2038d69ae159ee67cc6c3ba7d1a76 (patch) | |
tree | 51f39b72ae8d65401ae4a377d4548a78a1ae939f /vcl/source/app | |
parent | 7c0d414bcfde64715552807a985eddb748d96218 (diff) |
vcl118: #i116048# improve shutdown behavior of unix clipboard (thanks sb !)
Diffstat (limited to 'vcl/source/app')
-rw-r--r-- | vcl/source/app/session.cxx | 36 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 13 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 16 |
4 files changed, 44 insertions, 26 deletions
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index c65eb13224e1..4a9ea98ae3e8 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -39,6 +39,12 @@ #include <list> +namespace { + +namespace css = com::sun::star; + +} + using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::frame; @@ -52,12 +58,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient { struct Listener { - Reference< XSessionManagerListener > m_xListener; + css::uno::Reference< XSessionManagerListener > m_xListener; bool m_bInteractionRequested; bool m_bInteractionDone; bool m_bSaveDone; - Listener( const Reference< XSessionManagerListener >& xListener ) + Listener( const css::uno::Reference< XSessionManagerListener >& xListener ) : m_xListener( xListener ), m_bInteractionRequested( false ), m_bInteractionDone( false ), @@ -84,11 +90,11 @@ public: VCLSession(); virtual ~VCLSession(); - virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException ); - virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL addSessionManagerListener( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL removeSessionManagerListener( const css::uno::Reference< XSessionManagerListener>& xListener ) throw( RuntimeException ); + virtual void SAL_CALL queryInteraction( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException ); }; @@ -212,7 +218,7 @@ void VCLSession::callQuit() ULONG nAcquireCount = Application::ReleaseSolarMutex(); for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it ) { - Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY ); + css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY ); if( xListener2.is() ) xListener2->doQuit(); } @@ -244,14 +250,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent ) } } -void SAL_CALL VCLSession::addSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); m_aListeners.push_back( Listener( xListener ) ); } -void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); @@ -268,7 +274,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSession } } -void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException ) { if( m_bInteractionGranted ) { @@ -295,7 +301,7 @@ void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListe } } -void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); int nRequested = 0, nDone = 0; @@ -318,7 +324,7 @@ void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListe } } -void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); @@ -359,11 +365,11 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames() return aRet; } -Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ ) +css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ ) { ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->xSMClient.is() ) pSVData->xSMClient = new VCLSession(); - return Reference< XInterface >(pSVData->xSMClient, UNO_QUERY ); + return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY ); } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e503172eb2c6..759d28e30bb1 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1761,9 +1761,12 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper ) ImplSVData* pSVData = ImplGetSVData(); if( !pSVData->mxDisplayConnection.is() ) + { pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection ); + pSVData->mxDisplayConnection->start(); + } - return pSVData->mxDisplayConnection; + return pSVData->mxDisplayConnection.get(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 935d2c1894ea..01647af81f7f 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -53,6 +53,7 @@ #include "vcl/salimestatus.hxx" #include "vcl/salsys.hxx" #include "vcl/svids.hrc" +#include "vcl/xconnection.hxx" #include "unotools/fontcfg.hxx" @@ -71,6 +72,12 @@ #include <stdio.h> +namespace { + +namespace css = com::sun::star; + +} + using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::awt; @@ -362,12 +369,12 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled) ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->mxAccessBridge.is() ) { - Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); + css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); if( xFactory.is() ) { - Reference< XExtendedToolkit > xToolkit = - Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); + css::uno::Reference< XExtendedToolkit > xToolkit = + css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); Sequence< Any > arguments(1); arguments[0] = makeAny(xToolkit); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 4efa2b659e7c..2da07db443fd 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -89,6 +89,12 @@ #include "rtl/strbuf.hxx" #endif +namespace { + +namespace css = com::sun::star; + +} + using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -171,7 +177,7 @@ BOOL ImplSVMain() DBG_ASSERT( pSVData->mpApp, "no instance of class Application" ); - Reference<XMultiServiceFactory> xMS; + css::uno::Reference<XMultiServiceFactory> xMS; BOOL bInit = InitVCL( xMS ); @@ -186,11 +192,7 @@ BOOL ImplSVMain() if( pSVData->mxDisplayConnection.is() ) { - vcl::DisplayConnection* pConnection = - dynamic_cast<vcl::DisplayConnection*>(pSVData->mxDisplayConnection.get()); - - if( pConnection ) - pConnection->dispatchDowningEvent(); + pSVData->mxDisplayConnection->terminate(); pSVData->mxDisplayConnection.clear(); } @@ -199,7 +201,7 @@ BOOL ImplSVMain() // be some events in the AWT EventQueue, which need the SolarMutex which // - on the other hand - is destroyed in DeInitVCL(). So empty the queue // here .. - Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY); + css::uno::Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY); if( xComponent.is() ) { ULONG nCount = Application::ReleaseSolarMutex(); |