starmath/source/accessibility.cxx      |   11 ++---------
 sw/source/core/access/acccontext.cxx   |    6 ++----
 sw/source/core/access/accframebase.cxx |    7 ++-----
 3 files changed, 6 insertions(+), 18 deletions(-)

New commits:
commit 8c098f1ba9b070c388affb44a6d37d07e894f39f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 12 14:40:04 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Feb 12 20:05:27 2025 +0100

    math a11y: Simplify SmGraphicAccessible::getBounds
    
    `aOutPos` is a default-constructed Point.
    Simply use 0 for x and y coordinate directly instead.
    
    Change-Id: I52d0d3648558c6f0fc0b43b4ab5710952dfe7cb5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181495
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/starmath/source/accessibility.cxx 
b/starmath/source/accessibility.cxx
index fc6c76b8f56f..dffd973a8309 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -139,16 +139,9 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getBounds()
     if (!pWin)
         throw RuntimeException();
 
-    const Point aOutPos;
     const Size aOutSize(pWin->GetOutputSizePixel());
-    css::awt::Rectangle aRet;
 
-    aRet.X = aOutPos.X();
-    aRet.Y = aOutPos.Y();
-    aRet.Width = aOutSize.Width();
-    aRet.Height = aOutSize.Height();
-
-    return aRet;
+    return css::awt::Rectangle(0, 0, aOutSize.Width(), aOutSize.Height());
 }
 
 awt::Point SAL_CALL SmGraphicAccessible::getLocation()
commit d20636b53db08f07af224dc54c61ed93b242000a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 12 14:21:55 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Feb 12 20:05:21 2025 +0100

    math a11y: OSL_ENSURE -> assert
    
    Change-Id: If4eaf8f7805289eea8b67df435014bd25db7fb46
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181494
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/starmath/source/accessibility.cxx 
b/starmath/source/accessibility.cxx
index c6abfaed1743..fc6c76b8f56f 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -56,7 +56,7 @@ SmGraphicAccessible::SmGraphicAccessible(SmGraphicWidget 
*pGraphicWin) :
     nClientId           (0),
     pWin                (pGraphicWin)
 {
-    OSL_ENSURE( pWin, "SmGraphicAccessible: window missing" );
+    assert(pWin && "SmGraphicAccessible: window missing");
 }
 
 SmGraphicAccessible::~SmGraphicAccessible()
commit 2cc01e22610df1ebee2c1dad8c4339621c83b171
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 12 14:15:30 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Feb 12 20:05:15 2025 +0100

    sw a11y: Avoid unnecessary casting
    
    Change-Id: Iebfef08d6de9c2e9b0f7bab56e84e6397cfe33db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181493
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/acccontext.cxx 
b/sw/source/core/access/acccontext.cxx
index 4cc01fd286be..d7430e31dbaa 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -1077,19 +1077,17 @@ void SwAccessibleContext::Dispose(bool bRecursive, bool 
bCanSkipInvisible)
         DisposeChildren(GetFrame(), bRecursive, bCanSkipInvisible);
 
     // get parent
-    uno::Reference< XAccessible > xParent( GetWeakParent() );
+    rtl::Reference<SwAccessibleContext> xParent(GetWeakParent());
     uno::Reference < XAccessibleContext > xThis( this );
 
     // send child event at parent
     if( xParent.is() )
     {
-        SwAccessibleContext *pAcc = static_cast<SwAccessibleContext 
*>(xParent.get());
-
         AccessibleEventObject aEvent;
         aEvent.EventId = AccessibleEventId::CHILD;
         aEvent.OldValue <<= xThis;
         aEvent.IndexHint = -1;
-        pAcc->FireAccessibleEvent( aEvent );
+        xParent->FireAccessibleEvent(aEvent);
     }
 
     // set defunc state (it's not required to broadcast a state changed
diff --git a/sw/source/core/access/accframebase.cxx 
b/sw/source/core/access/accframebase.cxx
index f6ef4ff0a783..f47c163bb1a6 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -163,17 +163,14 @@ void SwAccessibleFrameBase::InvalidateCursorPos_()
     if(!bNewSelected)
         return;
 
-    uno::Reference< XAccessible > xParent( GetWeakParent() );
+    rtl::Reference<SwAccessibleContext> xParent(GetWeakParent());
     if( xParent.is() )
     {
-        SwAccessibleContext *pAcc =
-            static_cast <SwAccessibleContext *>( xParent.get() );
-
         AccessibleEventObject aEvent;
         aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
         uno::Reference< XAccessible > xChild(this);
         aEvent.NewValue <<= xChild;
-        pAcc->FireAccessibleEvent( aEvent );
+        xParent->FireAccessibleEvent( aEvent );
     }
 }
 

Reply via email to