summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-15 20:03:47 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2020-06-17 12:31:49 +0200
commit34e1eb170e394b464b9686cfbc0a56fb07d85893 (patch)
treecdc9692eb4ac713872a1cf7996f6c10c9ae296d3 /vcl
parentb62d73ccb04da2c4cf7f68a23742d0670ef7eb90 (diff)
support gtk-copy and gtk-paste stock ids
Change-Id: I0d9dc30c62bdfb5976c86bc5a08d5f030eb216e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96394 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit baa55eca0b653d4f661c08f5b6593caa3b186e89) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96418 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/bitmaps.hlst2
-rw-r--r--vcl/source/window/builder.cxx18
2 files changed, 20 insertions, 0 deletions
diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst
index 5ce994a0c384..68f23533eae0 100644
--- a/vcl/inc/bitmaps.hlst
+++ b/vcl/inc/bitmaps.hlst
@@ -138,6 +138,8 @@
#define IMG_INFO "dbaccess/res/exinfo.png"
#define IMG_ADD "extensions/res/scanner/plus.png"
#define IMG_REMOVE "extensions/res/scanner/minus.png"
+#define IMG_COPY "cmd/sc_copy.png"
+#define IMG_PASTE "cmd/sc_paste.png"
#define RID_BMP_TREENODE_COLLAPSED "res/plus.png"
#define RID_BMP_TREENODE_EXPANDED "res/minus.png"
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8410e67871a3..dd57672d8b18 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -95,6 +95,10 @@ namespace
return IMG_ADD;
else if (sType == "gtk-remove")
return IMG_REMOVE;
+ else if (sType == "gtk-copy")
+ return IMG_COPY;
+ else if (sType == "gtk-paste")
+ return IMG_PASTE;
return OUString();
}
@@ -1066,6 +1070,18 @@ namespace
return sIconName;
}
+ OUString extractStockId(VclBuilder::stringmap &rMap)
+ {
+ OUString sIconName;
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("stock-id"));
+ if (aFind != rMap.end())
+ {
+ sIconName = aFind->second;
+ rMap.erase(aFind);
+ }
+ return sIconName;
+ }
+
OUString getStockText(const OUString &rType)
{
if (rType == "gtk-ok")
@@ -2384,6 +2400,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
pToolBox->SetQuickHelpText(nItemId, sTooltip);
OUString sIconName(extractIconName(rMap));
+ if (sIconName.isEmpty())
+ sIconName = mapStockToImageResource(extractStockId(rMap));
if (!sIconName.isEmpty())
pToolBox->SetItemImage(nItemId, FixedImage::loadThemeImage(sIconName));