summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2020-10-15 18:05:35 +0200
committerAndras Timar <andras.timar@collabora.com>2020-10-16 16:24:27 +0200
commit800c0aebe7dffb88eb5c1d96fd47eb99032fdfe9 (patch)
treeed2079735cba278c77c76707b80a687d25592146
parentb9e03055d053d5cb8dbdc466ee7c67744a6433b8 (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>
-rw-r--r--desktop/source/lib/init.cxx54
1 files changed, 25 insertions, 29 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b9fd1f9195e7..c8971182893f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3656,11 +3656,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
bIsWeldedDialog = pWidget != nullptr;
bool bContinueWithLOKWindow = false;
+ OUString sAction = aMap["cmd"];
if (bIsWeldedDialog)
{
OUString sControlType = aMap["type"];
- OUString sAction = aMap["cmd"];
if (sControlType == "tabcontrol")
{
@@ -3746,36 +3746,32 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
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 (sAction == "value")
+ {
+ aMap["VALUE"] = aMap["data"];
+ pUIWindow->execute(sValue, aMap);
}
else
bIsClickAction = true;