sd/source/console/AccessibleObject.cxx       |  163 +++------------------------
 sd/source/console/AccessibleObject.hxx       |   42 ------
 sd/source/console/AccessibleParagraph.cxx    |   36 ++---
 sd/source/console/PresenterAccessibility.cxx |   10 +
 sd/source/console/PresenterController.cxx    |    3 
 5 files changed, 57 insertions(+), 197 deletions(-)

New commits:
commit ca0067886006b995dca57648996e0a36cb8e00ab
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Feb 27 18:33:31 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Feb 27 23:02:04 2025 +0100

    sd presenter a11y: Drop AccessibleObject::ThrowIfDisposed
    
    Use the base class method
    OCommonAccessibleComponent::ensureAlive instead.
    
    Change-Id: If6d9393c8fe3f3996fa42174ae5831201d7122d0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182330
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/AccessibleObject.cxx 
b/sd/source/console/AccessibleObject.cxx
index 0b3c432f21b9..bae9616b572f 100644
--- a/sd/source/console/AccessibleObject.cxx
+++ b/sd/source/console/AccessibleObject.cxx
@@ -85,7 +85,7 @@ void SAL_CALL AccessibleObject::disposing()
 Reference<XAccessibleContext> SAL_CALL
     AccessibleObject::getAccessibleContext()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return this;
 }
@@ -94,7 +94,7 @@ Reference<XAccessibleContext> SAL_CALL
 
 sal_Int64 SAL_CALL AccessibleObject::getAccessibleChildCount()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return maChildren.size();
 }
@@ -102,7 +102,7 @@ sal_Int64 SAL_CALL 
AccessibleObject::getAccessibleChildCount()
 Reference<XAccessible> SAL_CALL
     AccessibleObject::getAccessibleChild (sal_Int64 nIndex)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     if (nIndex<0 || o3tl::make_unsigned(nIndex)>=maChildren.size())
         throw lang::IndexOutOfBoundsException(u"invalid child index"_ustr, 
static_cast<uno::XWeak*>(this));
@@ -113,7 +113,7 @@ Reference<XAccessible> SAL_CALL
 Reference<XAccessible> SAL_CALL
     AccessibleObject::getAccessibleParent()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return mxParentAccessible;
 }
@@ -121,7 +121,7 @@ Reference<XAccessible> SAL_CALL
 sal_Int64 SAL_CALL
     AccessibleObject::getAccessibleIndexInParent()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     const Reference<XAccessible> xThis (this);
     if (mxParentAccessible.is())
@@ -142,7 +142,7 @@ sal_Int64 SAL_CALL
 sal_Int16 SAL_CALL
     AccessibleObject::getAccessibleRole()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return mnRole;
 }
@@ -150,7 +150,7 @@ sal_Int16 SAL_CALL
 OUString SAL_CALL
     AccessibleObject::getAccessibleDescription()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return OUString();
 }
@@ -158,7 +158,7 @@ OUString SAL_CALL
 OUString SAL_CALL
     AccessibleObject::getAccessibleName()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return msName;
 }
@@ -166,7 +166,7 @@ OUString SAL_CALL
 Reference<XAccessibleRelationSet> SAL_CALL
     AccessibleObject::getAccessibleRelationSet()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return nullptr;
 }
@@ -174,7 +174,7 @@ Reference<XAccessibleRelationSet> SAL_CALL
 sal_Int64 SAL_CALL
     AccessibleObject::getAccessibleStateSet()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return mnStateSet;
 }
@@ -182,7 +182,7 @@ sal_Int64 SAL_CALL
 lang::Locale SAL_CALL
     AccessibleObject::getLocale()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     if (mxParentAccessible.is())
     {
@@ -198,7 +198,7 @@ lang::Locale SAL_CALL
 Reference<XAccessible> SAL_CALL
     AccessibleObject::getAccessibleAtPoint (const awt::Point&)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return Reference<XAccessible>();
 }
@@ -213,7 +213,7 @@ awt::Rectangle AccessibleObject::implGetBounds()
 
 void SAL_CALL AccessibleObject::grabFocus()
 {
-    ThrowIfDisposed();
+    ensureAlive();
     if (mxBorderWindow.is())
         mxBorderWindow->setFocus();
     else if (mxContentWindow.is())
@@ -222,14 +222,14 @@ void SAL_CALL AccessibleObject::grabFocus()
 
 sal_Int32 SAL_CALL AccessibleObject::getForeground()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return 0x00ffffff;
 }
 
 sal_Int32 SAL_CALL AccessibleObject::getBackground()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return 0x00000000;
 }
