summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2020-10-15 18:05:35 +0200
committerMuhammet Kara <muhammet.kara@collabora.com>2020-11-16 01:11:08 +0100
commitcd475b517abcace4ed79bfd129e4487d60513b30 (patch)
treef5b7722ba8c3b1206b73da6a81b00b2d54dd333e /desktop
parent8d46a8dbbdee54ea8082c372e8a07cd705d028dc (diff)
lok: Simplify the check for command in sendDialogEvent.
Change-Id: I1d2c967b68113d2528b80e91c32170f749ed9335 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104434 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105615 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx50
1 files changed, 21 insertions, 29 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 210ce2d84d34..f527656333b6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3749,43 +3749,35 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long
if (!bIsWeldedDialog)
{
+ OUString sAction((aMap.find("cmd") != aMap.end())? aMap["cmd"]: "");
WindowUIObject aUIObject(pWindow);
std::unique_ptr<UIObject> pUIWindow(aUIObject.get_visible_child(aMap["id"]));
if (pUIWindow) {
bool bIsClickAction = false;
- if (aMap.find("cmd") != aMap.end()) {
- if (aMap["cmd"] == "selected")
- {
- aMap["POS"] = aMap["data"];
- aMap["TEXT"] = aMap["data"];
+ if (sAction == "selected")
+ {
+ aMap["POS"] = aMap["data"];
+ aMap["TEXT"] = aMap["data"];
- pUIWindow->execute(sSelectAction, aMap);
- }
- else if (aMap["cmd"] == "plus")
- {
- pUIWindow->execute(sUpAction, aMap);
- }
- else if (aMap["cmd"] == "minus")
- {
- pUIWindow->execute(sDownAction, aMap);
- }
- else if (aMap["cmd"] == "set")
- {
- aMap["TEXT"] = aMap["data"];
+ pUIWindow->execute(sSelectAction, aMap);
+ }
+ else if (sAction == "plus")
+ {
+ pUIWindow->execute(sUpAction, aMap);
+ }
+ else if (sAction == "minus")
+ {
+ pUIWindow->execute(sDownAction, aMap);
+ }
+ else if (sAction == "set")
+ {
+ aMap["TEXT"] = aMap["data"];
- pUIWindow->execute(sClearAction, aMap);
- pUIWindow->execute(sTypeAction, aMap);
- }
- else if (aMap["cmd"] == "value")
- {
- aMap["VALUE"] = aMap["data"];
- pUIWindow->execute(sValue, aMap);
- }
- else
- bIsClickAction = true;
+ pUIWindow->execute(sClearAction, aMap);
+ pUIWindow->execute(sTypeAction, aMap);
}
- else if (aMap["cmd"] == "value")
+ else if (sAction == "value")
{
aMap["VALUE"] = aMap["data"];
pUIWindow->execute(sValue, aMap);