Kaydet (Commit) 58d8a11a authored tarafından Rodolfo Ribeiro Gomes's avatar Rodolfo Ribeiro Gomes Kaydeden (comit) Caolán McNamara

Theme icons are loaded only once

With the theme icon cleaning commit
d5151ab5, 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: 's avatarRodolfo Ribeiro Gomes <rodolforg@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/5943Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 4da39c17
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment