summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-05 16:53:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-05 16:55:15 +0200
commitcc7556740640e1b3f8730b939e21eaa882abc031 (patch)
treede9bf6ea2f7dd37d3a069f7556dedcd4f1952818 /sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
parentc30defcf8e34daec6ea0455d772fe296cc26ecc9 (diff)
Return rtl::Reference from ShapeTypeHandler::CreateAccessibleObject
...and handle related fallout Change-Id: Ie82d853a9bf28b359d5aab9d0af01b728d68ed70
Diffstat (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index b5e16946d373..8816fd7fe70b 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -566,13 +566,12 @@ Size ScIAccessibleViewForwarder::LogicToPixel (const Size& rSize) const
struct ScShapeChild
{
ScShapeChild()
- : mpAccShape(NULL)
- , mnRangeId(0)
+ : mnRangeId(0)
{
}
ScShapeChild(const ScShapeChild& rOld);
~ScShapeChild();
- mutable ::accessibility::AccessibleShape* mpAccShape;
+ mutable rtl::Reference< ::accessibility::AccessibleShape > mpAccShape;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
sal_Int32 mnRangeId;
};
@@ -582,17 +581,13 @@ ScShapeChild::ScShapeChild(const ScShapeChild& rOld)
mpAccShape(rOld.mpAccShape),
mxShape(rOld.mxShape),
mnRangeId(rOld.mnRangeId)
-{
- if (mpAccShape)
- mpAccShape->acquire();
-}
+{}
ScShapeChild::~ScShapeChild()
{
- if (mpAccShape)
+ if (mpAccShape.is())
{
mpAccShape->dispose();
- mpAccShape->release();
}
}
@@ -816,7 +811,7 @@ namespace
ScVisAreaChanged(const ScIAccessibleViewForwarder* pViewForwarder) : mpViewForwarder(pViewForwarder) {}
void operator() (const ScShapeChild& rAccShapeData) const
{
- if (rAccShapeData.mpAccShape)
+ if (rAccShapeData.mpAccShape.is())
{
rAccShapeData.mpAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
}
@@ -1015,7 +1010,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackgroundShapeAt(const awt::Poi
::accessibility::AccessibleShape* ScShapeChildren::GetAccShape(const ScShapeChild& rShape) const
{
- if (!rShape.mpAccShape)
+ if (!rShape.mpAccShape.is())
{
::accessibility::ShapeTypeHandler& rShapeHandler = ::accessibility::ShapeTypeHandler::Instance();
::accessibility::AccessibleShapeInfo aShapeInfo(rShape.mxShape, mpAccDoc, const_cast<ScShapeChildren*>(this));
@@ -1028,14 +1023,13 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackgroundShapeAt(const awt::Poi
aShapeTreeInfo.SetWindow(mpViewShell->GetWindow());
aShapeTreeInfo.SetViewForwarder(&(maShapeRanges[rShape.mnRangeId].maViewForwarder));
rShape.mpAccShape = rShapeHandler.CreateAccessibleObject(aShapeInfo, aShapeTreeInfo);
- if (rShape.mpAccShape)
+ if (rShape.mpAccShape.is())
{
- rShape.mpAccShape->acquire();
rShape.mpAccShape->Init();
}
}
}
- return rShape.mpAccShape;
+ return rShape.mpAccShape.get();
}
::accessibility::AccessibleShape* ScShapeChildren::GetAccShape(const ScShapeChildVec& rShapes, sal_Int32 nIndex) const