Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17938/src/classes

Modified Files:
        MessageView.cpp 
Log Message:
trim trailing empty lines in the text quoted in the reply/forward

Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.151
retrieving revision 1.152
diff -b -u -2 -r1.151 -r1.152
--- MessageView.cpp     12 Jul 2004 20:53:20 -0000      1.151
+++ MessageView.cpp     12 Jul 2004 21:10:53 -0000      1.152
@@ -3174,4 +3174,6 @@
 String MessageView::GetText() const
 {
+   // return selection if we have any and if the option to reply to selected
+   // text hasn't been disabled by the user
    String text;
    if ( READ_CONFIG(GetProfile(), MP_REPLY_QUOTE_SELECTION) )
@@ -3180,5 +3182,17 @@
    }
 
-   return text.empty() ? m_textBody : text;
+   // test for m_textBody is important to avoid problems in the code below
+   if ( !text.empty() || m_textBody.empty() )
+      return text;
+
+   // trim trailing empty lines, it is annoying to have to delete them manually
+   // when replying
+   const wxChar *p = m_textBody.end() - 1;
+   while ( *p == _T('\r') || *p == _T('\n') )
+      p--;
+
+   const_cast<String &>(m_textBody).erase(p - m_textBody.begin() + 1);
+
+   return m_textBody;
 }
 
@@ -3188,5 +3202,5 @@
 
 bool
-MessageView::Print(void)
+MessageView::Print()
 {
    return m_viewer->Print();
@@ -3194,5 +3208,5 @@
 
 void
-MessageView::PrintPreview(void)
+MessageView::PrintPreview()
 {
    m_viewer->PrintPreview();



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to