Kaydet (Commit) 6f1123d3 authored tarafından Noel Grandin's avatar Noel Grandin

use rtl::Reference in Ruler

instead of manual acquire/release

Change-Id: I7815a0a3c01fce57b4798ac1dbf501e20444c61d
üst bbd8c949
......@@ -21,6 +21,7 @@
#define INCLUDED_SVTOOLS_RULER_HXX
#include <svtools/svtdllapi.h>
#include <rtl/ref.hxx>
#include <tools/link.hxx>
#include <tools/fract.hxx>
#include <vcl/window.hxx>
......@@ -660,7 +661,7 @@ private:
std::unique_ptr<RulerSelection> mxCurrentHitTest;
std::unique_ptr<RulerSelection> mxPreviousHitTest;
SvtRulerAccessible* pAccContext;
rtl::Reference<SvtRulerAccessible> mxAccContext;
SVT_DLLPRIVATE void ImplVDrawLine(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 );
SVT_DLLPRIVATE void ImplVDrawRect(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 );
......
......@@ -283,7 +283,6 @@ void Ruler::ImplInit( WinBits nWinBits )
aDefSize.Width() = nDefHeight;
SetOutputSizePixel( aDefSize );
SetType(WINDOW_RULER);
pAccContext = nullptr;
}
Ruler::Ruler( vcl::Window* pParent, WinBits nWinStyle ) :
......@@ -334,11 +333,7 @@ void Ruler::dispose()
mpSaveData = nullptr;
delete mpDragData;
mpDragData = nullptr;
if( pAccContext )
{
pAccContext->release();
pAccContext = nullptr;
}
mxAccContext.clear();
Window::dispose();
}
......@@ -2827,10 +2822,9 @@ uno::Reference< XAccessible > Ruler::CreateAccessible()
{
aStr = SvtResId(STR_SVT_ACC_RULER_VERT_NAME);
}
pAccContext = new SvtRulerAccessible( xAccParent, *this, aStr );
pAccContext->acquire();
this->SetAccessible(pAccContext);
return pAccContext;
mxAccContext = new SvtRulerAccessible( xAccParent, *this, aStr );
this->SetAccessible(mxAccContext.get());
return mxAccContext.get();
}
else
return uno::Reference< XAccessible >();
......
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