@@ -402,10 +402,4 @@ awt::Size AccessibleObject::GetSize()
         return awt::Size();
 }
 
-void AccessibleObject::ThrowIfDisposed() const
-{
-    if (rBHelper.bDisposed || rBHelper.bInDispose)
-        throw lang::DisposedException(u"object has already been 
disposed"_ustr, 
uno::Reference<uno::XInterface>(const_cast<uno::XWeak*>(static_cast<uno::XWeak 
const *>(this))));
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sd/source/console/AccessibleObject.hxx 
b/sd/source/console/AccessibleObject.hxx
index 121d2cf87d47..30f73ef4f329 100644
--- a/sd/source/console/AccessibleObject.hxx
+++ b/sd/source/console/AccessibleObject.hxx
@@ -139,9 +139,6 @@ protected:
     virtual bool GetWindowState (const sal_Int64 nType) const;
 
     void UpdateState (const sal_Int64 aState, const bool bValue);
-
-    /// @throws css::lang::DisposedException
-    void ThrowIfDisposed() const;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sd/source/console/AccessibleParagraph.cxx 
b/sd/source/console/AccessibleParagraph.cxx
index ba8ae57c9818..eb39f89f5c3f 100644
--- a/sd/source/console/AccessibleParagraph.cxx
+++ b/sd/source/console/AccessibleParagraph.cxx
@@ -124,7 +124,7 @@ AccessibleParagraph::AccessibleParagraph(
 Reference<XAccessibleRelationSet> SAL_CALL
     AccessibleParagraph::getAccessibleRelationSet()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     rtl::Reference<AccessibleRelationSet> pSet (new AccessibleRelationSet);
 
@@ -152,7 +152,7 @@ Reference<XAccessibleRelationSet> SAL_CALL
 
 sal_Int32 SAL_CALL AccessibleParagraph::getCaretPosition()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     sal_Int32 nPosition (-1);
     if (mpParagraph)
@@ -163,7 +163,7 @@ sal_Int32 SAL_CALL AccessibleParagraph::getCaretPosition()
 
 sal_Bool SAL_CALL AccessibleParagraph::setCaretPosition (sal_Int32 nIndex)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     if (mpParagraph)
     {
@@ -176,7 +176,7 @@ sal_Bool SAL_CALL AccessibleParagraph::setCaretPosition 
(sal_Int32 nIndex)
 
 sal_Unicode SAL_CALL AccessibleParagraph::getCharacter (sal_Int32 nIndex)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     if (!mpParagraph)
         throw lang::IndexOutOfBoundsException(u"no text support in current 
mode"_ustr, static_cast<uno::XWeak*>(this));
@@ -188,7 +188,7 @@ Sequence<css::beans::PropertyValue> SAL_CALL
         ::sal_Int32 nIndex,
         const css::uno::Sequence<OUString>& rRequestedAttributes)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
 #if OSL_DEBUG_LEVEL > 0
     SAL_INFO( "sdext.presenter", __func__ << " at " << this << ", " << nIndex 
<< " returns empty set" );
@@ -211,7 +211,7 @@ Sequence<css::beans::PropertyValue> SAL_CALL
 awt::Rectangle SAL_CALL AccessibleParagraph::getCharacterBounds (
     sal_Int32 nIndex)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     awt::Rectangle aCharacterBox;
     if (nIndex < 0)
@@ -237,7 +237,7 @@ awt::Rectangle SAL_CALL 
AccessibleParagraph::getCharacterBounds (
 
 sal_Int32 SAL_CALL AccessibleParagraph::getCharacterCount()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     sal_Int32 nCount (0);
     if (mpParagraph)
@@ -249,27 +249,27 @@ sal_Int32 SAL_CALL 
AccessibleParagraph::getCharacterCount()
 sal_Int32 SAL_CALL AccessibleParagraph::getIndexAtPoint (
     const css::awt::Point& )
 {
-    ThrowIfDisposed();
+    ensureAlive();
     return -1;
 }
 
 OUString SAL_CALL AccessibleParagraph::getSelectedText()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return getTextRange(getSelectionStart(), getSelectionEnd());
 }
 
 sal_Int32 SAL_CALL AccessibleParagraph::getSelectionStart()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return getCaretPosition();
 }
 
 sal_Int32 SAL_CALL AccessibleParagraph::getSelectionEnd()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return getCaretPosition();
 }
@@ -278,14 +278,14 @@ sal_Bool SAL_CALL AccessibleParagraph::setSelection (
     sal_Int32 nStartIndex,
     sal_Int32)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     return setCaretPosition(nStartIndex);
 }
 
 OUString SAL_CALL AccessibleParagraph::getText()
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     OUString sText;
     if (mpParagraph)
