phonebookui/Phonebook2/UIControls/src/Pbk2AddressTools.cpp
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 7 b3431bff8c19
--- a/phonebookui/Phonebook2/UIControls/src/Pbk2AddressTools.cpp	Tue Feb 02 10:12:17 2010 +0200
+++ b/phonebookui/Phonebook2/UIControls/src/Pbk2AddressTools.cpp	Fri Feb 19 22:40:27 2010 +0200
@@ -367,44 +367,51 @@
             {
             continue;
             }
-    	TArray<TVPbkFieldVersitProperty> arrProp = field.BestMatchingFieldType()->VersitProperties();
-		for( TInt idx2 = 0; idx2 < arrProp.Count(); idx2++)
-			{
-			if( arrProp[idx2].Name() != EVPbkVersitNameADR )
-				{
-				continue;
-				}
+    	const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
+        if ( fieldType )
+            {
+            TArray<TVPbkFieldVersitProperty> arrProp =
+                fieldType->VersitProperties();
+            for (TInt idx2 = 0; idx2 < arrProp.Count(); idx2++ )
+                {
+                if ( arrProp[idx2].Name() != EVPbkVersitNameADR )
+                    {
+                    continue;
+                    }
 
-			if( !arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( aAddressGroup ) ) &&
-				aAddressGroup != EPbk2FieldGroupIdPostalAddress	)
-				{
-				continue;
-				}
+                if ( !arrProp[idx2].Parameters().Contains(
+                    MapAddressToVersitParam( aAddressGroup ) )
+                    && aAddressGroup != EPbk2FieldGroupIdPostalAddress )
+                    {
+                    continue;
+                    }
 
-			if( ( arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( EPbk2FieldGroupIdCompanyAddress ) ) ||
-				  arrProp[idx2].Parameters().Contains( MapAddressToVersitParam( EPbk2FieldGroupIdHomeAddress ) ) ) &&
-				  aAddressGroup == EPbk2FieldGroupIdPostalAddress )
-				{
-				continue;
-				}
+                if ( (arrProp[idx2].Parameters().Contains(
+                    MapAddressToVersitParam( EPbk2FieldGroupIdCompanyAddress ) )
+                    || arrProp[idx2].Parameters().Contains(
+                        MapAddressToVersitParam( EPbk2FieldGroupIdHomeAddress ) ))
+                    && aAddressGroup == EPbk2FieldGroupIdPostalAddress )
+                    {
+                    continue;
+                    }
 
-			MVPbkContactFieldData& fieldData = field.FieldData();
-			if( fieldData.DataType() != EVPbkFieldStorageTypeText )
-				{
-				continue;
-				}
+                MVPbkContactFieldData& fieldData = field.FieldData();
+                if ( fieldData.DataType() != EVPbkFieldStorageTypeText )
+                    {
+                    continue;
+                    }
 
-			MVPbkContactFieldTextData& data =
-			   MVPbkContactFieldTextData::Cast( fieldData );
-			if( data.Text().Length() )
-				{
-				aFieldsMap.InsertL( arrProp[idx2].SubField(), data.Text() );
-				}
-			}
+                MVPbkContactFieldTextData& data =
+                    MVPbkContactFieldTextData::Cast( fieldData );
+                if ( data.Text().Length() )
+                    {
+                    aFieldsMap.InsertL( arrProp[idx2].SubField(), data.Text() );
+                    }
+                }
+            }
      	}
     }
 
 
 
 
-