summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRodolfo Ribeiro Gomes <rodolforg@gmail.com>2013-09-14 19:27:50 -0300
committerCaolán McNamara <caolanm@redhat.com>2013-09-19 13:11:22 +0000
commit58d8a11a1b44d5f07c43f96c7e4ab03dc549ef27 (patch)
treedfb4f4e6301bd8fe954cc5e4048ac7ee28bbcf0d /vcl
parent4da39c170ff2d5bca16e991d244a73ff6b5945b0 (diff)
Theme icons are loaded only once
With the theme icon cleaning commit d5151ab592367fde7db03fce81e0b76776d18216, duplicated icons (same icon for multiple actions) doesn't need to be stored in different files. The file links.txt inside the theme pack can handle filename redirections. So, it keeps the theme pack smaller. However, the duplicates keep being loaded, because they use different names. With this patch, the names of those duplicates are mapped also when querying for the icons. This way, an icon is loaded only once, saving RAM. Change-Id: Ieb5b8424c1515f0033276bf314cdef02a4e01862 Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/5943 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/impimagetree.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 4d549f04e92e..1c676676ba16 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -270,13 +270,12 @@ bool ImplImageTree::checkStyleCacheLookup(
bool ImplImageTree::iconCacheLookup(
OUString const & name, bool localized, BitmapEx & bitmap)
{
- IconCache::iterator i(m_iconCache.find(name));
+ IconCache::iterator i(m_iconCache.find(getRealImageName(name)));
if (i != m_iconCache.end() && i->second.first == localized) {
bitmap = i->second.second;
return true;
- } else {
- return false;
}
+ return false;
}
bool ImplImageTree::find(