summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-22 22:23:04 +0100
committerJan Holesovsky <kendy@collabora.com>2014-11-23 03:08:47 +0100
commit44e02826bfc46cb5647d3805283b303bc964385f (patch)
tree4cc029e0edbf45a48bf7a95f99b9008ee2b2eadf /vcl/source
parentf09b39a65ddd60dabf4e47cb5e82acbd32305b31 (diff)
icons: m_cacheIcons is always true, kill it.
Change-Id: Ie63f8780093a2605ecd4d1e80ccb05e16b486cf1
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/impimagetree.cxx49
1 files changed, 15 insertions, 34 deletions
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index fb0756720d75..ecfaf2083101 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -113,9 +113,13 @@ static void loadImageFromStream(
}
-ImplImageTree::ImplImageTree() { m_cacheIcons = true; }
+ImplImageTree::ImplImageTree()
+{
+}
-ImplImageTree::~ImplImageTree() {}
+ImplImageTree::~ImplImageTree()
+{
+}
bool ImplImageTree::loadImage(
OUString const & name, OUString const & style, BitmapEx & bitmap,
@@ -151,18 +155,19 @@ bool ImplImageTree::doLoadImage(
bool localized)
{
setStyle(style);
- if (m_cacheIcons && iconCacheLookup(name, localized, bitmap)) {
+ if (iconCacheLookup(name, localized, bitmap))
return true;
- }
- if (!bitmap.IsEmpty()) {
+
+ if (!bitmap.IsEmpty())
bitmap.SetEmpty();
- }
+
std::vector< OUString > paths;
paths.push_back(getRealImageName(name));
if (localized) {
sal_Int32 pos = name.lastIndexOf('/');
- if (pos != -1) {
+ if (pos != -1)
+ {
// find() uses a reverse iterator, so push in reverse order.
std::vector< OUString > aFallbacks( Application::GetSettings().GetUILanguageTag().getFallbackStrings(true));
for (std::vector< OUString >::reverse_iterator it( aFallbacks.rbegin());
@@ -180,9 +185,10 @@ bool ImplImageTree::doLoadImage(
} catch (const css::uno::Exception & e) {
SAL_INFO("vcl", "ImplImageTree::doLoadImage exception " << e.Message);
}
- if (m_cacheIcons && found) {
+
+ if (found)
m_iconCache[name.intern()] = std::make_pair(localized, bitmap);
- }
+
return found;
}
@@ -235,20 +241,6 @@ bool ImplImageTree::iconCacheLookup(
bool ImplImageTree::find(
std::vector< OUString > const & paths, BitmapEx & bitmap)
{
- if (!m_cacheIcons) {
- for (std::vector< OUString >::const_reverse_iterator j(
- paths.rbegin());
- j != paths.rend(); ++j)
- {
- osl::File file(m_path.first + "/" + *j);
- if (file.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None) {
- loadImageFromStream( wrapFile(file), *j, bitmap );
- file.close();
- return true;
- }
- }
- }
-
if (!checkPathAccess())
return false;
@@ -270,17 +262,6 @@ void ImplImageTree::loadImageLinks()
{
const OUString aLinkFilename("links.txt");
- if (!m_cacheIcons)
- {
- osl::File file(m_path.first + "/" + aLinkFilename);
- if (file.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None)
- {
- parseLinkFile( wrapFile(file) );
- file.close();
- return;
- }
- }
-
if (!checkPathAccess())
return;