phonebookengines/contactsmodel/cntplsql/src/cntsqlprovider.cpp
changeset 25 76a2435edfd4
parent 24 0ba2181d7c28
--- a/phonebookengines/contactsmodel/cntplsql/src/cntsqlprovider.cpp	Fri Mar 19 09:27:18 2010 +0200
+++ b/phonebookengines/contactsmodel/cntplsql/src/cntsqlprovider.cpp	Fri Apr 16 14:53:18 2010 +0300
@@ -301,11 +301,8 @@
 void CCntSqlStatement::SetConditionL(const TDesC& aCondition)
 	{
 	ClearCondition();
-		
-	iCondition = aCondition.AllocL();	
-	iProcessed = EFalse;
-	delete iSqlString;
-	iSqlString = NULL;
+	iCondition = aCondition.AllocL();
+	ClearSqlString();
 	}
 
 /**		
@@ -317,9 +314,7 @@
 		{
 		delete iCondition;	
 		iCondition = NULL;
-    	iProcessed = EFalse;
-    	delete iSqlString;
-    	iSqlString = NULL;
+		ClearSqlString();
 		} 
 	}
 
@@ -334,12 +329,10 @@
 	delete iCondition;	
 	iCondition = NULL;
 	
-	delete iSqlString;
-	iSqlString = NULL;
+	ClearSqlString();
 		
 	iParams->Reset();
-	iValues->Reset();	
-	iProcessed = EFalse;
+	iValues->Reset();
 	}
 
 /**
@@ -393,10 +386,15 @@
     iTableName = aTableName;
     
 	// Table name changes, so SQL statement must be re-generated
-    iProcessed = EFalse;
+	ClearSqlString();
+    }
+
+void CCntSqlStatement::ClearSqlString()
+	{
+	iProcessed = EFalse;
 	delete iSqlString;
 	iSqlString = NULL;
-    }
+	}
 
 /**
 Creates a concrete CCntSqlUpdate object (used to retrieve sql update statements)