Kaydet (Commit) 79e0e713 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Update to XDocumentEventBroadcaster et al

Change-Id: I11633dc1629eac6a1ba79e4b45972a1e4f5fc833
üst ba150afb
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XDocumentEventListener.hpp>
#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/util/XChangesListener.hpp> #include <com/sun/star/util/XChangesListener.hpp>
#include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/container/XContainerListener.hpp>
...@@ -267,13 +267,13 @@ class WeakEventListener : public ::cppu::WeakImplHelper1<com::sun::star::lang::X ...@@ -267,13 +267,13 @@ class WeakEventListener : public ::cppu::WeakImplHelper1<com::sun::star::lang::X
} }
}; };
class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star::document::XEventListener> class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star::document::XDocumentEventListener>
{ {
private: private:
com::sun::star::uno::WeakReference<com::sun::star::document::XEventListener> mxOwner; com::sun::star::uno::WeakReference<com::sun::star::document::XDocumentEventListener> mxOwner;
public: public:
WeakDocumentEventListener(com::sun::star::uno::Reference<com::sun::star::document::XEventListener> xOwner) WeakDocumentEventListener(com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener> xOwner)
: mxOwner(xOwner) : mxOwner(xOwner)
{ {
} }
...@@ -282,13 +282,13 @@ class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star: ...@@ -282,13 +282,13 @@ class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star:
{ {
} }
virtual void SAL_CALL notifyEvent(const com::sun::star::document::EventObject& rEvent) virtual void SAL_CALL documentEventOccured(const com::sun::star::document::DocumentEvent& rEvent)
throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ {
com::sun::star::uno::Reference<com::sun::star::document::XEventListener> xOwner(mxOwner.get(), com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener> xOwner(mxOwner.get(),
com::sun::star::uno::UNO_QUERY); com::sun::star::uno::UNO_QUERY);
if (xOwner.is()) if (xOwner.is())
xOwner->notifyEvent(rEvent); xOwner->documentEventOccured(rEvent);
} }
...@@ -296,7 +296,7 @@ class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star: ...@@ -296,7 +296,7 @@ class WeakDocumentEventListener : public ::cppu::WeakImplHelper1<com::sun::star:
virtual void SAL_CALL disposing(const com::sun::star::lang::EventObject& rEvent) virtual void SAL_CALL disposing(const com::sun::star::lang::EventObject& rEvent)
throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ {
com::sun::star::uno::Reference<com::sun::star::document::XEventListener> xOwner(mxOwner.get(), com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener> xOwner(mxOwner.get(),
com::sun::star::uno::UNO_QUERY); com::sun::star::uno::UNO_QUERY);
if (xOwner.is()) if (xOwner.is())
xOwner->disposing(rEvent); xOwner->disposing(rEvent);
......
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XDocumentEventListener.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp> #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/util/XChangesListener.hpp> #include <com/sun/star/util/XChangesListener.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/util/XModifyListener.hpp>
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
typedef ::cppu::WeakComponentImplHelper5< typedef ::cppu::WeakComponentImplHelper5<
css::lang::XServiceInfo, css::lang::XServiceInfo,
css::frame::XDispatch, css::frame::XDispatch,
css::document::XEventListener, // => css.lang.XEventListener css::document::XDocumentEventListener, // => css.lang.XEventListener
css::util::XChangesListener, // => css.lang.XEventListener css::util::XChangesListener, // => css.lang.XEventListener
css::util::XModifyListener > // => css.lang.XEventListener css::util::XModifyListener > // => css.lang.XEventListener
AutoRecovery_BASE; AutoRecovery_BASE;
...@@ -363,7 +363,7 @@ private: ...@@ -363,7 +363,7 @@ private:
/** @short proxy weak binding to forward Events to ourself without /** @short proxy weak binding to forward Events to ourself without
an ownership cycle an ownership cycle
*/ */
css::uno::Reference< css::document::XEventListener > m_xNewDocBroadcasterListener; css::uno::Reference< css::document::XDocumentEventListener > m_xNewDocBroadcasterListener;
/** @short because we stop/restart listening sometimes, it's a good idea to know /** @short because we stop/restart listening sometimes, it's a good idea to know
if we already registered as listener .-) if we already registered as listener .-)
...@@ -499,7 +499,7 @@ public: ...@@ -499,7 +499,7 @@ public:
const css::util::URL& aURL ) const css::util::URL& aURL )
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// css.document.XEventListener // css.document.XDocumentEventListener
/** @short informs about created/opened documents. /** @short informs about created/opened documents.
@descr Every new opened/created document will be saved internally @descr Every new opened/created document will be saved internally
...@@ -509,7 +509,7 @@ public: ...@@ -509,7 +509,7 @@ public:
@param aEvent @param aEvent
points to the new created/opened document. points to the new created/opened document.
*/ */
virtual void SAL_CALL notifyEvent(const css::document::EventObject& aEvent) virtual void SAL_CALL documentEventOccured(const css::document::DocumentEvent& aEvent)
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// css.util.XChangesListener // css.util.XChangesListener
...@@ -1589,7 +1589,7 @@ void SAL_CALL AutoRecovery::removeStatusListener(const css::uno::Reference< css: ...@@ -1589,7 +1589,7 @@ void SAL_CALL AutoRecovery::removeStatusListener(const css::uno::Reference< css:
m_lListener.removeInterface(aURL.Complete, xListener); m_lListener.removeInterface(aURL.Complete, xListener);
} }
void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent) void SAL_CALL AutoRecovery::documentEventOccured(const css::document::DocumentEvent& aEvent)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
css::uno::Reference< css::frame::XModel > xDocument(aEvent.Source, css::uno::UNO_QUERY); css::uno::Reference< css::frame::XModel > xDocument(aEvent.Source, css::uno::UNO_QUERY);
...@@ -2210,7 +2210,7 @@ void AutoRecovery::implts_startListening() ...@@ -2210,7 +2210,7 @@ void AutoRecovery::implts_startListening()
) )
{ {
m_xNewDocBroadcasterListener = new WeakDocumentEventListener(this); m_xNewDocBroadcasterListener = new WeakDocumentEventListener(this);
xBroadcaster->addEventListener(m_xNewDocBroadcasterListener); xBroadcaster->addDocumentEventListener(m_xNewDocBroadcasterListener);
/* SAFE */ { /* SAFE */ {
osl::MutexGuard g2(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); osl::MutexGuard g2(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
m_bListenForDocEvents = true; m_bListenForDocEvents = true;
...@@ -2221,7 +2221,7 @@ void AutoRecovery::implts_startListening() ...@@ -2221,7 +2221,7 @@ void AutoRecovery::implts_startListening()
void AutoRecovery::implts_stopListening() void AutoRecovery::implts_stopListening()
{ {
css::uno::Reference< css::util::XChangesNotifier > xCFG; css::uno::Reference< css::util::XChangesNotifier > xCFG;
css::uno::Reference< css::document::XEventBroadcaster > xGlobalEventBroadcaster; css::uno::Reference< css::document::XDocumentEventBroadcaster > xGlobalEventBroadcaster;
/* SAFE */ { /* SAFE */ {
osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
// Attention: Dont reset our internal members here too. // Attention: Dont reset our internal members here too.
...@@ -2236,7 +2236,7 @@ void AutoRecovery::implts_stopListening() ...@@ -2236,7 +2236,7 @@ void AutoRecovery::implts_stopListening()
(m_bListenForDocEvents ) (m_bListenForDocEvents )
) )
{ {
xGlobalEventBroadcaster->removeEventListener(m_xNewDocBroadcasterListener); xGlobalEventBroadcaster->removeDocumentEventListener(m_xNewDocBroadcasterListener);
m_bListenForDocEvents = false; m_bListenForDocEvents = false;
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XDocumentEventListener.hpp>
#include <cppuhelper/basemutex.hxx> #include <cppuhelper/basemutex.hxx>
#include <cppuhelper/weakref.hxx> #include <cppuhelper/weakref.hxx>
...@@ -55,7 +55,7 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex ...@@ -55,7 +55,7 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex
css::frame::XTitleChangeBroadcaster, css::frame::XTitleChangeBroadcaster,
css::frame::XTitleChangeListener , css::frame::XTitleChangeListener ,
css::frame::XFrameActionListener , css::frame::XFrameActionListener ,
css::document::XEventListener > css::document::XDocumentEventListener >
{ {
// interface // interface
...@@ -125,8 +125,8 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex ...@@ -125,8 +125,8 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
/** @see css.document.XEventListener */ /** @see css.document.XDocumentEventListener */
virtual void SAL_CALL notifyEvent(const css::document::EventObject& aEvent) virtual void SAL_CALL documentEventOccured(const css::document::DocumentEvent& aEvent)
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment