[Libreoffice-commits] core.git: desktop/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 21 12:28:15 UTC 2019


 desktop/source/lib/init.cxx |   23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit af9238d913c24d3bb326d3b0834c5008c9745446
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Oct 21 13:16:50 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Oct 21 14:27:08 2019 +0200

    jsdialogs: handle spinfields
    
    Change-Id: I9b845917ff1a7cb2242d7ef2b6b370007d0091b4
    Reviewed-on: https://gerrit.libreoffice.org/81230
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 48aa12b9d658..6cb4303d4439 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3303,6 +3303,10 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
     {
         const OUString sClickAction("CLICK");
         const OUString sSelectAction("SELECT");
+        const OUString sClearAction("CLEAR");
+        const OUString sTypeAction("TYPE");
+        const OUString sUpAction("UP");
+        const OUString sDownAction("DOWN");
 
         try
         {
@@ -3310,6 +3314,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
             std::unique_ptr<UIObject> pUIWindow(aUIObject.get_child(sId));
             if (pUIWindow) {
                 bool bIsClickAction = false;
+                StringMap aMap;
 
                 if (pOptionalEventType) {
                     if (strcmp(pOptionalEventType, "selected") == 0 && pOptionalData)
@@ -3324,12 +3329,26 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                             return;
                         }
 
-                        StringMap aMap;
                         aMap["POS"] = OUString::createFromAscii(pPos);
                         aMap["TEXT"] = OUString::createFromAscii(pText);
 
                         pUIWindow->execute(sSelectAction, aMap);
                     }
+                    else if (strcmp(pOptionalEventType, "plus") == 0)
+                    {
+                        pUIWindow->execute(sUpAction, aMap);
+                    }
+                    else if (strcmp(pOptionalEventType, "minus") == 0)
+                    {
+                        pUIWindow->execute(sDownAction, aMap);
+                    }
+                    else if (pOptionalData)
+                    {
+                        aMap["TEXT"] = OUString::createFromAscii(pOptionalData);
+
+                        pUIWindow->execute(sClearAction, aMap);
+                        pUIWindow->execute(sTypeAction, aMap);
+                    }
                     else
                         bIsClickAction = true;
                 }
@@ -3337,7 +3356,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                     bIsClickAction = true;
 
                 if (bIsClickAction)
-                    pUIWindow->execute(sClickAction, StringMap());
+                    pUIWindow->execute(sClickAction, aMap);
             }
         } catch(...) {}
 


More information about the Libreoffice-commits mailing list