idlefw/plugins/sapidataplugin/src/sapidata.cpp
changeset 4 1a2a00e78665
parent 1 844b978f8d5e
child 8 d0529222e3f0
equal deleted inserted replaced
3:ff572005ac23 4:1a2a00e78665
   495 				iPlugin->PublishTextL( aObserver, iItemList[pIndex]->iId, valPtr  );
   495 				iPlugin->PublishTextL( aObserver, iItemList[pIndex]->iId, valPtr  );
   496 				}
   496 				}
   497 			else if( iItemList[pIndex]->iType->Des() == KImage )
   497 			else if( iItemList[pIndex]->iType->Des() == KImage )
   498 				{
   498 				{
   499 				TInt handle = KErrBadHandle;
   499 				TInt handle = KErrBadHandle;
       
   500                 TUint uintHandle = 0;
       
   501                 if ( variant.Get( uintHandle ) )
       
   502                     {
       
   503                     handle = uintHandle;
       
   504                     }
       
   505                 else if ( !variant.Get( handle ) )
       
   506                     {
       
   507                     handle = KErrBadHandle;
       
   508                     }				
   500 				// read as a image handle
   509 				// read as a image handle
   501 				if( ! variant.Get( handle ) )
   510 				if( handle == KErrBadHandle )
   502 					{
   511 					{
   503 					// no handle, so read as image path
   512 					// no handle, so read as image path
   504 					variant.Get( valPtr );
   513 					variant.Get( valPtr );
   505 					iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, valPtr );
   514 					iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, valPtr );
   506 					}
   515 					}
   507 				else
   516 				else
   508 					{
   517 					{
   509 					TInt maskHandle = KErrBadHandle;
   518 					TInt maskHandle = KErrBadHandle;
       
   519 					TUint uintmaskHandle = 0;
   510 					//Look for image mask
   520 					//Look for image mask
   511 					HBufC8* maskKey = HBufC8::NewLC( itemName->Length() + KMask().Length() );
   521 					HBufC8* maskKey = HBufC8::NewLC( itemName->Length() + KMask().Length() );
   512 					TPtr8 maskKeyPtr = maskKey->Des();
   522 					TPtr8 maskKeyPtr = maskKey->Des();
   513 					maskKeyPtr.Append( *itemName );
   523 					maskKeyPtr.Append( *itemName );
   514 					maskKeyPtr.Append( KMask );
   524 					maskKeyPtr.Append( KMask );
   515 					if ( aDataMap->FindL( maskKeyPtr, variant ) )
   525 					if ( aDataMap->FindL( maskKeyPtr, variant ) )
   516 						{
   526 						{
   517 						variant.Get( maskHandle );                           
   527                         if ( variant.Get( uintmaskHandle ) )
       
   528                             {
       
   529                             maskHandle = uintmaskHandle;
       
   530                             }
       
   531                         else if ( !variant.Get( maskHandle ) )
       
   532                             {
       
   533                             maskHandle = KErrBadHandle;
       
   534                             }                           
   518 						}
   535 						}
   519 					CleanupStack::PopAndDestroy( maskKey );
   536 					CleanupStack::PopAndDestroy( maskKey );
   520 					iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, handle, maskHandle );
   537 					iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, handle, maskHandle );
   521 					}
   538 					}
   522 				}
   539 				}