diff -r 0d28c1c5b6dd -r 2828b4d142c0 phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindView.h --- a/phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindView.h Tue Apr 27 16:23:35 2010 +0300 +++ b/phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindView.h Tue May 11 16:00:21 2010 +0300 @@ -88,6 +88,7 @@ TInt& aMatchArrayIndex ) const; void RemoveFromMatchArrayIfFound( const CViewContact& aContact ); TInt FindFromMatchArray( const CViewContact& aContact ) const; + void HeapSortL(RPointerArray aViewContacts); private: // Data /// Own: the find policy @@ -98,6 +99,21 @@ RPointerArray iContactsModelMatchContacts; }; +// CleanupStack helpers for item owning RPointerArrays +template +class CleanupResetAndDestroy + { +public: + inline static void PushL(T& aRef) + { CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef)); } +private: + inline static void ResetAndDestroy(TAny *aPtr) + { static_cast(aPtr)->ResetAndDestroy(); } + }; + +template +inline void CleanupResetAndDestroyPushL(T& aRef) + { CleanupResetAndDestroy::PushL(aRef); } } // namespace VPbkCntModel #endif // VPBKCNTMODEL_CFINDVIEW_H