desktop/source/lib/init.cxx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
New commits: commit fb1b78deebfe9af38fcab812cbe48a9d15e9399e Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Oct 21 10:55:29 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Oct 21 12:13:48 2019 +0200 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.k...@collabora.com> 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(...) {} _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits