diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-11-02 12:24:49 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-11-25 15:47:01 +0100 |
commit | 708a8b7f1d869580741787e71a9248757bb1541e (patch) | |
tree | 6bbb2dfb930321e8e00b8ca9cc0bf2b5b7734fd9 /vcl | |
parent | 6581a8a322cc2b83385722ae3042a885a7423f19 (diff) |
jsdialog: execute checkbox action
Change-Id: Ib19997f600404cc9555acbfaf87acac32f8aa5fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106562
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/jsdialog/executor.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 9863d0c2edb9..93dae7db3a2d 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -97,6 +97,20 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat } } } + else if (sControlType == "checkbox") + { + auto pCheckButton = dynamic_cast<weld::CheckButton*>(pWidget); + if (pCheckButton) + { + if (sAction == "change") + { + bool bChecked = rData["data"] == "true"; + pCheckButton->set_state(bChecked ? TRISTATE_TRUE : TRISTATE_FALSE); + LOKTrigger::trigger_toggled(*static_cast<weld::ToggleButton*>(pCheckButton)); + return true; + } + } + } else if (sControlType == "drawingarea") { auto pArea = dynamic_cast<weld::DrawingArea*>(pWidget); |