[Libreoffice-commits] core.git: desktop/source
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 13 13:35:56 UTC 2020
desktop/source/lib/init.cxx | 57 +++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 32 deletions(-)
New commits:
commit dd2532203b7928d5f06de96da7f15d45d9c38d80
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Oct 15 18:05:35 2020 +0200
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Nov 13 14:34:50 2020 +0100
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 at collabora.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105738
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9aec16e027cb..b31d68dc5391 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3740,43 +3740,36 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long
WindowUIObject aUIObject(pWindow);
std::unique_ptr<UIObject> pUIWindow(aUIObject.get_visible_child(aMap["id"]));
if (pUIWindow) {
- bool bIsClickAction = false;
+ OUString sAction((aMap.find("cmd") != aMap.end())? aMap["cmd"]: "");
- 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;
-
- if (bIsClickAction)
pUIWindow->execute(sClickAction, aMap);
}
}
More information about the Libreoffice-commits
mailing list