summaryrefslogtreecommitdiff
path: root/starmath/source/view.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-25 16:09:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-26 08:13:46 +0200
commit0d172a803054801ff42296c65cfca844ad5e8f6b (patch)
treecbabd236256fc12de12c6489fb9cf367a535e91c /starmath/source/view.cxx
parentf025255bf66394ec168ae4cfc4d048c202800d16 (diff)
use rtl::Reference in SmGraphicWindow
instead of storing both a raw pointer and an uno::Reference Change-Id: Ib84809bee35c01fb590439174740d92bf4cd54bd
Diffstat (limited to 'starmath/source/view.cxx')
-rw-r--r--starmath/source/view.cxx18
1 files changed, 7 insertions, 11 deletions
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();
}
/**************************************************************************/