diff -r b34d53f6acdf -r dbfb5e38438b contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Aug 06 13:40:46 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Wed Aug 18 10:39:24 2010 +0300 @@ -638,10 +638,12 @@ const TDesC& aPackageUid, CCaWidgetDescription* aWidgetDescriptor, TChar& aDrive ) { - aWidgetDescriptor->SetIconUriL( - *GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ) ); + HBufC *const graphicsName = + GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ); + + aWidgetDescriptor->SetIconUriL( *graphicsName ); - CleanupStack::PopAndDestroy( ); + CleanupStack::PopAndDestroy( graphicsName ); } // ---------------------------------------------------------------------------- @@ -654,10 +656,12 @@ CCaWidgetDescription* aWidgetDescriptor, TChar& aDrive ) { - aWidgetDescriptor->SetPreviewImageNameL( - *GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ) ); + HBufC *const graphicsName = + GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ); - CleanupStack::PopAndDestroy(); + aWidgetDescriptor->SetPreviewImageNameL( *graphicsName ); + + CleanupStack::PopAndDestroy( graphicsName ); } // ---------------------------------------------------------------------------- @@ -731,47 +735,42 @@ { RBuf graphicsName; graphicsName.CleanupClosePushL(); - HBufC* result; + + RBuf elementText; + elementText.CleanupClosePushL(); + + elementText.Assign( + CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ) ); + + if ( TParsePtrC(elementText).Ext() != KNullDesC ) + { + HBufC* const manifestDirectoryPath( + GetManifestDirectoryPathLC( aPackageUid, aDrive ) ); + + graphicsName.CreateL( manifestDirectoryPath->Length() + + elementText.Length() ); + graphicsName.Append( *manifestDirectoryPath ); + + CleanupStack::PopAndDestroy( manifestDirectoryPath ); + } + else + { + graphicsName.CreateL( elementText.Length() ); + } + + graphicsName.Append( elementText ); - if ( aElement.Text() != KNullDesC8 ) - { - RBuf elementText; - elementText.CleanupClosePushL(); - - elementText.Assign( - CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ) ); - - if ( TParsePtrC(elementText).Ext() != KNullDesC ) - { - HBufC* const manifestDirectoryPath( - GetManifestDirectoryPathLC( aPackageUid, aDrive ) ); - - graphicsName.CreateL( manifestDirectoryPath->Length() + - elementText.Length() ); - graphicsName.Append( *manifestDirectoryPath ); - - CleanupStack::PopAndDestroy( manifestDirectoryPath ); - } - else - { - graphicsName.CreateL( elementText.Length() ); - } - - graphicsName.Append( elementText ); - result = HBufC::NewL( graphicsName.Length() ) ; - *result = graphicsName; - - CleanupStack::PopAndDestroy( &elementText ); - } - else - { - result = HBufC::NewL( 1 ) ; - } - CleanupStack::PopAndDestroy( &graphicsName ); - CleanupStack::PushL( result ); - - return result; + CleanupStack::PopAndDestroy( &elementText ); + + HBufC *result = HBufC::NewL( graphicsName.Length() ) ; + *result = graphicsName; + + CleanupStack::PopAndDestroy( &graphicsName ); + + CleanupStack::PushL( result ); + + return result; }