summaryrefslogtreecommitdiff
path: root/vcl/jsdialog/executor.cxx
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-14 10:23:00 +0100
commite87119a3a9bca74274cf7ec46eda550c14929dc0 (patch)
tree19c286be68b21a2d9198028dce4705a60e4682ce /vcl/jsdialog/executor.cxx
parent26f246c0203b7ee9f92a321f6bd7ed9173b85fc0 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109257 Tested-by: Jenkins
Diffstat (limited to 'vcl/jsdialog/executor.cxx')
-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 da2cea423d3d..dc05c0f75f01 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -250,6 +250,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);