svx/source/inc/findtextfield.hxx                   |    3 ++-
 svx/source/tbxctrls/tbunosearchcontrollers.cxx     |    3 +--
 vcl/source/accessibility/vclxaccessibletoolbox.cxx |    1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 57cb96439adc022768fb279f2d2ab33a392a9f80
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 28 19:41:21 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Feb 28 22:10:57 2025 +0100

    tdf#163989 toolbar item window a11y: Leave wrapped accessible in place
    
    OToolBoxWindowItem wraps the accessible for toolbar item
    windows using OAccessibleWrapper as its base class.
    
    In addition to setting that wrapper,
    VCLXAccessibleToolBox::getAccessibleChild was so far
    also setting the wrapper as the new accesible for
    the item window, i.e. the wrapper was now somewhat
    replacing the accessible it was meant to wrap.
    
    This e.g. broke the logic to get the proper accessible
    child index for a panel in the Find toolbar in Writer
    when using the qt6 VCL plugin.
    
    This could e.g. be seen using in a similar way to the
    approach/observations described for gtk3 in tdf#163989
    comment 1:
    
    1) start LO Writer using the qt6 VCL plugin
    2) in Accerciser, enable event monitoring for LO
       object:text-caret-moved events
    3) start Orca (to trigger creation of accessible objects
       in LO)
    4) Press Ctrl+F to enable the search toolbar
    5) type, move cursor
    6) In Accerciser's Event Monitor, identify a corresponding
       "object:text-caret-moved" event
    7) click on the event source
    
    -> First issue: The object is not highlighted in Accerciser's
    treeview of the LO a11y.
    
    8) print the a11y hierarchy of the object bottom-up (i.e.
       from the object to the desktop) using Accerciser's IPython
       console:
    
        In [2]: obj = acc
        In [3]: while obj:
        In [3]:     print(f'object: {obj}, index in parent: 
{obj.get_index_in_parent()}')
        In [3]:     obj = obj.parent
        In [3]:
        object: [text | eeee], index in parent: 0
        object: [combo box | eeee], index in parent: 0
        object: [filler | ], index in parent: 0
    ->  object: [filler | ], index in parent: -1
        object: [panel | ], index in parent: 0
        object: [panel | Find Values], index in parent: 1
        object: [tool bar | Find], index in parent: 0
        object: [panel | ], index in parent: 5
        object: [panel | Untitled 1 — LibreOfficeDev Writer 25.8 
[fbdfde26391730216bae230cd6f228a6ae6ee89c]], index in parent: 0
        object: [panel | Untitled 1 — LibreOfficeDev Writer 25.8 
[fbdfde26391730216bae230cd6f228a6ae6ee89c]], index in parent: 0
        object: [frame | Untitled 1 — LibreOfficeDev Writer 25.8 
[fbdfde26391730216bae230cd6f228a6ae6ee89c]], index in parent: 0
        object: [application | soffice.bin], index in parent: -1
        object: [desktop frame | main], index in parent: -1
    
    Second issue (which is cause for the first one):
    There is a filler with invalid child index -1 in
    the path (highlighted by an arrow above).
    
    With this fix in place, both issues no longer appear, but
    the combobox's text entry is correctly selected in Accerciser's
    treeview and the child index is correct:
    
        In [6]: obj = acc
        In [7]: while obj:
        In [7]:     print(f'object: {obj}, index in parent: 
{obj.get_index_in_parent()}')
        In [7]:     obj = obj.parent
        In [7]:
        object: [text | eee], index in parent: 0
        object: [combo box | eee], index in parent: 0
        object: [filler | ], index in parent: 0
    ->  object: [filler | ], index in parent: 0
        object: [panel | ], index in parent: 0
        object: [panel | Find Values], index in parent: 1
        object: [tool bar | Find], index in parent: 0
        object: [panel | ], index in parent: 5
        object: [panel | Untitled 1 — LibreOfficeDev Writer 25.8 
[89cb9707f45fdf2e00c1670701a5abc393f0c13d]], index in parent: 0
        object: [panel | Untitled 1 — LibreOfficeDev Writer 25.8 
[89cb9707f45fdf2e00c1670701a5abc393f0c13d]], index in parent: 0
        object: [frame | Untitled 1 — LibreOfficeDev Writer 25.8 
[89cb9707f45fdf2e00c1670701a5abc393f0c13d]], index in parent: 0
        object: [application | soffice.bin], index in parent: -1
        object: [desktop frame | main], index in parent: -1
    
    For gtk3, the issue described in tdf#163989 18 comment 1
    remains however and will have to be addressed separately.
    
    Change-Id: Ie16b34caf1df70c25a4b2a52eaeb22ff0ab3d9e1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182371
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/accessibility/vclxaccessibletoolbox.cxx 
b/vcl/source/accessibility/vclxaccessibletoolbox.cxx
index 91203cdcdc5e..fad082e52a06 100644
--- a/vcl/source/accessibility/vclxaccessibletoolbox.cxx
+++ b/vcl/source/accessibility/vclxaccessibletoolbox.cxx
@@ -633,7 +633,6 @@ Reference< XAccessible > SAL_CALL 
VCLXAccessibleToolBox::getAccessibleChild( sal
             {
                 rtl::Reference<OToolBoxWindowItem> xChild2(new 
OToolBoxWindowItem(0,
                     ::comphelper::getProcessComponentContext(), xInnerAcc, 
xParent));
-                pItemWindow->SetAccessible(xChild2);
                 xChild->SetChild( xChild2 );
             }
         }
commit 98df0c4bd3c440299bb21650f0e6e53bb169f8ae
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 28 18:02:46 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Feb 28 22:10:51 2025 +0100

    svx: Switch FindTextFieldControl parent param to ToolBox
    
    ... instead of the more generic vcl::Window.
    This makes it clearer that the parent always has to
    be a ToolBox.
    
    This is already assumed elsehwere, e.g. in
    FindTextFieldControl::ActivateFind, where a
    a static_cast<ToolBox*> is done.
    
    Change-Id: Id0c54b466ea7fc59c566e6eef6d8601281578d51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182370
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx
index 2c79a529b3f4..90ecf80bab93 100644
--- a/svx/source/inc/findtextfield.hxx
+++ b/svx/source/inc/findtextfield.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include <vcl/InterimItemWindow.hxx>
+#include <vcl/toolbox.hxx>
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
@@ -31,7 +32,7 @@ class AcceleratorExecute;
 class FindTextFieldControl final : public InterimItemWindow
 {
 public:
-    FindTextFieldControl(vcl::Window* pParent, 
css::uno::Reference<css::frame::XFrame> xFrame,
+    FindTextFieldControl(ToolBox* pParent, 
css::uno::Reference<css::frame::XFrame> xFrame,
                          css::uno::Reference<css::uno::XComponentContext> 
xContext);
 
     virtual void dispose() override;
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index aeaa7f724185..b385b976d4b8 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -56,7 +56,6 @@
 #include <svtools/acceleratorexecute.hxx>
 #include <svtools/toolboxcontroller.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/toolbox.hxx>
 #include <vcl/svapp.hxx>
 #include <svx/labelitemwindow.hxx>
 #include <svx/srchdlg.hxx>
@@ -195,7 +194,7 @@ void impl_executeSearch( const css::uno::Reference< 
css::uno::XComponentContext
 // tdf#154818 - remember last search string
 OUString FindTextFieldControl::m_sRememberedSearchString;
 
-FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent,
+FindTextFieldControl::FindTextFieldControl(ToolBox* pParent,
     css::uno::Reference< css::frame::XFrame > xFrame,
     css::uno::Reference< css::uno::XComponentContext > xContext) :
     InterimItemWindow(pParent, u"svx/ui/findbox.ui"_ustr, u"FindBox"_ustr),

Reply via email to