diff options
Diffstat (limited to 'framework/source/services/sessionlistener.cxx')
-rw-r--r-- | framework/source/services/sessionlistener.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index 01e4cdbce614..a77e7f961ebb 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -22,7 +22,7 @@ #include <framework/desktop.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/theAutoRecovery.hpp> @@ -42,6 +42,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <utility> using namespace css; using namespace com::sun::star::uno; @@ -101,7 +102,7 @@ private: void QuitSessionQuietly(); public: - explicit SessionListener(const css::uno::Reference< css::uno::XComponentContext >& xContext); + explicit SessionListener(css::uno::Reference< css::uno::XComponentContext > xContext); virtual ~SessionListener() override; @@ -138,8 +139,8 @@ public: virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& event) override; }; -SessionListener::SessionListener(const css::uno::Reference< css::uno::XComponentContext >& rxContext ) - : m_xContext( rxContext ) +SessionListener::SessionListener(css::uno::Reference< css::uno::XComponentContext > rxContext ) + : m_xContext(std::move( rxContext )) , m_bRestored( false ) , m_bSessionStoreRequested( false ) , m_bAllowUserInteractionOnQuit( false ) @@ -179,7 +180,7 @@ void SessionListener::StoreSession( bool bAsync ) if ( bAsync ) xDispatch->addStatusListener(this, aURL); - Sequence< PropertyValue > args{ PropertyValue("DispatchAsynchron",-1,makeAny(bAsync), + Sequence< PropertyValue > args{ PropertyValue("DispatchAsynchron",-1,Any(bAsync), PropertyState_DIRECT_VALUE) }; xDispatch->dispatch(aURL, args); } catch (const css::uno::Exception&) { @@ -207,7 +208,7 @@ void SessionListener::QuitSessionQuietly() aURL.Complete = "vnd.sun.star.autorecovery:/doSessionQuietQuit"; xURLTransformer->parseStrict(aURL); - Sequence< PropertyValue > args{ PropertyValue("DispatchAsynchron",-1,makeAny(false), + Sequence< PropertyValue > args{ PropertyValue("DispatchAsynchron",-1,Any(false), PropertyState_DIRECT_VALUE) }; xDispatch->dispatch(aURL, args); } catch (const css::uno::Exception&) { @@ -365,7 +366,8 @@ void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted catch( const css::uno::Exception& ) { StoreSession( true ); - m_rSessionManager->interactionDone( this ); + if (m_rSessionManager.is()) + m_rSessionManager->interactionDone(this); } if ( m_rSessionManager.is() && m_bTerminated ) |