winaccessibility/inc/AccObject.hxx            |    2 +-
 winaccessibility/source/service/AccObject.cxx |   18 +++++-------------
 2 files changed, 6 insertions(+), 14 deletions(-)

New commits:
commit ecae424190e0d07316eb5cb6e62f86356750a5fc
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Sep 30 12:34:51 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Sep 30 21:40:05 2024 +0200

    wina11y: Simplify AccObject::GetExpandedState
    
    * Drop the `isExpandable` out param that's unused
      at the only call site.
    * Use a bool return value instead of an out param
      for the remaining `isExpandable`.
    
    Change-Id: I2a37f0fec752f5e8e802ec781acf49035b3fbf2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174273
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/inc/AccObject.hxx 
b/winaccessibility/inc/AccObject.hxx
index 5c92f6de9edb..e0ce518b0506 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -62,7 +62,7 @@ private:
 
     DWORD GetMSAAStateFromUNO(sal_Int64 xState);//translate state from UNO to 
MSAA value
     css::accessibility::XAccessibleSelection* GetXAccessibleSelection();
-    void GetExpandedState(bool* isExpandable, bool* isExpanded);
+    bool GetExpandedState();
     static OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
 
 public:
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 5bd3419a00a3..01382ca94fbb 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -526,12 +526,10 @@ DWORD AccObject::GetMSAAStateFromUNO(sal_Int64 nState)
         return STATE_SYSTEM_FOCUSED;
     case AccessibleStateType::EXPANDABLE:
         {
-            bool isExpanded = true;
-            bool isExpandable = true;
             if (m_accRole == PUSH_BUTTON || m_accRole == TOGGLE_BUTTON  || 
m_accRole == BUTTON_DROPDOWN)
                 return STATE_SYSTEM_HASPOPUP;
 
-            GetExpandedState(&isExpandable,&isExpanded);
+            const bool isExpanded = GetExpandedState();
             if(!isExpanded)
                 return STATE_SYSTEM_COLLAPSED;
 
@@ -853,21 +851,15 @@ void AccObject::unsetFocus()
     m_pIMAcc->Put_XAccFocus(UACC_NO_FOCUS);
 }
 
-void AccObject::GetExpandedState(bool* isExpandable, bool* isExpanded)
+bool AccObject::GetExpandedState()
 {
-    *isExpanded = false;
-    *isExpandable = false;
-
     if( !m_xAccContextRef.is() )
     {
-        return;
+        return false;
     }
-    sal_Int64 nRState = m_xAccContextRef->getAccessibleStateSet();
 
-    if (nRState & AccessibleStateType::EXPANDED)
-        *isExpanded = true;
-    if (nRState & AccessibleStateType::EXPANDABLE)
-        *isExpandable = true;
+    sal_Int64 nRState = m_xAccContextRef->getAccessibleStateSet();
+    return (nRState & AccessibleStateType::EXPANDED);
 }
 
 void AccObject::NotifyDestroy() { m_pIMAcc->NotifyDestroy(); }
commit 347fe07246fcd8f844edf43dc9ce973e4e0a15a8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Sep 30 12:31:03 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Sep 30 21:39:54 2024 +0200

    wina11y: sal_Bool -> bool
    
    Change-Id: I348e293981bbaeec650a463c958c5e301a804422
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174272
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/inc/AccObject.hxx 
b/winaccessibility/inc/AccObject.hxx
index 62a4cb67ca1a..5c92f6de9edb 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -62,7 +62,7 @@ private:
 
     DWORD GetMSAAStateFromUNO(sal_Int64 xState);//translate state from UNO to 
MSAA value
     css::accessibility::XAccessibleSelection* GetXAccessibleSelection();
-    void GetExpandedState(sal_Bool* isExpandable, sal_Bool* isExpanded);
+    void GetExpandedState(bool* isExpandable, bool* isExpanded);
     static OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
 
 public:
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 822c5c58db08..5bd3419a00a3 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -526,8 +526,8 @@ DWORD AccObject::GetMSAAStateFromUNO(sal_Int64 nState)
         return STATE_SYSTEM_FOCUSED;
     case AccessibleStateType::EXPANDABLE:
         {
-            sal_Bool isExpanded = true;
-            sal_Bool isExpandable = true;
+            bool isExpanded = true;
+            bool isExpandable = true;
             if (m_accRole == PUSH_BUTTON || m_accRole == TOGGLE_BUTTON  || 
m_accRole == BUTTON_DROPDOWN)
                 return STATE_SYSTEM_HASPOPUP;
 
@@ -853,7 +853,7 @@ void AccObject::unsetFocus()
     m_pIMAcc->Put_XAccFocus(UACC_NO_FOCUS);
 }
 
-void AccObject::GetExpandedState( sal_Bool* isExpandable, sal_Bool* isExpanded)
+void AccObject::GetExpandedState(bool* isExpandable, bool* isExpanded)
 {
     *isExpanded = false;
     *isExpandable = false;

Reply via email to