summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-10-21 10:55:29 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2019-10-21 12:13:48 +0200
commitfb1b78deebfe9af38fcab812cbe48a9d15e9399e (patch)
tree035c892aaa20d5de7d16f3c0d21c66415dfb6eae /desktop
parentc820bf8baf989814b888253525fe3f307592ba85 (diff)
jsdialogs: use click event if not a combobox
Change-Id: I377de66bd086fa2cb5ef70514f5f1613a3fcb5cd Reviewed-on: https://gerrit.libreoffice.org/81211 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1bbdb01bb7ce..48aa12b9d658 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3273,7 +3273,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
SolarMutexGuard aGuard;
char* pCopy = strdup(pArguments);
- if (!pCopy) {
+ if (!pCopy)
+ {
SetLastExceptionMsg("String copying error.");
return;
}
@@ -3282,7 +3283,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
char* pOptionalEventType = strtok(nullptr, " ");
char* pOptionalData = strtok(nullptr, " ");
- if (!pIdChar) {
+ if (!pIdChar)
+ {
SetLastExceptionMsg("Error parsing the command.");
free(pCopy);
return;
@@ -3307,8 +3309,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
WindowUIObject aUIObject(pWindow);
std::unique_ptr<UIObject> pUIWindow(aUIObject.get_child(sId));
if (pUIWindow) {
+ bool bIsClickAction = false;
+
if (pOptionalEventType) {
- if (strcmp(pOptionalEventType, "selected") == 0 && pOptionalData) {
+ if (strcmp(pOptionalEventType, "selected") == 0 && pOptionalData)
+ {
char* pPos = strtok(pOptionalData, ";");
char* pText = strtok(nullptr, ";");
@@ -3325,9 +3330,14 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
pUIWindow->execute(sSelectAction, aMap);
}
- } else {
- pUIWindow->execute(sClickAction, StringMap());
+ else
+ bIsClickAction = true;
}
+ else
+ bIsClickAction = true;
+
+ if (bIsClickAction)
+ pUIWindow->execute(sClickAction, StringMap());
}
} catch(...) {}