[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - uitest/writer_tests vcl/source

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 16 14:27:07 UTC 2020


 uitest/writer_tests/customizeDialog.py |    2 +-
 vcl/source/uitest/uiobject.cxx         |   15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 60eefb146e4ad3fdac896400393b4e1cfaef7767
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Oct 16 14:27:27 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Oct 16 16:26:32 2020 +0200

    uitest: Rename the "SET" to "TYPE" for Edit boxes + implement the real "SET".
    
    To be consistent with the other controls: "TYPE" actually enters the
    characters one by one, while "SET" sets it as a whole.
    
    Also I believe Modify() should be called, not UpdateData()...
    
    Change-Id: I967dc270b1d92fe76107732a511cc3e70d3d65c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104435
    Tested-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py
index e6fef69cb50e..2eeb61a37aab 100644
--- a/uitest/writer_tests/customizeDialog.py
+++ b/uitest/writer_tests/customizeDialog.py
@@ -34,7 +34,7 @@ class ConfigureDialog(UITestCase):
         initialEntryCount = get_state_as_dict(xfunc)["Children"]
         self.assertTrue(initialEntryCount is not 0)
 
-        xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"}))
+        xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"format"}))
 
         # Wait for the search/filter op to be completed
         time.sleep(1)
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 77f4014eea7c..d7c6462783d7 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -667,7 +667,7 @@ void EditUIObject::execute(const OUString& rAction,
         const StringMap& rParameters)
 {
     bool bHandled = true;
-    if (rAction == "SET")
+    if (rAction == "TYPE")
     {
         if (rParameters.find("TEXT") != rParameters.end())
         {
@@ -690,6 +690,17 @@ void EditUIObject::execute(const OUString& rAction,
             bHandled = false;
         }
     }
+    else if (rAction == "SET")
+    {
+        auto it = rParameters.find("TEXT");
+        if (it != rParameters.end())
+        {
+            mxEdit->SetText(it->second);
+            mxEdit->Modify();
+        }
+        else
+            bHandled = false;
+    }
     else if (rAction == "SELECT")
     {
         if (rParameters.find("FROM") != rParameters.end() &&
@@ -704,7 +715,7 @@ void EditUIObject::execute(const OUString& rAction,
     else if (rAction == "CLEAR")
     {
         mxEdit->SetText("");
-        mxEdit->UpdateData();
+        mxEdit->Modify();
         bHandled = true;
     }
     else


More information about the Libreoffice-commits mailing list