Fix bustage from bug 701261 a=bustage fix
authorMark Banner <bugzilla@standard8.plus.com>
Wed, 07 Dec 2011 09:54:26 +0000
changeset 9394 7b09fc4f9f86dac8adf815360b1cf035fa08e4b8
parent 9393 dd915d6cd71da36f5365b5a2ee892d9f782255a5
child 9395 a032dacc2a253d67e0ecc9a8d3b58e8379cf9033
push idunknown
push userunknown
push dateunknown
reviewersbustage
bugs701261
Fix bustage from bug 701261 a=bustage fix
mailnews/mime/src/mimemoz2.cpp
--- a/mailnews/mime/src/mimemoz2.cpp
+++ b/mailnews/mime/src/mimemoz2.cpp
@@ -111,16 +111,32 @@ static PRBool MIME_WrapLongLines;
 static PRBool MIME_VariableWidthPlaintext;
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Attachment handling routines
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //
 MimeObject    *mime_get_main_object(MimeObject* obj);
 
+nsresult MimeGetSize(MimeObject *child, PRInt32 *size) {
+  PRBool isLeaf = mime_subclass_p(child->clazz, (MimeObjectClass *) &mimeLeafClass);
+  PRBool isContainer = mime_subclass_p(child->clazz, (MimeObjectClass *) &mimeContainerClass);
+
+  if (isLeaf) {
+    *size += ((MimeLeaf *)child)->sizeSoFar;
+  } else if (isContainer) {
+    int i;
+    MimeContainer *cont = (MimeContainer *)child;
+    for (i = 0; i < cont->nchildren; ++i) {
+      MimeGetSize(cont->children[i], size);
+    }
+  }
+  return NS_OK;
+}
+
 nsresult
 ProcessBodyAsAttachment(MimeObject *obj, nsMsgAttachmentData **data)
 {
   nsMsgAttachmentData   *tmp;
   PRInt32               n;
   char                  *disp = nsnull;
   char                  *charset = nsnull;
 
@@ -481,32 +497,16 @@ GenerateAttachmentData(MimeObject *objec
   if (NS_FAILED(rv) || !tmp->m_url)
     return NS_ERROR_OUT_OF_MEMORY;
 
   ValidateRealName(tmp, object->headers);
 
   return NS_OK;
 }
 
-nsresult MimeGetSize(MimeObject *child, PRInt32 *size) {
-  PRBool isLeaf = mime_subclass_p(child->clazz, (MimeObjectClass *) &mimeLeafClass);
-  PRBool isContainer = mime_subclass_p(child->clazz, (MimeObjectClass *) &mimeContainerClass);
-
-  if (isLeaf) {
-    *size += ((MimeLeaf *)child)->sizeSoFar;
-  } else if (isContainer) {
-    int i;
-    MimeContainer *cont = (MimeContainer *)child;
-    for (i = 0; i < cont->nchildren; ++i) {
-      MimeGetSize(cont->children[i], size);
-    }
-  }
-  return NS_OK;
-}
-
 nsresult
 BuildAttachmentList(MimeObject *anObject, nsMsgAttachmentData *aAttachData, const char *aMessageURL)
 {
   nsresult              rv;
   PRInt32               i;
   MimeContainer         *cobj = (MimeContainer *) anObject;
   PRBool                found_output = PR_FALSE;