phonebookengines/contactsmodel/cntplsql/src/cplcollectioniterator.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 0 e686773b3f54
child 8 5586b4d2ec3e
--- a/phonebookengines/contactsmodel/cntplsql/src/cplcollectioniterator.cpp	Fri Mar 12 15:41:25 2010 +0200
+++ b/phonebookengines/contactsmodel/cntplsql/src/cplcollectioniterator.cpp	Mon Mar 15 12:39:26 2010 +0200
@@ -63,7 +63,7 @@
 	EFindCompanyNamePronunciation
 	};
 
-// Collation level that ignore accents (i.e. 'a' == 'ä').
+// Collation level that ignore accents (i.e. 'a' == '?).
 const TInt KCollationLevel= 0;
 
 //
@@ -419,7 +419,7 @@
 */
 CPlCollection::CPlCollection(CPplContactsFile& aContactsFile)
 	: 
-	iContactsFile(aContactsFile)
+	iContactsFile( aContactsFile ), iRSqlstatementsWorking( EFalse )
 	{
 	}
 	
@@ -1249,6 +1249,11 @@
 */
 void CPlCollection::Reset()
 	{
+	if ( !iRSqlstatementsWorking )
+        {
+        //If RSqlstatements was reseted, don't reset it again.
+        return;
+        }
 	// Could introduce methods specific to the find operation such that this
 	// method is called only if an asynchronous find has taken place. 
 	delete iFieldDef;
@@ -1272,6 +1277,7 @@
 	selectEmailStatement.Close();
 	selectSIPStatement.Close();
 	selectIdFromIdentityStatement.Close();
+	iRSqlstatementsWorking = EFalse;
 	}
 
 
@@ -1291,6 +1297,7 @@
 	// Persistence Layer CPlCollection is not deleted but Reset()'s the member
 	// variables for iterative FindAsyncL() calls.
 	Reset();
+	iRSqlstatementsWorking = ETrue;
 	iText = CreateFindTextL(aText);
 	iFieldDef = aFieldDef;
 	iOriginalText = aText.AllocL();
@@ -1430,7 +1437,7 @@
 	// Persistence Layer CPlCollection is not deleted but Reset()'s the member
 	// variables for iterative FindAsyncL() calls.
 	Reset();
-
+    iRSqlstatementsWorking = ETrue;
 	iFindWords = new(ELeave) CDesCArrayFlat(5);
 	iFindWords2 = new(ELeave) CDesCArrayFlat(5);
 	for(TInt loop = 0;loop < aWords.MdcaCount();++loop)