diff options
author | Rohan Kumar <rohankanojia420@gmail.com> | 2017-01-24 21:18:00 +0530 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-21 01:39:01 +0200 |
commit | 33c51e8002f58847ba43bc111dabc49278e36daf (patch) | |
tree | a1e276b24a26d4fe594b08dd47dfdaeda31cd020 /include/vcl/vclstatuslistener.hxx | |
parent | e25bf8505cfaa3599c2e78a7c56729280f27373e (diff) |
tdf#95844 Refactor CommandInfoProvider
Instead of a singleton, CommandInfoProvider should just be a set of static methods.
Change-Id: I16d4406e361a72f013d78f18d6bd0ae20c0cc5e9
Diffstat (limited to 'include/vcl/vclstatuslistener.hxx')
-rw-r--r-- | include/vcl/vclstatuslistener.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/vcl/vclstatuslistener.hxx b/include/vcl/vclstatuslistener.hxx index ae461f8d9cb3..c18d2acbed14 100644 --- a/include/vcl/vclstatuslistener.hxx +++ b/include/vcl/vclstatuslistener.hxx @@ -32,12 +32,15 @@ private: /** Dispatcher. Need to keep a reference to it as long as this StatusListener exists. */ css::uno::Reference<css::frame::XDispatch> mxDispatch; css::util::URL maCommandURL; + css::uno::Reference<css::frame::XFrame> mxFrame; public: void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; void SAL_CALL disposing(const css::lang::EventObject& /*Source*/) override; + const css::uno::Reference<css::frame::XFrame>& getFrame() { return mxFrame; } + void dispose(); }; @@ -52,6 +55,8 @@ VclStatusListener<T>::VclStatusListener(T* widget, const rtl::OUString& aCommand if (!xFrame.is()) xFrame = css::uno::Reference<css::frame::XFrame>(xDesktop, css::uno::UNO_QUERY); + mxFrame = xFrame; + css::uno::Reference<css::frame::XDispatchProvider> xDispatchProvider(xFrame, css::uno::UNO_QUERY); if (!xDispatchProvider.is()) return; @@ -86,6 +91,7 @@ void VclStatusListener<T>::dispose() mxDispatch->removeStatusListener(this, maCommandURL); mxDispatch.clear(); } + mxFrame.clear(); mWidget.clear(); } |