[Libreoffice-commits] core.git: include/vcl vcl/source

Saurav Chirania saurav.chir at gmail.com
Sat Jul 7 06:32:47 UTC 2018


 include/vcl/uitest/uiobject.hxx |    4 ++++
 vcl/source/uitest/uiobject.cxx  |   36 ++++++++++++++++++++++++++++++++++--
 2 files changed, 38 insertions(+), 2 deletions(-)

New commits:
commit 2cff0e2ceb53b2986be8788c7505cabbd04d0288
Author: Saurav Chirania <saurav.chir at gmail.com>
Date:   Mon Jul 2 18:50:10 2018 +0530

    uitest: complete wrapper for SpinField and SpinButton
    
    Change-Id: Ibd28b656792018087478a3c6fb5f5f7ac6686131
    Reviewed-on: https://gerrit.libreoffice.org/56813
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index 5ff62735ea02..88bdf0bd6da1 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -350,6 +350,8 @@ public:
 
     static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
 
+    virtual OUString get_action(VclEventId nEvent) const override;
+
 protected:
 
     virtual OUString get_name() const override;
@@ -371,6 +373,8 @@ public:
 
     static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
 
+    virtual OUString get_action(VclEventId nEvent) const override;
+
 protected:
 
     virtual OUString get_name() const override;
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 5b72f2ab1945..1a292862ec52 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1074,11 +1074,11 @@ void SpinUIObject::execute(const OUString& rAction,
 {
     if (rAction == "UP")
     {
-        /* code */
+        mxSpinButton->Up();
     }
     else if (rAction == "DOWN")
     {
-        /* code */
+        mxSpinButton->Down();
     }
 }
 
@@ -1093,6 +1093,22 @@ StringMap SpinUIObject::get_state()
     return aMap;
 }
 
+OUString SpinUIObject::get_action(VclEventId nEvent) const
+{
+    if (nEvent == VclEventId::SpinbuttonUp)
+    {
+        return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() +
+            " Parent:" + get_top_parent(mxSpinButton)->get_id();
+    }
+    else if (nEvent == VclEventId::SpinbuttonDown)
+    {
+        return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() +
+            " Parent:" + get_top_parent(mxSpinButton)->get_id();
+    }
+    else
+        return WindowUIObject::get_action(nEvent);
+}
+
 OUString SpinUIObject::get_name() const
 {
     return OUString("SpinUIObject");
@@ -1139,6 +1155,22 @@ StringMap SpinFieldUIObject::get_state()
     return aMap;
 }
 
+OUString SpinFieldUIObject::get_action(VclEventId nEvent) const
+{
+    if (nEvent == VclEventId::SpinfieldUp)
+    {
+        return this->get_type() + " Action:UP Id:" + mxSpinField->get_id() +
+            " Parent:" + get_top_parent(mxSpinField)->get_id();
+    }
+    else if (nEvent == VclEventId::SpinfieldDown)
+    {
+        return this->get_type() + " Action:DOWN Id:" + mxSpinField->get_id() +
+            " Parent:" + get_top_parent(mxSpinField)->get_id();
+    }
+    else
+        return WindowUIObject::get_action(nEvent);
+}
+
 OUString SpinFieldUIObject::get_name() const
 {
     return OUString("SpinFieldUIObject");


More information about the Libreoffice-commits mailing list