include/vcl/uitest/uiobject.hxx       |   30 --------------
 sw/qa/uitest/table/tdf146145.py       |   22 +++++-----
 vcl/Library_vcl.mk                    |    1 
 vcl/inc/uitest/toolboxuiobject.hxx    |   37 +++++++++++++++++
 vcl/source/uitest/toolboxuiobject.cxx |   71 ++++++++++++++++++++++++++++++++++
 vcl/source/uitest/uiobject.cxx        |   64 ------------------------------
 vcl/source/window/toolbox2.cxx        |    1 
 7 files changed, 122 insertions(+), 104 deletions(-)

New commits:
commit bc06f26b79e9b3b0d7ed10303dbaa4f4d4d970c5
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat May 24 00:16:13 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed May 28 09:19:22 2025 +0200

    sw uitest: Use 4 spaces for one indentation level
    
    ... instead of 3 in some lines.
    
    Change-Id: Ib2cb0db9b5f00ecfb493f26beaa751ef3554052f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185767
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/qa/uitest/table/tdf146145.py b/sw/qa/uitest/table/tdf146145.py
index d34e9e256ab8..8a7eabf2b5bb 100644
--- a/sw/qa/uitest/table/tdf146145.py
+++ b/sw/qa/uitest/table/tdf146145.py
@@ -15,17 +15,17 @@ from com.sun.star.accessibility.AccessibleStateType import 
ENABLED
 
 class tdf146145(UITestCase):
 
-   # access to the private:resource changes toolbar via accessibility API
-   def is_enabled_Accept_Track_Change(self):
-       xFrame = self.document.getCurrentController().getFrame()
+    # access to the private:resource changes toolbar via accessibility API
+    def is_enabled_Accept_Track_Change(self):
+        xFrame = self.document.getCurrentController().getFrame()
 
-       for i in xFrame.getPropertyValue("LayoutManager").getElements():
-           if i.getPropertyValue('ResourceURL') == 
'private:resource/toolbar/changes':
-               return (ENABLED & 
i.getRealInterface().getAccessibleContext().getAccessibleChild(5).getAccessibleStateSet())
 == ENABLED
+        for i in xFrame.getPropertyValue("LayoutManager").getElements():
+            if i.getPropertyValue('ResourceURL') == 
'private:resource/toolbar/changes':
+                return (ENABLED & 
i.getRealInterface().getAccessibleContext().getAccessibleChild(5).getAccessibleStateSet())
 == ENABLED
 
-       return False
+        return False
 
-   def test_tdf146145(self):
+    def test_tdf146145(self):
         with 
self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as 
self.document:
 
             # Check enabling Accept/Reject Track Change icons
@@ -107,7 +107,7 @@ class tdf146145(UITestCase):
             xToolkit.processEventsToIdle()
             self.assertEqual(len(tables[0].getRows()), 3)
 
-   def test_Related_tdf147182(self):
+    def test_Related_tdf147182(self):
         with 
self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as 
self.document:
 
             # Check enabling Accept/Reject Track Change icons
@@ -154,7 +154,7 @@ class tdf146145(UITestCase):
             # disabled Accept Track Change
             self.assertFalse(self.is_enabled_Accept_Track_Change())
 
-   def test_tdf155344(self):
+    def test_tdf155344(self):
         with 
self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as 
self.document:
 
             # accept all tracked changes
@@ -252,7 +252,7 @@ class tdf146145(UITestCase):
             xToolkit.processEventsToIdle()
             self.assertEqual(len(tables[0].getColumns()), 5)
 
-   def test_crashWithHiddenFirstTableColumn(self):
+    def test_crashWithHiddenFirstTableColumn(self):
         with 
self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as 
self.document:
 
             # accept all tracked changes
commit fd090409b67bb933c4e110e621150e2eaa4b1b3b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri May 23 12:56:55 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed May 28 09:19:17 2025 +0200

    vcl uitest: Move ToolBoxUIObject to own .hxx/.cxx
    
    The new header also doesn't have to be a global
    include/vcl/ header, but can be vcl-internal.
    
    Change-Id: Ib625d4b1815f34860f7b7a5d809d8f32b45fd23f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185766
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index a827afd37b3c..9aedc5a3eeb0 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -39,7 +39,6 @@ class VclExpander;
 class VclDrawingArea;
 class VclMultiLineEdit;
 class MenuButton;
-class ToolBox;
 namespace vcl { class Window; }
 namespace weld { class CustomWidgetController; }
 
@@ -536,30 +535,6 @@ private:
     virtual OUString get_name() const override;
 };
 
-class ToolBoxUIObject final : public WindowUIObject
-{
-private:
-    VclPtr<ToolBox> mxToolBox;
-
-public:
-
-    ToolBoxUIObject(const VclPtr<ToolBox>& mxToolBox);
-    virtual ~ToolBoxUIObject() override;
-
-    virtual void execute(const OUString& rAction,
-            const StringMap& rParameters) override;
-
-    virtual StringMap get_state() override;
-
-    static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
-
-    virtual OUString get_action(VclEventId nEvent) const override;
-
-private:
-
-    virtual OUString get_name() const override;
-};
-
 class MenuButtonUIObject final : public WindowUIObject
 {
     VclPtr<MenuButton> mxMenuButton;
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 3a9e58747d44..1ca6bcac969e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -570,6 +570,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/pdf/Matrix3 \
     vcl/source/pdf/XmpMetadata \
     vcl/source/uitest/logger \
+    vcl/source/uitest/toolboxuiobject \
     vcl/source/uitest/uiobject \
     vcl/source/uitest/uitest \
     vcl/source/uitest/uno/uiobject_uno \
diff --git a/vcl/inc/uitest/toolboxuiobject.hxx 
b/vcl/inc/uitest/toolboxuiobject.hxx
new file mode 100644
index 000000000000..7ab595be1278
--- /dev/null
+++ b/vcl/inc/uitest/toolboxuiobject.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <vcl/uitest/uiobject.hxx>
+
+class ToolBox;
+
+class ToolBoxUIObject final : public WindowUIObject
+{
+private:
+    VclPtr<ToolBox> mxToolBox;
+
+public:
+    ToolBoxUIObject(const VclPtr<ToolBox>& mxToolBox);
+    virtual ~ToolBoxUIObject() override;
+
+    virtual void execute(const OUString& rAction, const StringMap& 
rParameters) override;
+
+    virtual StringMap get_state() override;
+
+    static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
+
+    virtual OUString get_action(VclEventId nEvent) const override;
+
+private:
+    virtual OUString get_name() const override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/uitest/toolboxuiobject.cxx 
b/vcl/source/uitest/toolboxuiobject.cxx
new file mode 100644
index 000000000000..fd7de25727ac
--- /dev/null
+++ b/vcl/source/uitest/toolboxuiobject.cxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <uitest/toolboxuiobject.hxx>
+
+#include <vcl/toolbox.hxx>
+
+ToolBoxUIObject::ToolBoxUIObject(const VclPtr<ToolBox>& xToolBox)
+    : WindowUIObject(xToolBox)
+    , mxToolBox(xToolBox)
+{
+}
+
+ToolBoxUIObject::~ToolBoxUIObject() {}
+
+void ToolBoxUIObject::execute(const OUString& rAction, const StringMap& 
rParameters)
+{
+    if (rAction == "CLICK")
+    {
+        if (rParameters.find(u"POS"_ustr) != rParameters.end())
+        {
+            auto itr = rParameters.find(u"POS"_ustr);
+            sal_uInt16 nPos = itr->second.toUInt32();
+            mxToolBox->SetCurItemId(mxToolBox->GetItemId(nPos));
+            mxToolBox->Click();
+            mxToolBox->Select();
+        }
+    }
+    else
+        WindowUIObject::execute(rAction, rParameters);
+}
+
+OUString ToolBoxUIObject::get_action(VclEventId nEvent) const
+{
+    if (nEvent == VclEventId::ToolboxClick)
+    {
+        return "Click on item number " + 
OUString::number(sal_uInt16(mxToolBox->GetCurItemId()))
+               + " in " + mxToolBox->get_id();
+    }
+    else
+        return WindowUIObject::get_action(nEvent);
+}
+
+StringMap ToolBoxUIObject::get_state()
+{
+    StringMap aMap = WindowUIObject::get_state();
+    ToolBoxItemId nCurItemId = mxToolBox->GetCurItemId();
+    aMap[u"CurrSelectedItemID"_ustr] = 
OUString::number(sal_uInt16(nCurItemId));
+    aMap[u"CurrSelectedItemText"_ustr] = nCurItemId ? 
mxToolBox->GetItemText(nCurItemId) : u""_ustr;
+    aMap[u"CurrSelectedItemCommand"_ustr]
+        = nCurItemId ? mxToolBox->GetItemCommand(nCurItemId) : u""_ustr;
+    aMap[u"ItemCount"_ustr] = OUString::number(mxToolBox->GetItemCount());
+    return aMap;
+}
+
+OUString ToolBoxUIObject::get_name() const { return u"ToolBoxUIObject"_ustr; }
+
+std::unique_ptr<UIObject> ToolBoxUIObject::create(vcl::Window* pWindow)
+{
+    ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
+    assert(pToolBox);
+    return std::unique_ptr<UIObject>(new ToolBoxUIObject(pToolBox));
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index a1b02bb4fe52..d31b5236a454 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -35,7 +35,6 @@
 #include <vcl/uitest/logger.hxx>
 #include <uiobject-internal.hxx>
 #include <verticaltabctrl.hxx>
-#include <vcl/toolbox.hxx>
 
 #include <comphelper/string.hxx>
 #include <comphelper/lok.hxx>
@@ -1668,69 +1667,6 @@ std::unique_ptr<UIObject> 
VerticalTabControlUIObject::create(vcl::Window* pWindo
     return std::unique_ptr<UIObject>(new 
VerticalTabControlUIObject(pTabControl));
 }
 
-
-ToolBoxUIObject::ToolBoxUIObject(const VclPtr<ToolBox>& xToolBox):
-    WindowUIObject(xToolBox),
-    mxToolBox(xToolBox)
-{
-}
-
-ToolBoxUIObject::~ToolBoxUIObject()
-{
-}
-
-void ToolBoxUIObject::execute(const OUString& rAction,
-        const StringMap& rParameters)
-{
-    if (rAction == "CLICK")
-    {
-        if (rParameters.find(u"POS"_ustr) != rParameters.end())
-        {
-            auto itr = rParameters.find(u"POS"_ustr);
-            sal_uInt16 nPos = itr->second.toUInt32();
-            mxToolBox->SetCurItemId(mxToolBox->GetItemId(nPos));
-            mxToolBox->Click();
-            mxToolBox->Select();
-        }
-    }
-    else
-        WindowUIObject::execute(rAction, rParameters);
-}
-
-OUString ToolBoxUIObject::get_action(VclEventId nEvent) const
-{
-    if (nEvent == VclEventId::ToolboxClick)
-    {
-        return "Click on item number " + 
OUString::number(sal_uInt16(mxToolBox->GetCurItemId())) +
-                " in " + mxToolBox->get_id();
-    }
-    else
-        return WindowUIObject::get_action(nEvent);
-}
-
-StringMap ToolBoxUIObject::get_state()
-{
-    StringMap aMap = WindowUIObject::get_state();
-    ToolBoxItemId nCurItemId = mxToolBox->GetCurItemId();
-    aMap[u"CurrSelectedItemID"_ustr] = 
OUString::number(sal_uInt16(nCurItemId));
-    aMap[u"CurrSelectedItemText"_ustr] = nCurItemId ? 
mxToolBox->GetItemText(nCurItemId) : u""_ustr;
-    aMap[u"CurrSelectedItemCommand"_ustr] = nCurItemId ? 
mxToolBox->GetItemCommand(nCurItemId) : u""_ustr;
-    aMap[u"ItemCount"_ustr] = OUString::number(mxToolBox->GetItemCount());
-    return aMap;
-}
-
-OUString ToolBoxUIObject::get_name() const
-{
-    return u"ToolBoxUIObject"_ustr;
-}
-
-std::unique_ptr<UIObject> ToolBoxUIObject::create(vcl::Window* pWindow)
-{
-    ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
-    assert(pToolBox);
-    return std::unique_ptr<UIObject>(new ToolBoxUIObject(pToolBox));
-}
-
 MenuButtonUIObject::MenuButtonUIObject(const VclPtr<MenuButton>& xMenuButton):
     WindowUIObject(xMenuButton),
     mxMenuButton(xMenuButton)
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 5ae142ae7c2d..32e25698f461 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -39,6 +39,7 @@
 #include <vcl/commandinfoprovider.hxx>
 
 #include <svdata.hxx>
+#include <uitest/toolboxuiobject.hxx>
 #include <brdwin.hxx>
 #include <toolbox.h>
 
commit ed51f56035529e00a1ac985c0ccc3fbc90ee7de5
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri May 23 12:46:02 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed May 28 09:19:10 2025 +0200

    vcl uitest: Use #pragma once
    
    Change-Id: I543f280ca3d5b59427aa2d3ba57ea92b19ff8954
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185765
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index 8f1624dc7f7a..a827afd37b3c 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_VCL_UITEST_UIOBJECT_HXX
-#define INCLUDED_VCL_UITEST_UIOBJECT_HXX
+#pragma once
 
 #include <rtl/ustring.hxx>
 #include <map>
@@ -595,6 +594,4 @@ public:
     static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to