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

Modified Files:
        wxFolderView.cpp wxMessageView.cpp wxlparser.cpp 
Log Message:
repackaged Nerijus' changes in a cleaner way


Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.580
retrieving revision 1.581
diff -b -u -2 -r1.580 -r1.581
--- wxFolderView.cpp    16 Apr 2002 16:03:15 -0000      1.580
+++ wxFolderView.cpp    16 Apr 2002 19:15:33 -0000      1.581
@@ -2853,5 +2853,5 @@
       if ( encoding == wxFONTENCODING_UTF8 || encoding == wxFONTENCODING_UTF7 )
       {
-         encoding = ConvertUnicodeToSystem(&text, encoding == wxFONTENCODING_UTF7);
+         encoding = ConvertUnicodeToSystem(&text, encoding);
       }
 

Index: wxMessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMessageView.cpp,v
retrieving revision 1.277
retrieving revision 1.278
diff -b -u -2 -r1.277 -r1.278
--- wxMessageView.cpp   16 Apr 2002 16:03:16 -0000      1.277
+++ wxMessageView.cpp   16 Apr 2002 19:15:34 -0000      1.278
@@ -72,10 +72,4 @@
 #include <wx/splitter.h>
 
-#include "Mcclient.h"
-extern "C"
-{
-   #include "utf8.h"  // for utf8_text_utf7()
-}
-
 // ----------------------------------------------------------------------------
 // options we use here
@@ -558,62 +552,2 @@
 }
 
-// convert a string in UTF-8 or 7 into the string in the current encoding: of
-// course, this doesn't work in general as Unicode is not representable as an 8
-// bit charset but it works in some common cases and is better than no UTF-8
-// support at all
-//
-// FIXME this won't be needed when full Unicode support is available
-extern wxFontEncoding ConvertUnicodeToSystem(wxString *strUtf, bool isUTF7)
-{
-   CHECK( strUtf, wxFONTENCODING_SYSTEM,
-          "NULL string in ConvertUnicodeToSystem" );
-
-   if ( !strUtf->empty() )
-   {
-      if ( isUTF7 )
-      {
-         //wxWindows does not support UTF-7 yet, so we first convert
-         //UTF-7 to UTF-8 using c-client function and then convert
-         //UTF-8 to current environment's encoding.
-
-         SIZEDTEXT *text7 = new SIZEDTEXT;
-        SIZEDTEXT *text8 = new SIZEDTEXT;
-         text7->data = (unsigned char *) strUtf->c_str();
-        text7->size = strUtf->Length();
-
-         // cclient doesn't use the table parameter in utf8_text_utf7
-         // function but still has it (for future extensions? or just
-         // because other conversion functions have it?)
-        void *tab = NULL;
-        utf8_text_utf7 ( text7, text8, tab );
-        strUtf->Empty();
-
-         // we cannot use "*strUtf << text8->data" here as utf8_text_utf7()
-         // returns text8->data which is longer than text8->size:
-        for ( unsigned long k = 0; k < text8->size; k++ )
-        {
-            *strUtf << wxChar(text8->data[k]);
-        }
-        free(text7);
-        free(text8);
-      }
-
-      wxString str(strUtf->wc_str(wxConvUTF8), wxConvLocal);
-      if ( str.empty() )
-      {
-         // conversion failed - use original text (and display incorrectly,
-         // unfortunately)
-         wxLogDebug("conversion from UTF-8 to default encoding failed");
-      }
-      else
-      {
-         *strUtf = str;
-      }
-   }
-
-#if wxUSE_INTL
-   return wxLocale::GetSystemEncoding();
-#else // !wxUSE_INTL
-   return wxFONTENCODING_ISO8859_1;
-#endif // wxUSE_INTL/!wxUSE_INTL
-}

Index: wxlparser.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxlparser.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -u -2 -r1.50 -r1.51
--- wxlparser.cpp       16 Apr 2002 16:03:17 -0000      1.50
+++ wxlparser.cpp       16 Apr 2002 19:15:34 -0000      1.51
@@ -19,17 +19,14 @@
 #include "Mpch.h"
 
-#ifdef M_PREFIX
-#   include "gui/wxllist.h"
-#   include "gui/wxlparser.h"
-#else
-#   include "wxllist.h"
-#   include "wxlparser.h"
+#ifndef USE_PCH
+#   include "strutil.h"    // for ConvertUnicodeToSystem()
 #endif
 
+#include "gui/wxllist.h"
+#include "gui/wxlparser.h"
+
 #include <wx/fontmap.h>
 #include <wx/encconv.h>
 
-#include "MessageView.h" // ConvertUnicodeToSystem()
-
 #define   BASE_SIZE 12
 
@@ -190,5 +187,5 @@
    {
       // Convert from UTF-8|7 to environment's default encoding
-      encoding = ConvertUnicodeToSystem(&str, encoding == wxFONTENCODING_UTF7);
+      encoding = ConvertUnicodeToSystem(&str, encoding);
    }
 


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

Reply via email to