contentstorage/caclient/s60/src/camenuiconmifutility.cpp
changeset 93 82b66994846c
parent 92 782e3408c2ab
child 80 397d00875918
--- a/contentstorage/caclient/s60/src/camenuiconmifutility.cpp	Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/camenuiconmifutility.cpp	Fri Apr 30 15:22:08 2010 +0300
@@ -31,28 +31,25 @@
 {
     CFbsBitmap *bitamp(0);
     CFbsBitmap *mask(0);
-    
-    if ( AknIconUtils::IsMifFile(fileName)) {
-        // SVG icon
-        // SVG always has only one icon
-        TInt bitmapIndex = 0;
-        TInt maskIndex = 1;
-        AknIconUtils::ValidateLogicalAppIconId( fileName,
-                bitmapIndex, maskIndex );
 
-        AknIconUtils::CreateIconLC( bitamp, mask, fileName,
+    TInt bitmapIndex = 0;
+    TInt maskIndex = 1;    
+    // it will change bitmap ids if it is mif (checking inside)
+    AknIconUtils::ValidateLogicalAppIconId( fileName,
                 bitmapIndex, maskIndex );
-        }
+    AknIconUtils::CreateIconLC( bitamp, mask, fileName,
+            bitmapIndex, maskIndex );
 
-    AknIconUtils::DisableCompression(bitamp);
-    AknIconUtils::SetSize(bitamp, TSize(size.width(), size.height()),
-                    EAspectRatioPreservedAndUnusedSpaceRemoved);
+    if (AknIconUtils::IsMifFile(fileName)) {
+        AknIconUtils::DisableCompression(bitamp);
+        AknIconUtils::SetSize(bitamp, TSize(size.width(), size.height()),
+                        EAspectRatioPreservedAndUnusedSpaceRemoved);
     
-    AknIconUtils::DisableCompression(mask);
-    AknIconUtils::SetSize(mask, TSize(size.width(), size.height()),
-                    EAspectRatioPreservedAndUnusedSpaceRemoved);
-    
-    CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+        CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+    } else {
+        CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+        pixmap.scaled(size);
+    }
     
     // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
     CleanupStack::Pop(2);