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