summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-11 09:47:33 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-01-12 10:33:14 +0100
commit86eaeafcaf4ac16415941228a8fee33e6e295d14 (patch)
tree2e62a4bb03ddb2e6241ab39876d951bbf2ad1e2f /vcl
parentbd882120ce84510f7a5272ecdbf59a5947ea2d45 (diff)
jsdialog: execute IconView actions
Change-Id: If94df547096a5adb15ace432695f91ee7e879bb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109078 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/jsdialog/executor.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index f33eeb4b086a..1a66fe36520a 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -260,6 +260,36 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
}
}
}
+ else if (sControlType == "iconview")
+ {
+ auto pIconView = dynamic_cast<weld::IconView*>(pWidget);
+ if (pIconView)
+ {
+ if (sAction == "select")
+ {
+ OString nPosString
+ = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
+ int nPos = std::atoi(nPosString.getStr());
+
+ pIconView->select(nPos);
+ LOKTrigger::trigger_changed(*pIconView);
+
+ return true;
+ }
+ else if (sAction == "activate")
+ {
+ OString nPosString
+ = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
+ int nPos = std::atoi(nPosString.getStr());
+
+ pIconView->select(nPos);
+ LOKTrigger::trigger_changed(*pIconView);
+ LOKTrigger::trigger_item_activated(*pIconView);
+
+ return true;
+ }
+ }
+ }
else if (sControlType == "expander")
{
auto pExpander = dynamic_cast<weld::Expander*>(pWidget);