[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 18 09:23:17 UTC 2019
desktop/source/lib/init.cxx | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
New commits:
commit 712c1ea7d31e3e89c87f7e019f5c224c924dfcbd
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Oct 17 19:23:22 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Oct 18 11:21:24 2019 +0200
jsdialogs: handle combobox selections
Change-Id: Ib968bfaf7ad9e7becd16355259142d583bf7b5e3
Reviewed-on: https://gerrit.libreoffice.org/80991
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
(cherry picked from commit cdeff4f1b4021c5fca55743e119a70fa2bd52b91)
Reviewed-on: https://gerrit.libreoffice.org/81028
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3d43fe6e82fe..f5cbcc4f5b63 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3279,35 +3279,63 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
}
char* pIdChar = strtok(pCopy, " ");
+ char* pOptionalEventType = strtok(nullptr, " ");
+ char* pOptionalData = strtok(nullptr, " ");
if (!pIdChar) {
SetLastExceptionMsg("Error parsing the command.");
+ free(pCopy);
return;
}
OUString sId = OUString::createFromAscii(pIdChar);
- free(pCopy);
VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nWindowId);
if (!pWindow)
{
SetLastExceptionMsg("Document doesn't support dialog rendering, or window not found.");
+ free(pCopy);
return;
}
else
{
- OUString sAction("CLICK");
+ const OUString sClickAction("CLICK");
+ const OUString sSelectAction("SELECT");
+
try
{
WindowUIObject aUIObject(pWindow);
std::unique_ptr<UIObject> pUIWindow(aUIObject.get_child(sId));
- if (pUIWindow)
- pUIWindow->execute(sAction, StringMap());
+ if (pUIWindow) {
+ if (pOptionalEventType) {
+ if (strcmp(pOptionalEventType, "selected") == 0 && pOptionalData) {
+ char* pPos = strtok(pOptionalData, ";");
+ char* pText = strtok(nullptr, ";");
+
+ if (!pPos || !pText)
+ {
+ SetLastExceptionMsg("Error parsing the command.");
+ free(pCopy);
+ return;
+ }
+
+ StringMap aMap;
+ aMap["POS"] = OUString::createFromAscii(pPos);
+ aMap["TEXT"] = OUString::createFromAscii(pText);
+
+ pUIWindow->execute(sSelectAction, aMap);
+ }
+ } else {
+ pUIWindow->execute(sClickAction, StringMap());
+ }
+ }
} catch(...) {}
// force resend
pWindow->Resize();
}
+
+ free(pCopy);
}
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
More information about the Libreoffice-commits
mailing list