[Libreoffice-commits] core.git: Branch 'private/moggi/ui-test' - include/svtools svtools/inc svtools/Library_svt.mk svtools/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Apr 3 00:39:57 UTC 2016


 include/svtools/treelistbox.hxx       |    2 +
 svtools/Library_svt.mk                |    1 
 svtools/inc/uitest/uiobject.hxx       |   30 ++++++++++++++++++++++++
 svtools/source/contnr/treelistbox.cxx |    6 ++++
 svtools/source/uitest/uiobject.cxx    |   41 ++++++++++++++++++++++++++++++++++
 5 files changed, 80 insertions(+)

New commits:
commit 072d0e4413d750624eba230b3c77b467f7f8ae12
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Apr 3 02:38:11 2016 +0200

    uitest: add initial version of wrapper for tree list box
    
    The tree list will also be the first case where we need non-vcl::Window
    based children. We should create one child for each entry to make it
    possible to interact with them correctly.
    
    Change-Id: I49e1ddf7b271946fd595ebfe2f4f2d0c8a535fdc

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 8375dbd..0458a69 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -798,6 +798,8 @@ public:
     virtual Size    GetOptimalSize() const override;
 
     void            SetAlternatingRowColors( const bool bEnable );
+
+    virtual FactoryFunction GetUITestFactory() const override;
 };
 
 #define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT"
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index fd85c9d..7dd5ac8 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -214,6 +214,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
     svtools/source/table/mousefunction \
     svtools/source/table/cellvalueconversion \
     svtools/source/table/tablegeometry \
+    svtools/source/uitest/uiobject \
     svtools/source/uno/addrtempuno \
     svtools/source/uno/contextmenuhelper \
     svtools/source/uno/fpicker \
diff --git a/svtools/inc/uitest/uiobject.hxx b/svtools/inc/uitest/uiobject.hxx
new file mode 100644
index 0000000..8e7cbce
--- /dev/null
+++ b/svtools/inc/uitest/uiobject.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <vcl/uitest/uiobject.hxx>
+
+class SvTreeListBox;
+
+class TreeListUIObject : public WindowUIObject
+{
+public:
+    TreeListUIObject(VclPtr<SvTreeListBox> xTreeList);
+
+    virtual UIObjectType get_type() const override;
+
+    virtual StringMap get_state() override;
+
+    static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
+
+protected:
+
+    virtual OUString get_name() const override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 821e2e5..add32d2 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -40,6 +40,7 @@
 #include <svtools/treelistentry.hxx>
 #include <svtools/viewdataentry.hxx>
 #include "svimpbox.hxx"
+#include "uitest/uiobject.hxx"
 
 #include <set>
 #include <string.h>
@@ -3872,4 +3873,9 @@ bool SvTreeListBox::set_property(const OString &rKey, const OString &rValue)
     return true;
 }
 
+FactoryFunction SvTreeListBox::GetUITestFactory() const
+{
+    return TreeListUIObject::create;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx
new file mode 100644
index 0000000..db34548
--- /dev/null
+++ b/svtools/source/uitest/uiobject.cxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/uiobject.hxx"
+
+#include <svtools/treelistbox.hxx>
+
+TreeListUIObject::TreeListUIObject(VclPtr<SvTreeListBox> xTreeList):
+    WindowUIObject(xTreeList)
+{
+}
+
+StringMap TreeListUIObject::get_state()
+{
+    return WindowUIObject::get_state();
+}
+
+UIObjectType TreeListUIObject::get_type() const
+{
+    return UIObjectType::WINDOW;
+}
+
+OUString TreeListUIObject::get_name() const
+{
+    return OUString("TreeListUIObject");
+}
+
+std::unique_ptr<UIObject> TreeListUIObject::create(vcl::Window* pWindow)
+{
+    SvTreeListBox* pTreeList = dynamic_cast<SvTreeListBox*>(pWindow);
+    assert(pTreeList);
+    return std::unique_ptr<UIObject>(new TreeListUIObject(pTreeList));
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list