equal
deleted
inserted
replaced
244 } |
244 } |
245 |
245 |
246 MVPbkStoreContact* CVCardVpbUtil::ContactData() const |
246 MVPbkStoreContact* CVCardVpbUtil::ContactData() const |
247 { |
247 { |
248 __ASSERT_DEBUG( iContactsToShow.Count() > 0, Panic( ENoContactImported ) ); |
248 __ASSERT_DEBUG( iContactsToShow.Count() > 0, Panic( ENoContactImported ) ); |
|
249 // If iContactsToShow.Count() is zero, then it is not possible to parse the fields,so it has to return from here.. |
|
250 if ( iContactsToShow.Count() == 0 ) |
|
251 { |
|
252 return NULL; |
|
253 } |
249 return iContactsToShow[0]; |
254 return iContactsToShow[0]; |
250 } |
255 } |
251 |
256 |
252 TBool CVCardVpbUtil::IsContactItemEmpty() |
257 TBool CVCardVpbUtil::IsContactItemEmpty() |
253 { |
258 { |
254 const MVPbkStoreContactFieldCollection& fields = ContactData()->Fields(); |
259 TBool ret( ETrue ); |
|
260 MVPbkStoreContact* storeContact = ContactData(); |
|
261 if ( !storeContact ) |
|
262 { |
|
263 return ret; |
|
264 } |
|
265 const MVPbkStoreContactFieldCollection& fields = storeContact->Fields(); |
255 TInt count = fields.FieldCount(); |
266 TInt count = fields.FieldCount(); |
256 |
267 |
257 TBool ret( ETrue ); |
|
258 while( count ) |
268 while( count ) |
259 { |
269 { |
260 __ASSERT_DEBUG( count <= fields.FieldCount() && count > 0, |
270 __ASSERT_DEBUG( count <= fields.FieldCount() && count > 0, |
261 Panic( EInvalidIndex ) ); |
271 Panic( EInvalidIndex ) ); |
262 |
272 |