]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/encconv.cpp
added support for POST method and alternate ports (part of patch 649438)
[wxWidgets.git] / src / common / encconv.cpp
index b4e88adf639374b3417bd43b4d2c548f19f509c5..759dd58fa5549b8ebd9e58c45f7dd90a89cb8c36 100644 (file)
@@ -276,7 +276,8 @@ wxString wxEncodingConverter::Convert(const wxString& input)
     wxString s;
     const wxChar *i;
 
-    wxCHECK_RET(m_Table != NULL, wxT("You must call wxEncodingConverter::Init() before actually converting!"));
+    wxCHECK_MSG(m_Table != NULL, s,
+                wxT("You must call wxEncodingConverter::Init() before actually converting!"));
 
     if (m_UnicodeInput)
     {
@@ -382,7 +383,14 @@ static wxFontEncoding
 };
 
 
-
+static bool FindEncoding(const wxFontEncodingArray& arr, wxFontEncoding f)
+{
+    for (wxFontEncodingArray::const_iterator it = arr.begin(), en = arr.end();
+         it != en; ++it)
+        if (*it == f)
+            return true;
+    return false;
+}
 
 wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding enc, int platform)
 {
@@ -411,9 +419,9 @@ wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding e
                 if (EquivalentEncodings[clas][i][e] == enc)
                 {
                     for (f = EquivalentEncodings[clas][platform]; *f != STOP; f++)
-                        if (*f == enc) arr.Add(enc);
+                        if (*f == enc) arr.push_back(enc);
                     for (f = EquivalentEncodings[clas][platform]; *f != STOP; f++)
-                        if (arr.Index(*f) == wxNOT_FOUND) arr.Add(*f);
+                        if (!FindEncoding(arr, *f)) arr.push_back(*f);
                     i = NUM_OF_PLATFORMS/*hack*/; break;
                 }
         clas++;
@@ -441,7 +449,7 @@ wxFontEncodingArray wxEncodingConverter::GetAllEquivalents(wxFontEncoding enc)
                 {
                     for (j = 0; j < NUM_OF_PLATFORMS; j++)
                         for (f = EquivalentEncodings[clas][j]; *f != STOP; f++)
-                            if (arr.Index(*f) == wxNOT_FOUND) arr.Add(*f);
+                            if (!FindEncoding(arr, *f)) arr.push_back(*f);
                     i = NUM_OF_PLATFORMS/*hack*/; break;
                 }
         clas++;