landmarks/locationlandmarks/server/src/EPos_CPosLmNameIndex.cpp
branchRCL_3
changeset 44 2b4ea9893b66
parent 19 d6e4203b7ebe
child 45 6b6920c56e2f
--- a/landmarks/locationlandmarks/server/src/EPos_CPosLmNameIndex.cpp	Thu Aug 19 10:20:18 2010 +0300
+++ b/landmarks/locationlandmarks/server/src/EPos_CPosLmNameIndex.cpp	Tue Aug 31 15:37:04 2010 +0300
@@ -329,10 +329,10 @@
                 // the original item has been changed
                 item->SetInvalid();
                 }
-            
-			CleanupStack::Pop( name );//ownership of name is transferred in the call to DoInsertL
 			
-			// add new item for this ID
+			CleanupStack::Pop( name );//ownership of name is transferred in the call to DoInsertL	
+				
+            // add new item for this ID
             // here comparison must be done using collation
             CIndexItem* newItem = DoInsertL( id, name ); // takes onwership of name
             newItem->SetValid();
@@ -442,7 +442,7 @@
 void CPosLmNameIndex::InsertL( TPosLmItemId aLmid, const TDesC& aName )
     {
     HBufC* name = aName.AllocLC();
-    CleanupStack::Pop( name );//ownership of name is transferred in the call to UpdateL/InsertL
+    CleanupStack::Pop( name );
     InsertL( aLmid, name );
     }
 
@@ -461,15 +461,14 @@
 //
 CPosLmNameIndex::CIndexItem* CPosLmNameIndex::DoInsertL( TPosLmItemId aLmid, HBufC* aName )
     {
-    CleanupStack::PushL( aName );//ownership of aName is transferred to this class
-	if ( Find( aLmid ) >= 0 ) // finds valid item
+	CleanupStack::PushL( aName );//ownership of aName is transferred to this class
+    if ( Find( aLmid ) >= 0 ) // finds valid item
         {
         User::Leave( KErrAlreadyExists ); // duplicate ID found
         }
     
     CIndexItem* landmark = new (ELeave) CIndexItem( aLmid, aName ); // takes ownership of aName
-    
-	CleanupStack::Pop( aName );
+    CleanupStack::Pop( aName );
 	CleanupStack::PushL( landmark );
     
     TLmIndexNameKey key;
@@ -496,8 +495,8 @@
 	CleanupStack::PushL( aName );
     CIndexItem* landmark = new (ELeave) CIndexItem( aLmid, aName );
     CleanupStack::Pop( aName );
-	
-	CleanupStack::PushL( landmark );
+
+    CleanupStack::PushL( landmark );
     AppendL( landmark );
     CleanupStack::Pop( landmark );
     }
@@ -551,7 +550,7 @@
 void CPosLmNameIndex::UpdateL( TPosLmItemId aId, const TDesC& aName )
     {
     HBufC* name = aName.AllocLC();
-    CleanupStack::Pop( name );//ownership of name is transferred in the call to UpdateL
+	CleanupStack::Pop( name );//ownership of name is transferred in the call to UpdateL
 //coverity[freed_arg : FALSE]
     UpdateL( aId, name );
 //coverity[pass_freed_arg : FALSE]