accessibility/source/standard/vclxaccessiblebox.cxx |    3 ++-
 svx/source/accessibility/AccessibleTextHelper.cxx   |   15 +++++----------
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 0b3158e64e70a53528155eee38c2ea0ba1d3bf93
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Feb 15 10:14:51 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Feb 16 09:10:19 2024 +0100

    svx a11y: Drop AccessibleTextHelper_Impl::GotPropertyEvent
    
    Use `AccessibleTextHelper_Impl::FireEvent` directly instead,
    which is in my opinion more readable, in particular since
    2 of the 3 uses were sending an `AccessibleEventId::CHILD`
    event, which is not really about any property.
    
    Change-Id: I446d2d7a841397b215bf099528920bcc6ee9f227
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163428
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx 
b/svx/source/accessibility/AccessibleTextHelper.cxx
index e87232a4f6df..8dddb606876d 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -159,9 +159,6 @@ namespace accessibility
         // Process event queue
         void ProcessQueue();
 
-        // syntactic sugar for FireEvent
-        void GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 
nEventId ) const { FireEvent( nEventId, rNewValue ); }
-
         // shutdown usage of current edit source on myself and the children.
         void ShutdownEditSource();
 
@@ -407,7 +404,7 @@ namespace accessibility
             {
                 AccessibleCell* pAccessibleCell = dynamic_cast< 
AccessibleCell* > ( mxFrontEnd.get() );
                 if ( !pAccessibleCell )
-                    GotPropertyEvent( uno::Any(AccessibleStateType::FOCUSED), 
AccessibleEventId::STATE_CHANGED );
+                    FireEvent(AccessibleEventId::STATE_CHANGED, 
uno::Any(AccessibleStateType::FOCUSED));
                 else    // the focus event on cell should be fired on table 
directly
                 {
                     AccessibleTableShape* pAccTable = 
pAccessibleCell->GetParentTable();
@@ -768,9 +765,8 @@ namespace accessibility
                     // child not yet created?
                     if (!maParaManager.HasCreatedChild(nCurrPara))
                     {
-                        GotPropertyEvent( uno::Any( maParaManager.CreateChild( 
nCurrPara - mnFirstVisibleChild,
-                                                                               
    mxFrontEnd, GetEditSource(), nCurrPara ).first ),
-                                          AccessibleEventId::CHILD );
+                        FireEvent(AccessibleEventId::CHILD, 
uno::Any(maParaManager.CreateChild(nCurrPara - mnFirstVisibleChild,
+                                                                               
                mxFrontEnd, GetEditSource(), nCurrPara).first));
                     }
                 }
             }
@@ -1054,9 +1050,8 @@ namespace accessibility
                 // #109864# Enforce creation of this paragraph
                 try
                 {
-                    GotPropertyEvent( uno::Any( getAccessibleChild( 
aFunctor.GetParaIndex() -
-                                                                        
mnFirstVisibleChild + GetStartIndex() ) ),
-                                      AccessibleEventId::CHILD );
+                    FireEvent(AccessibleEventId::CHILD, 
uno::Any(getAccessibleChild(aFunctor.GetParaIndex() -
+                                                                               
     mnFirstVisibleChild + GetStartIndex())));
                 }
                 catch( const uno::Exception& )
                 {
commit 694670e13143f41e211dd0e183516d08008dd12b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Feb 15 09:43:54 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Feb 16 09:10:10 2024 +0100

    tdf#159213 a11y: Only send child event if there's a child
    
    When reviewing all the places sending an `AccessibleEventId::CHILD`
    event as described in tdf#159213 comment 8, this here looks
    like one where the child might not be set.
    Add a corresponding check to avoid sending an invalid event.
    
    Change-Id: I6fea72e8a0619eeec7ac7c9d38dec996ab34752f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163427
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx 
b/accessibility/source/standard/vclxaccessiblebox.cxx
index 84855ca096cf..93e49f90c285 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -70,7 +70,8 @@ void VCLXAccessibleBox::ProcessWindowChildEvent( const 
VclWindowEvent& rVclWindo
             if (m_aBoxType==COMBOBOX)
             {
                 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
-                if (pComboBox && pChildWindow && pChildWindow == 
pComboBox->GetSubEdit())
+                if (pComboBox && pChildWindow && pChildWindow == 
pComboBox->GetSubEdit()
+                    && m_xText.is())
                 {
                     if (rVclWindowEvent.GetId() == VclEventId::WindowShow)
                     {

Reply via email to