Fixed: Method ’_themeAttributes’ never saved anything in the cache

This commit is contained in:
Martin Carlberg committed 2015-10-21 12:26:31 +02:00
1 parent 9946987f69
commit 5e1f1675b8
1 file changed
+8 -3
+8 -3
View File
@@ -186,9 +186,14 @@ var CPViewThemeClassKey = @"CPViewThemeClassKey",
var theClass = [self class],
CPObjectClass = [CPObject class],
attributes = [],
attributes = CachedThemeAttributes[class_getName(theClass)],
nullValue = [CPNull null];
if (attributes)
return attributes;
else
attributes = [];
for (; theClass && theClass !== CPObjectClass; theClass = [theClass superclass])
{
var cachedAttributes = CachedThemeAttributes[class_getName(theClass)];
@@ -196,8 +201,6 @@ var CPViewThemeClassKey = @"CPViewThemeClassKey",
if (cachedAttributes)
{
attributes = attributes.length ? attributes.concat(cachedAttributes) : attributes;
CachedThemeAttributes[[self className]] = attributes;
break;
}
@@ -219,6 +222,8 @@ var CPViewThemeClassKey = @"CPViewThemeClassKey",
}
}
CachedThemeAttributes[[self className]] = attributes;
return attributes;
}