@@ -298,7 +298,7 @@ OUString SAL_CALL AccessibleParagraph::getTextRange (
     sal_Int32 nLocalStartIndex,
     sal_Int32 nLocalEndIndex)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     OUString sText;
     if (mpParagraph)
@@ -315,7 +315,7 @@ TextSegment SAL_CALL AccessibleParagraph::getTextAtIndex (
     sal_Int32 nLocalCharacterIndex,
     sal_Int16 nTextType)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     TextSegment aSegment;
     if (mpParagraph)
@@ -328,7 +328,7 @@ TextSegment SAL_CALL 
AccessibleParagraph::getTextBeforeIndex (
     sal_Int32 nLocalCharacterIndex,
     sal_Int16 nTextType)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     TextSegment aSegment;
     if (mpParagraph)
@@ -341,7 +341,7 @@ TextSegment SAL_CALL 
AccessibleParagraph::getTextBehindIndex (
     sal_Int32 nLocalCharacterIndex,
     sal_Int16 nTextType)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     TextSegment aSegment;
     if (mpParagraph)
@@ -354,7 +354,7 @@ sal_Bool SAL_CALL AccessibleParagraph::copyText (
     sal_Int32,
     sal_Int32)
 {
-    ThrowIfDisposed();
+    ensureAlive();
 
     // Return false because copying to clipboard is not supported.
     // It IS supported in the notes view.  There is no need to duplicate
commit 565be680deffa09a9536717d216c00f4e59d2f20
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Feb 27 18:29:26 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Feb 27 23:01:58 2025 +0100

    sd presenter a11y: Dispose objects
    
    So far, the a11y objects used for the Impress Presenter
    console were not disposed by their owners, leading to
    the crash on exit with qt6 described in previous commit
    
        Change-Id: I1481cbb03e99b6f89c5222ed260477004a9db62c
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Thu Feb 27 17:40:37 2025 +0100
    
            sd presenter a11y: Use OAccessibleComponentHelper
    
    Let the owners take care of disposing the objects, which
    fixes this issue.
    
    Change-Id: I86d740ecfdbec2cb00c25726376e6c88aa51f1c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182329
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/PresenterAccessibility.cxx 
b/sd/source/console/PresenterAccessibility.cxx
index aade4827ad06..95a3c47d3b82 100644
--- a/sd/source/console/PresenterAccessibility.cxx
+++ b/sd/source/console/PresenterAccessibility.cxx
@@ -232,6 +232,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy (
         if (mpAccessiblePreview.is())
         {
             mpAccessibleConsole->RemoveChild(mpAccessiblePreview);
+            mpAccessiblePreview->dispose();
             mpAccessiblePreview = nullptr;
         }
 
@@ -254,6 +255,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy (
     if (mpAccessibleNotes.is())
     {
         mpAccessibleConsole->RemoveChild(mpAccessibleNotes);
+        mpAccessibleNotes->dispose();
         mpAccessibleNotes = nullptr;
     }
 
@@ -304,8 +306,16 @@ void SAL_CALL PresenterAccessible::disposing()
             mxMainPane->setAccessible(nullptr);
     }
 
+    if (mpAccessiblePreview)
+        mpAccessiblePreview->dispose();
     mpAccessiblePreview = nullptr;
+
+    if (mpAccessibleNotes)
+        mpAccessibleNotes->dispose();
     mpAccessibleNotes = nullptr;
+
+    if (mpAccessibleConsole)
+        mpAccessibleConsole->dispose();
     mpAccessibleConsole = nullptr;
 }
 
diff --git a/sd/source/console/PresenterController.cxx 
b/sd/source/console/PresenterController.cxx
index a2e07bbb90e8..c246ab8c34d7 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -754,6 +754,9 @@ void SAL_CALL 
PresenterController::notifyConfigurationChange (
 void SAL_CALL PresenterController::disposing (
     const lang::EventObject& rEvent)
 {
+    if (mpAccessibleObject)
+        mpAccessibleObject->dispose();
+
     if (rEvent.Source.get() == 
static_cast<cppu::OWeakObject*>(mxController.get()))
         mxController = nullptr;
     else if (rEvent.Source == mxConfigurationController)
commit d4807c79aaad4d8a13fcf3247ca0c029b27dd3ef
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Feb 27 17:40:37 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Feb 27 23:01:50 2025 +0100

    sd presenter a11y: Use OAccessibleComponentHelper
    
    Similar to how
    
        commit 1c3d0bc25f1a8bc506fecca7bf39d78f7f817ad3
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Wed Feb 26 11:14:04 2025 +0100
    
            thumbnailview a11y: Use OAccessibleComponentHelper for 
ThumbnailViewItemAcc
    
    did for ThumbnailViewItemAcc, also derive
    from OAccessibleComponentHelper for AccessibleObject
    to make use of the logic already implemented there
    instead of having to implement all the XAccessibleComponent
    and XAccessibleEventBroadcaster methods manually.
    
    AccessibleObject::getBounds implements what is needed
    to implement OAccessibleComponentHelper::implGetBounds,
    so rename the method.
    
    Drop all of the other overrides that are no longer
    needed as the implementation is now provided by
    the OAccessibleComponentHelper base class.
    
    No change in behavior intended or observed initially
    when testing this with the qt6 VCL plugin and the scenario
    otherwise described in
    
        Change-Id: I74660a07e5660a0f1ac0cd17eff793e4e4a8979b
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Thu Feb 27 17:00:44 2025 +0100
    
            sd presenter a11y: Avoid invalid string index
    
    However, when closing LO, this now triggers an assertion:
    
        soffice.bin: 
/home/michi/development/git/libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:142:
 bool (anonymous namespace)::implLookupClient(const 
AccessibleEventNotifier::TClientId, ClientMap::iterator &): Assertion 
`rClients.end() != rPos && "AccessibleEventNotifier::implLookupClient: invalid 
client id " "(did you register your client?)!"' failed.
    
    This is the same preexisting issue as already described
    in more detail for ValueItemAcc in
    
            commit e7dc7ebc9e14447a4ab75502a378f632a910c394
            Author: Michael Weghorn <m.wegh...@posteo.de>
            Date:   Tue Feb 25 12:14:24 2025 +0100
    
                valueset a11y: Use OAccessibleComponentHelper for ValueItemAcc
    
    (items don't get disposed) and will be addressed
    in an upcoming commit.
    
    Change-Id: I72ac37ad368b7d4abf14f625004dad60b20ffe81
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182328
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sd/source/console/AccessibleObject.cxx 
b/sd/source/console/AccessibleObject.cxx
index 28667cfaa631..0b3c432f21b9 100644
--- a/sd/source/console/AccessibleObject.cxx
+++ b/sd/source/console/AccessibleObject.cxx
@@ -29,8 +29,7 @@
 AccessibleObject::AccessibleObject(
     const sal_Int16 nRole,
     OUString sName)
-    : AccessibleObjectInterfaceBase(m_aMutex),
-      msName(std::move(sName)),
+    : msName(std::move(sName)),
       mnRole(nRole),
       mnStateSet(0),
       mbIsFocused(false)
@@ -75,6 +74,8 @@ void AccessibleObject::SetAccessibleParent (
 
 void SAL_CALL AccessibleObject::disposing()
 {
+    OAccessibleComponentHelper::disposing();
+
     AccessibleFocusManager::Instance()->RemoveFocusableObject(this);
     SetWindow(nullptr, nullptr);
 }
@@ -194,23 +195,6 @@ lang::Locale SAL_CALL
 
 //-----  XAccessibleComponent  ------------------------------------------------
 
-sal_Bool SAL_CALL AccessibleObject::containsPoint (
-    const awt::Point& rPoint)
-{
-    ThrowIfDisposed();
-
-    if (mxContentWindow.is())
-    {
-        const awt::Rectangle aBox (getBounds());
-        return rPoint.X>=aBox.X
-            && rPoint.Y>=aBox.Y
-            && rPoint.X<aBox.X+aBox.Width
-            && rPoint.Y<aBox.Y+aBox.Height;
-    }
-    else
-        return false;
-}
-
 Reference<XAccessible> SAL_CALL
     AccessibleObject::getAccessibleAtPoint (const awt::Point&)
 {
@@ -219,46 +203,14 @@ Reference<XAccessible> SAL_CALL
     return Reference<XAccessible>();
 }
 
-awt::Rectangle SAL_CALL AccessibleObject::getBounds()
+awt::Rectangle AccessibleObject::implGetBounds()
 {
-    ThrowIfDisposed();
-
     const awt::Point aLocation (GetRelativeLocation());
     const awt::Size aSize (GetSize());
 
     return awt::Rectangle (aLocation.X, aLocation.Y, aSize.Width, 
aSize.Height);
 }
 
-awt::Point SAL_CALL AccessibleObject::getLocation()
-{
-    ThrowIfDisposed();
-
-    const awt::Point aLocation (GetRelativeLocation());
-
-    return aLocation;
-}
-
-awt::Point SAL_CALL AccessibleObject::getLocationOnScreen()
-{
-    ThrowIfDisposed();
-
-    awt::Point aRelativeLocation (GetRelativeLocation());
-    awt::Point aParentLocationOnScreen (GetAbsoluteParentLocation());
-
-    return awt::Point(
-        aRelativeLocation.X + aParentLocationOnScreen.X,
-        aRelativeLocation.Y + aParentLocationOnScreen.Y);
-}
-
-awt::Size SAL_CALL AccessibleObject::getSize()
-{
-    ThrowIfDisposed();
-
-    const awt::Size aSize (GetSize());
-
-    return aSize;
-}
-
 void SAL_CALL AccessibleObject::grabFocus()
 {
     ThrowIfDisposed();
@@ -282,39 +234,6 @@ sal_Int32 SAL_CALL AccessibleObject::getBackground()
     return 0x00000000;
 }
 
-//----- XAccessibleEventBroadcaster -------------------------------------------
-
-void SAL_CALL AccessibleObject::addAccessibleEventListener (
-    const Reference<XAccessibleEventListener>& rxListener)
-{
-    if (!rxListener.is())
-        return;
-
-    const osl::MutexGuard aGuard(m_aMutex);
-
-    if (rBHelper.bDisposed || rBHelper.bInDispose)
-    {
-        uno::Reference<uno::XInterface> xThis (static_cast<XWeak*>(this), 
UNO_QUERY);
-        rxListener->disposing (lang::EventObject(xThis));
-    }
-    else
-    {
-        maListeners.push_back(rxListener);
-    }
-}
-
-void SAL_CALL AccessibleObject::removeAccessibleEventListener (
-    const Reference<XAccessibleEventListener>& rxListener)
-{
-    ThrowIfDisposed();
-    if (rxListener.is())
-    {
-        const osl::MutexGuard aGuard(m_aMutex);
-
-        std::erase(maListeners, rxListener);
-    }
-}
-
 //----- XWindowListener ---------------------------------------------------
 
 void SAL_CALL AccessibleObject::windowResized (
@@ -451,32 +370,7 @@ void AccessibleObject::FireAccessibleEvent (
     const uno::Any& rOldValue,
     const uno::Any& rNewValue )
 {
-    AccessibleEventObject aEventObject;
-
-    aEventObject.Source = Reference<XWeak>(this);
-    aEventObject.EventId = nEventId;
-    aEventObject.NewValue = rNewValue;
-    aEventObject.OldValue = rOldValue;
-
-    ::std::vector<Reference<XAccessibleEventListener> > 
aListenerCopy(maListeners);
-    for (const auto& rxListener : aListenerCopy)
-    {
-        try
-        {
-            rxListener->notifyEvent(aEventObject);
-        }
-        catch (const lang::DisposedException&)
-        {
-            // Listener has been disposed and should have been removed
-            // already.
-            removeAccessibleEventListener(rxListener);
-        }
-        catch (const Exception&)
-        {
-            // Ignore all other exceptions and assume that they are
-            // caused by a temporary problem.
-        }
-    }
+    NotifyAccessibleEvent(nEventId, rOldValue, rNewValue);
 }
 
 awt::Point AccessibleObject::GetRelativeLocation()
@@ -508,17 +402,6 @@ awt::Size AccessibleObject::GetSize()
         return awt::Size();
 }
 
-awt::Point AccessibleObject::GetAbsoluteParentLocation()
-{
-    Reference<XAccessibleComponent> xParentComponent;
-    if (mxParentAccessible.is())
-        xParentComponent.set( mxParentAccessible->getAccessibleContext(), 
UNO_QUERY);
-    if (xParentComponent.is())
-        return xParentComponent->getLocationOnScreen();
-    else
-        return awt::Point();
-}
-
 void AccessibleObject::ThrowIfDisposed() const
 {
     if (rBHelper.bDisposed || rBHelper.bInDispose)
diff --git a/sd/source/console/AccessibleObject.hxx 
b/sd/source/console/AccessibleObject.hxx
index 62d4c2b23874..121d2cf87d47 100644
--- a/sd/source/console/AccessibleObject.hxx
+++ b/sd/source/console/AccessibleObject.hxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
 #include <com/sun/star/awt/XWindow2.hpp>
 #include <com/sun/star/awt/XWindowListener.hpp>
+#include <comphelper/accessiblecomponenthelper.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/implbase.hxx>
@@ -36,19 +37,9 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 using namespace ::com::sun::star::uno;
 
-namespace {
-    typedef ::cppu::WeakComponentImplHelper <
-        css::accessibility::XAccessible,
-        css::accessibility::XAccessibleContext,
-        css::accessibility::XAccessibleComponent,
-        css::accessibility::XAccessibleEventBroadcaster,
-        css::awt::XWindowListener
-    > AccessibleObjectInterfaceBase;
-}
-
 class AccessibleObject
-    : public ::cppu::BaseMutex,
-      public AccessibleObjectInterfaceBase
+    : public 
cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,
+                                         css::accessibility::XAccessible, 
css::awt::XWindowListener>
 {
 public:
     AccessibleObject(const sal_Int16 nRole, OUString sName);
@@ -105,35 +96,16 @@ public:
 
     //-----  XAccessibleComponent  --------------------------------------------
 
-    virtual sal_Bool SAL_CALL containsPoint (
-        const css::awt::Point& aPoint) override;
-
     virtual css::uno::Reference<css::accessibility::XAccessible> SAL_CALL
         getAccessibleAtPoint (
             const css::awt::Point& aPoint) override;
 
-    virtual css::awt::Rectangle SAL_CALL getBounds() override;
-
-    virtual css::awt::Point SAL_CALL getLocation() override;
-
-    virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
-
-    virtual css::awt::Size SAL_CALL getSize() override;
-
     virtual void SAL_CALL grabFocus() override;
 
     virtual sal_Int32 SAL_CALL getForeground() override;
 
     virtual sal_Int32 SAL_CALL getBackground() override;
 
-    //-----  XAccessibleEventBroadcaster --------------------------------------
-
-    virtual void SAL_CALL addAccessibleEventListener (
-            const 
css::uno::Reference<css::accessibility::XAccessibleEventListener>& rxListener) 
override;
-
-    virtual void SAL_CALL removeAccessibleEventListener (
-            const 
css::uno::Reference<css::accessibility::XAccessibleEventListener>& rxListener) 
override;
-
     //----- XWindowListener ---------------------------------------------------
 
     virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) 
override;
@@ -157,11 +129,12 @@ protected:
     bool mbIsFocused;
     css::uno::Reference<css::accessibility::XAccessible> mxParentAccessible;
     ::std::vector<rtl::Reference<AccessibleObject> > maChildren;
-    ::std::vector<Reference<XAccessibleEventListener> > maListeners;
+
+    // OCommonAccessibleComponent
+    virtual css::awt::Rectangle implGetBounds() override;
 
     virtual awt::Point GetRelativeLocation();
     virtual awt::Size GetSize();
-    awt::Point GetAbsoluteParentLocation();
 
     virtual bool GetWindowState (const sal_Int64 nType) const;
 

Reply via email to