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

Modified Files:
        ComposeTemplate.cpp 
Log Message:
fixed several bugs related to changing identity in the composer window when 
replying: don't use message view to get the text to quote now, remember it in 
the composer itself once and for all instead

Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -b -u -2 -r1.73 -r1.74
--- ComposeTemplate.cpp 16 Jan 2006 20:32:26 -0000      1.73
+++ ComposeTemplate.cpp 12 Feb 2006 16:50:04 -0000      1.74
@@ -41,6 +41,4 @@
 #include "Message.h"
 
-#include "MessageView.h"
-
 #include "Mpers.h"
 
@@ -279,8 +277,8 @@
    VarExpander(ExpansionSink& sink,
                Composer& cv,
-               Profile *profile = NULL,
-               Message *msg = NULL,
-               const MessageView *msgview = NULL)
-      : m_sink(sink), m_cv(cv)
+               Profile *profile,
+               Message *msg,
+               const String& textToQuote)
+      : m_sink(sink), m_cv(cv), m_textToQuote(textToQuote)
    {
       m_profile = profile ? profile : mApplication->GetProfile();
@@ -289,6 +287,4 @@
       m_msg = msg;
       SafeIncRef(m_msg);
-
-      m_msgview = msgview;
    }
 
@@ -359,6 +355,6 @@
    Message *m_msg;
 
-   // the message viewer we use for querying the selection if necessary
-   const MessageView *m_msgview;
+   // the text to be quoted in a reply/followup
+   String m_textToQuote;
 
    // the profile to use for everything (global one by default)
@@ -1514,5 +1510,5 @@
 VarExpander::DoQuoteOriginal(bool isQuote, String *value) const
 {
-   if ( !m_msgview )
+   if ( m_textToQuote.empty() )
    {
       // don't quote anything at all
@@ -1529,5 +1525,5 @@
    //else: template "text", so no reply prefix at all
 
-   *value = ExpandOriginalText(m_msgview->GetText(), prefix, m_profile);
+   *value = ExpandOriginalText(m_textToQuote, prefix, m_profile);
 }
 
@@ -1549,17 +1545,8 @@
                            const String& templateValue,
                            Message *msg,
-                           const MessageView *msgview)
+                           const String& textToQuote)
 {
-   // we need to show text in the message view to be able to quote it
-   if ( msg && msgview )
-   {
-      const_cast<MessageView *>(msgview)->ShowMessage(msg->GetUId());
-
-      // needed for the message to appear in the message view (FIXME)
-      MEventManager::DispatchPending();
-   }
-
    ExpansionSink sink;
-   VarExpander expander(sink, cv, profile, msg, msgview);
+   VarExpander expander(sink, cv, profile, msg, textToQuote);
    MessageTemplateParser parser(templateValue, _("template"), &expander);
    if ( !parser.Parse(sink) )



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to