Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv9817/src/gui

Modified Files:
        wxComposeView.cpp 
Log Message:
when editing a message with attachments in the ext editor the attachments don't get in 
front of the text

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.247
retrieving revision 1.248
diff -b -u -2 -r1.247 -r1.248
--- wxComposeView.cpp   22 Feb 2002 19:55:40 -0000      1.247
+++ wxComposeView.cpp   25 Feb 2002 20:15:54 -0000      1.248
@@ -2716,5 +2716,6 @@
 
    // insert the text in the beginning of the message replacing the old
-   // text if asked for this
+   // text if asked for this, otherwise just append it at the end
+   wxLayoutList *listNonTextObjects = NULL;
    if ( replaceFirstTextPart )
    {
@@ -2741,6 +2742,5 @@
       // objects, so now we must delete them and then recreate the new ones...
 
-      wxLayoutList * layoutList = m_LayoutWindow->GetLayoutList();
-      wxLayoutList * other_list = new wxLayoutList;
+      wxLayoutList *layoutList = m_LayoutWindow->GetLayoutList();
       wxLayoutObject *obj;
       wxLayoutExportStatus status(layoutList);
@@ -2748,32 +2748,19 @@
       while( (exp = wxLayoutExport(&status, WXLO_EXPORT_AS_OBJECTS)) != NULL )
       {
-         // ignore WXLO_EXPORT_EMPTYLINE:
-         if(exp->type == WXLO_EXPORT_OBJECT)
+         if ( exp->type == WXLO_EXPORT_OBJECT )
          {
             obj = exp->content.object;
-            switch(obj->GetType())
+            if ( obj->GetType() == WXLO_TYPE_ICON )
             {
-            case WXLO_TYPE_TEXT:
-               ; //    do nothing
-               break;
-            case WXLO_TYPE_ICON:
-               other_list->Insert(obj->Copy());
-               break;
-            default:
-               ; // cmd    objects get ignored
+               if ( !listNonTextObjects )
+                  listNonTextObjects = new wxLayoutList;
+
+               listNonTextObjects->Insert(obj->Copy());
             }
+            //else: ignore text and cmd objects
          }
          delete exp;
       }
       layoutList->Empty();
-      //now we move the non-text objects back:
-      wxLayoutExportStatus status2(other_list);
-      while((exp = wxLayoutExport( &status2,
-                                      WXLO_EXPORT_AS_OBJECTS)) != NULL)
-         if(exp->type == WXLO_EXPORT_EMPTYLINE)
-            layoutList->LineBreak();
-         else
-            layoutList->Insert(exp->content.object->Copy());
-      delete other_list;
    }
 
@@ -2785,4 +2772,20 @@
    m_LayoutWindow->Refresh();
    delete [] text;
+
+   // and insert the non-text objects back if we had removed them
+   if ( listNonTextObjects )
+   {
+      wxLayoutList *layoutList = m_LayoutWindow->GetLayoutList();
+      wxLayoutExportObject *exp;
+      wxLayoutExportStatus status2(listNonTextObjects);
+      while((exp = wxLayoutExport( &status2,
+                                      WXLO_EXPORT_AS_OBJECTS)) != NULL)
+         if(exp->type == WXLO_EXPORT_EMPTYLINE)
+            layoutList->LineBreak();
+         else
+            layoutList->Insert(exp->content.object->Copy());
+      delete listNonTextObjects;
+   }
+
    return true;
 }


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to