diff options
-rw-r--r-- | starmath/inc/view.hxx | 6 | ||||
-rw-r--r-- | starmath/source/view.cxx | 18 |
2 files changed, 10 insertions, 14 deletions
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index cec85a1bfefc..b41f5a78caa9 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -23,6 +23,7 @@ #include <memory> +#include <rtl/ref.hxx> #include <sfx2/dockwin.hxx> #include <sfx2/viewsh.hxx> #include <svtools/scrwin.hxx> @@ -72,8 +73,7 @@ protected: bool IsInlineEditEnabled() const; private: - css::uno::Reference<css::accessibility::XAccessible> xAccessible; - SmGraphicAccessible* pAccessible; + rtl::Reference<SmGraphicAccessible> mxAccessible; SmViewShell* pViewShell; sal_uInt16 nZoom; @@ -131,7 +131,7 @@ public: using Window::GetAccessible; SmGraphicAccessible* GetAccessible_Impl() { - return pAccessible; + return mxAccessible.get(); } }; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index dc099f9beef6..0e93bdd52974 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -95,7 +95,6 @@ using namespace css::uno; SmGraphicWindow::SmGraphicWindow(SmViewShell* pShell) : ScrollableWindow(&pShell->GetViewFrame()->GetWindow()) - , pAccessible(nullptr) , pViewShell(pShell) , nZoom(100) { @@ -122,10 +121,8 @@ SmGraphicWindow::~SmGraphicWindow() void SmGraphicWindow::dispose() { - if (pAccessible) - pAccessible->ClearWin(); // make Accessible defunctional - // Note: memory for pAccessible will be freed when the reference - // xAccessible is released. + if (mxAccessible.is()) + mxAccessible->ClearWin(); // make Accessible defunctional CaretBlinkStop(); ScrollableWindow::dispose(); } @@ -235,12 +232,12 @@ void SmGraphicWindow::GetFocus() void SmGraphicWindow::LoseFocus() { ScrollableWindow::LoseFocus(); - if (xAccessible.is()) + if (mxAccessible.is()) { uno::Any aOldValue, aNewValue; aOldValue <<= AccessibleStateType::FOCUSED; // aNewValue remains empty - pAccessible->LaunchEvent( AccessibleEventId::STATE_CHANGED, + mxAccessible->LaunchEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); } if (!IsInlineEditEnabled()) @@ -614,12 +611,11 @@ void SmGraphicWindow::ZoomToFitInWindow() uno::Reference< XAccessible > SmGraphicWindow::CreateAccessible() { - if (!pAccessible) + if (!mxAccessible.is()) { - pAccessible = new SmGraphicAccessible( this ); - xAccessible = pAccessible; + mxAccessible = new SmGraphicAccessible( this ); } - return xAccessible; + return mxAccessible.get(); } /**************************************************************************/ |