summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/uitest/uiobject.hxx17
-rw-r--r--svtools/source/contnr/simptabl.cxx11
-rw-r--r--svtools/source/uitest/uiobject.cxx28
3 files changed, 56 insertions, 0 deletions
diff --git a/svtools/inc/uitest/uiobject.hxx b/svtools/inc/uitest/uiobject.hxx
index 93cfc156a47b..873c3d57dedf 100644
--- a/svtools/inc/uitest/uiobject.hxx
+++ b/svtools/inc/uitest/uiobject.hxx
@@ -11,6 +11,7 @@
class SvTreeListBox;
class SvTreeListEntry;
+class SvSimpleTable;
class TreeListUIObject : public WindowUIObject
{
@@ -61,4 +62,20 @@ private:
SvTreeListEntry* mpEntry;
};
+class SimpleTableUIObject : public TreeListUIObject
+{
+public:
+ SimpleTableUIObject(VclPtr<SvSimpleTable> xTable);
+
+ virtual StringMap get_state() override;
+
+ static std::unique_ptr<UIObject> createFromContainer(vcl::Window* pWindow);
+
+protected:
+ virtual OUString get_type() const override;
+
+private:
+ VclPtr<SvSimpleTable> mxTable;
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 8515183e66b6..88a8cb3c11c2 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -24,6 +24,7 @@
#include <vcl/builderfactory.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
+#include <uitest/uiobject.hxx>
SvSimpleTableContainer::SvSimpleTableContainer(vcl::Window* pParent, WinBits nBits)
: Control(pParent, nBits)
@@ -50,6 +51,11 @@ void SvSimpleTableContainer::SetTable(SvSimpleTable* pTable)
m_pTable = pTable;
}
+SvSimpleTable* SvSimpleTableContainer::GetTable()
+{
+ return m_pTable.get();
+}
+
bool SvSimpleTableContainer::PreNotify( NotifyEvent& rNEvt )
{
bool bResult = true;
@@ -84,6 +90,11 @@ void SvSimpleTableContainer::GetFocus()
m_pTable->GrabFocus();
}
+FactoryFunction SvSimpleTableContainer::GetUITestFactory() const
+{
+ return SimpleTableUIObject::createFromContainer;
+}
+
// SvSimpleTable ------------------------------------------------------------
SvSimpleTable::SvSimpleTable(SvSimpleTableContainer& rParent, WinBits nBits):
diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx
index 6156f4451918..0a4550ff1813 100644
--- a/svtools/source/uitest/uiobject.cxx
+++ b/svtools/source/uitest/uiobject.cxx
@@ -10,6 +10,7 @@
#include "uitest/uiobject.hxx"
#include <svtools/treelistbox.hxx>
+#include <svtools/simptabl.hxx>
TreeListUIObject::TreeListUIObject(VclPtr<SvTreeListBox> xTreeList):
WindowUIObject(xTreeList),
@@ -140,4 +141,31 @@ OUString TreeListEntryUIObject::get_type() const
return OUString("TreeListEntry");
}
+SimpleTableUIObject::SimpleTableUIObject(VclPtr<SvSimpleTable> xTable):
+ TreeListUIObject(xTable),
+ mxTable(xTable)
+{
+}
+
+StringMap SimpleTableUIObject::get_state()
+{
+ StringMap aMap = TreeListUIObject::get_state();
+
+ aMap["ColumnCount"] = OUString::number(mxTable->TabCount());
+
+ return aMap;
+}
+
+OUString SimpleTableUIObject::UIObject::get_type() const
+{
+ return OUString("SimpleTable");
+}
+
+std::unique_ptr<UIObject> SimpleTableUIObject::createFromContainer(vcl::Window* pWindow)
+{
+ SvSimpleTableContainer* pTableContainer = dynamic_cast<SvSimpleTableContainer*>(pWindow);
+ assert(pTableContainer);
+ return std::unique_ptr<UIObject>(new SimpleTableUIObject(pTableContainer->GetTable()));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */