phonebookui/Phonebook2/UIControls/src/Pbk2AddressTools.cpp
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 21 b3431bff8c19
equal deleted inserted replaced
0:e686773b3f54 3:04ab22b956c2
   365     	MVPbkStoreContactField& field = arrContactFields.FieldAt( idx );
   365     	MVPbkStoreContactField& field = arrContactFields.FieldAt( idx );
   366         if ( field.FieldData().IsEmpty() )
   366         if ( field.FieldData().IsEmpty() )
   367             {
   367             {
   368             continue;
   368             continue;
   369             }
   369             }
   370     	TArray<TVPbkFieldVersitProperty> arrProp = field.BestMatchingFieldType()->VersitProperties();
   370     	const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
   371 		for( TInt idx2 = 0; idx2 < arrProp.Count(); idx2++)
   371         if ( fieldType )
   372 			{
   372             {
   373 			if( arrProp[idx2].Name() != EVPbkVersitNameADR )
   373             TArray<TVPbkFieldVersitProperty> arrProp =
   374 				{
   374                 fieldType->VersitProperties();
   375 				continue;
   375             for (TInt idx2 = 0; idx2 < arrProp.Count(); idx2++ )
   376 				}
   376                 {
   377 
   377                 if ( arrProp[idx2].Name() != EVPbkVersitNameADR )
   378 			if( !arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( aAddressGroup ) ) &&
   378                     {
   379 				aAddressGroup != EPbk2FieldGroupIdPostalAddress	)
   379                     continue;
   380 				{
   380                     }
   381 				continue;
   381 
   382 				}
   382                 if ( !arrProp[idx2].Parameters().Contains(
   383 
   383                     MapAddressToVersitParam( aAddressGroup ) )
   384 			if( ( arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( EPbk2FieldGroupIdCompanyAddress ) ) ||
   384                     && aAddressGroup != EPbk2FieldGroupIdPostalAddress )
   385 				  arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( EPbk2FieldGroupIdHomeAddress ) ) ) &&
   385                     {
   386 				  aAddressGroup == EPbk2FieldGroupIdPostalAddress )
   386                     continue;
   387 				{
   387                     }
   388 				continue;
   388 
   389 				}
   389                 if ( (arrProp[idx2].Parameters().Contains(
   390 
   390                     MapAddressToVersitParam( EPbk2FieldGroupIdCompanyAddress ) )
   391 			MVPbkContactFieldData& fieldData = field.FieldData();
   391                     || arrProp[idx2].Parameters().Contains(
   392 			if( fieldData.DataType() != EVPbkFieldStorageTypeText )
   392                         MapAddressToVersitParam( EPbk2FieldGroupIdHomeAddress ) ))
   393 				{
   393                     && aAddressGroup == EPbk2FieldGroupIdPostalAddress )
   394 				continue;
   394                     {
   395 				}
   395                     continue;
   396 
   396                     }
   397 			MVPbkContactFieldTextData& data =
   397 
   398 			   MVPbkContactFieldTextData::Cast( fieldData );
   398                 MVPbkContactFieldData& fieldData = field.FieldData();
   399 			if( data.Text().Length() )
   399                 if ( fieldData.DataType() != EVPbkFieldStorageTypeText )
   400 				{
   400                     {
   401 				aFieldsMap.InsertL( arrProp[idx2].SubField(), data.Text() );
   401                     continue;
   402 				}
   402                     }
   403 			}
   403 
       
   404                 MVPbkContactFieldTextData& data =
       
   405                     MVPbkContactFieldTextData::Cast( fieldData );
       
   406                 if ( data.Text().Length() )
       
   407                     {
       
   408                     aFieldsMap.InsertL( arrProp[idx2].SubField(), data.Text() );
       
   409                     }
       
   410                 }
       
   411             }
   404      	}
   412      	}
   405     }
   413     }
   406 
   414 
   407 
   415 
   408 
   416 
   409 
   417 
   410