simpleengine/xmlutils/src/simpleelement.cpp
branchRCL_3
changeset 18 52d91a16fec3
parent 0 c8caa15ef882
child 34 2669f8761a99
--- a/simpleengine/xmlutils/src/simpleelement.cpp	Tue Apr 27 17:03:39 2010 +0300
+++ b/simpleengine/xmlutils/src/simpleelement.cpp	Tue May 11 16:35:18 2010 +0300
@@ -221,6 +221,7 @@
 TInt CSimpleElement::SimpleElementsL( 
     RPointerArray<MSimpleElement>& aElementArray )
     {
+    CleanupClosePushL( aElementArray );
     // Reset the output array first.
     aElementArray.Reset();
     iElements.ResetAndDestroy();
@@ -234,10 +235,12 @@
         CSenElement* pElement = elems[i];
         CSimpleElement* simple = CSimpleElement::NewL( pElement, EFalse );
         CleanupStack::PushL( simple );
-        User::LeaveIfError( aElementArray.Append( simple ));
+        iElements.AppendL( simple );
         CleanupStack::Pop( simple );
-        User::LeaveIfError( iElements.Append( simple ) );
+        aElementArray.AppendL( simple );
         }
+    CleanupStack::Pop( &aElementArray ); 
+    
     return elemCount ? KErrNone : KErrNotFound;
     }
 
@@ -292,6 +295,8 @@
 //
 TInt CSimpleElement::SimpleAttributesL( RPointerArray<MSimpleAttribute>& aArray )
     {  
+    CleanupClosePushL( aArray );
+    
     // Reset the output array first.
     aArray.Reset();
     iAttributes.ResetAndDestroy();
@@ -304,10 +309,12 @@
         CSenBaseAttribute* pAttr = elems[i];
         CSimpleAttribute* attr = CSimpleAttribute::NewL( pAttr );
         CleanupStack::PushL( attr );
-        User::LeaveIfError(iAttributes.Append( attr ));
+        iAttributes.AppendL( attr );
         CleanupStack::Pop( attr );        
-        User::LeaveIfError(aArray.Append( attr ));
+        aArray.AppendL( attr );
         }
+    CleanupStack::Pop( &aArray );
+    
     return elemCount ? KErrNone : KErrNotFound;
     }