sw/source/core/access/accfrmobj.cxx |   29 ++++++++++-------------------
 sw/source/core/access/accfrmobj.hxx |    1 +
 2 files changed, 11 insertions(+), 19 deletions(-)

New commits:
commit 33543763b522b8b03114cd8e2877b3c660853f89
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 24 14:01:03 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 25 07:31:19 2025 +0200

    sw a11y: Simplify SwAccessibleChild::IsAccessible
    
    Change-Id: I34a9190fe38d2b571773b64d1922ba19997aa567
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184580
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/accfrmobj.cxx 
b/sw/source/core/access/accfrmobj.cxx
index 48526439fb5d..044d2451b450 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -129,22 +129,10 @@ bool SwAccessibleChild::IsFrameAccessible(const SwFrame& 
rFrame, bool bPagePrevi
 
 bool SwAccessibleChild::IsAccessible( bool bPagePreview ) const
 {
-    bool bRet( false );
-
     if ( mpFrame )
-    {
-        bRet = IsFrameAccessible(*mpFrame, bPagePreview);
-    }
-    else if ( mpDrawObj )
-    {
-        bRet = true;
-    }
-    else if ( mpWindow )
-    {
-        bRet = true;
-    }
+        return IsFrameAccessible(*mpFrame, bPagePreview);
 
-    return bRet;
+    return mpDrawObj || mpWindow;
 }
 
 bool SwAccessibleChild::IsBoundAsChar() const
commit 2ab3e0053abb8066876001c1b3fa644f5f7839c1
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 24 13:58:45 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 25 07:31:11 2025 +0200

    sw a11y: Extract static helper SwAccessibleChild::IsFrameAccessible
    
    This will be reused from
    SwAccessibleMap::InvalidateCursorPosition in an
    upcoming commit.
    
    Change-Id: Ic5c39cd7f7cb27a027adc6eeb7c77b1b6c4b5cba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184579
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/accfrmobj.cxx 
b/sw/source/core/access/accfrmobj.cxx
index 24382681ed38..48526439fb5d 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -119,18 +119,21 @@ void SwAccessibleChild::Init( vcl::Window* pWindow )
     mpDrawObj = nullptr;
 }
 
+bool SwAccessibleChild::IsFrameAccessible(const SwFrame& rFrame, bool 
bPagePreview)
+{
+    return rFrame.IsAccessibleFrame()
+           && (!rFrame.IsCellFrame()
+               || static_cast<const 
SwCellFrame&>(rFrame).GetTabBox()->GetSttNd() != nullptr)
+           && !rFrame.IsInCoveredCell() && (bPagePreview || 
!rFrame.IsPageFrame());
+}
+
 bool SwAccessibleChild::IsAccessible( bool bPagePreview ) const
 {
     bool bRet( false );
 
     if ( mpFrame )
     {
-        bRet = mpFrame->IsAccessibleFrame() &&
-               ( !mpFrame->IsCellFrame() ||
-                 static_cast<const SwCellFrame *>( mpFrame 
)->GetTabBox()->GetSttNd() != nullptr ) &&
-               !mpFrame->IsInCoveredCell() &&
-               ( bPagePreview ||
-                 !mpFrame->IsPageFrame() );
+        bRet = IsFrameAccessible(*mpFrame, bPagePreview);
     }
     else if ( mpDrawObj )
     {
diff --git a/sw/source/core/access/accfrmobj.hxx 
b/sw/source/core/access/accfrmobj.hxx
index 5e2cc36f87b3..5b76a79ed3cb 100644
--- a/sw/source/core/access/accfrmobj.hxx
+++ b/sw/source/core/access/accfrmobj.hxx
@@ -66,6 +66,7 @@ class SwAccessibleChild
 
         const SwFrame* GetParent( const bool bInPagePreview ) const;
 
+        static bool IsFrameAccessible(const SwFrame& rFrame, bool 
bPagePreview);
         bool IsAccessible( bool bPagePreview ) const;
         bool IsBoundAsChar() const;
 

Reply via email to