sw/source/core/access/acccontext.cxx |   17 ++++++-----------
 sw/source/core/access/acccontext.hxx |    2 --
 2 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 1dad4202994b06b7d133f855e6d8a583f28abfb1
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Apr 24 21:46:38 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 25 07:42:22 2025 +0200

    sw a11y: no need to have a separate method for this
    
    It's called only from one place
    Also drop the check for GetMap(), pMap comes from
    shared_from_this(), so it won't be nullptr
    
    Change-Id: Ibc6805995b32c9868e1149f2dbb06a5e0718d973
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184594
    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 73dc8e506536..df10a2b256ee 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -51,16 +51,6 @@ using namespace sw::access;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 
-void SwAccessibleContext::InitStates()
-{
-    m_isShowingState = GetMap() && IsShowing( *(GetMap()) );
-
-    SwViewShell& rVSh = GetMap()->GetShell();
-    m_isEditableState = IsEditable(rVSh);
-    m_isOpaqueState = IsOpaque(rVSh);
-    m_isDefuncState = false;
-}
-
 void SwAccessibleContext::SetParent( SwAccessibleContext *pParent )
 {
     std::scoped_lock aGuard( m_Mutex );
@@ -526,7 +516,12 @@ 
SwAccessibleContext::SwAccessibleContext(std::shared_ptr<SwAccessibleMap> const&
     , m_isRegisteredAtAccessibleMap( true )
     , m_isSelectedInDoc(false)
 {
-    InitStates();
+    m_isShowingState = IsShowing( *(GetMap()) );
+
+    SwViewShell& rVSh = GetMap()->GetShell();
+    m_isEditableState = IsEditable(rVSh);
+    m_isOpaqueState = IsOpaque(rVSh);
+    m_isDefuncState = false;
 }
 
 SwAccessibleContext::~SwAccessibleContext()
diff --git a/sw/source/core/access/acccontext.hxx 
b/sw/source/core/access/acccontext.hxx
index 814a4e6d8a8b..9a08540ac3a8 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -91,8 +91,6 @@ private:
     // in general registered at the accessible map.
     bool m_isRegisteredAtAccessibleMap;
 
-    void InitStates();
-
 protected:
     void SetName( const OUString& rName ) { m_sName = rName; }
     sal_Int16 GetRole() const

Reply via email to