Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv18875/src/classes

Modified Files:
        ComposeTemplate.cpp MessageView.cpp 
Log Message:
MimePart::GetContent() doesn't copy data once again (inefficient!) any more; separate 
GetTextContent() which does it was added; yet another bug in handling base64 data fixed

Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -b -u -2 -r1.45 -r1.46
--- ComposeTemplate.cpp 12 Jul 2003 17:27:57 -0000      1.45
+++ ComposeTemplate.cpp 12 Jul 2003 18:57:43 -0000      1.46
@@ -1300,10 +1300,5 @@
    {
       case MimeType::TEXT:
-         ExpandOriginalText
-         (
-            (const char *)mimePart->GetContent(),
-            prefix,
-            value
-         );
+         ExpandOriginalText(mimePart->GetTextContent(), prefix, value);
 
          quoted = true;

Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -b -u -2 -r1.123 -r1.124
--- MessageView.cpp     18 Jun 2003 07:44:55 -0000      1.123
+++ MessageView.cpp     12 Jul 2003 18:57:43 -0000      1.124
@@ -1526,8 +1526,5 @@
    }
 
-   // cast is ok - it's a text part
-   String textPart = (const wxChar *)mimepart->GetContent();
-
-   ShowText(textPart, mimepart->GetTextEncoding());
+   ShowText(mimepart->GetTextContent(), mimepart->GetTextEncoding());
 }
 
@@ -1830,5 +1827,5 @@
          else
          {
-            String s((const wxChar *)data, len);
+            String s((const char *)data, len);
 
             m_viewer->InsertRawContents(s);
@@ -1943,8 +1940,4 @@
       signedText += String(wxConvertMB2WX(c), signedTextLength);
 
-      unsigned long signatureLength = 0;
-      c = (const char *)signaturePart->GetContent(&signatureLength);
-      String signature(wxConvertMB2WX(c), signatureLength);
-
       MCryptoEngineFactory * const factory
          = (MCryptoEngineFactory *)MModule::LoadModule(_T("PGPEngine"));
@@ -1955,6 +1948,11 @@
          MCryptoEngineOutputLog *log = new MCryptoEngineOutputLog(GetWindow());
 
-         MCryptoEngine::Status status =
-               pgpEngine->VerifyDetachedSignature(signedText, signature, log);
+         MCryptoEngine::Status
+             status = pgpEngine->VerifyDetachedSignature
+                                 (
+                                    signedText,
+                                    signaturePart->GetTextContent(),
+                                    log
+                                 );
 
          ClickablePGPInfo *pgpInfo = ClickablePGPInfo::CreateFromSigStatusCode
@@ -2710,5 +2708,9 @@
          // saving the messages is special, we have a separate function for
          // this as it's also done from elsewhere
-         ok = MailFolder::SaveMessageAsMBOX(filename, (const wxChar *)content);
+         ok = MailFolder::SaveMessageAsMBOX
+              (
+                filename,
+                String((const char *)content, len)
+              );
       }
       else // not a message
@@ -2745,6 +2747,6 @@
 MessageView::MimeViewText(const MimePart *mimepart)
 {
-   const void *content = mimepart->GetContent();
-   if ( content )
+   const String content = mimepart->GetTextContent();
+   if ( !content.empty() )
    {
       String title;
@@ -2758,6 +2760,5 @@
       }
 
-      MDialog_ShowText(GetParentFrame(), title,
-                       (const wxChar *)content, _T("MimeView"));
+      MDialog_ShowText(GetParentFrame(), title, content, _T("MimeView"));
    }
    else



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to