]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/encconv.cpp
compilation warning fixes (patch 625810)
[wxWidgets.git] / src / common / encconv.cpp
index 9c7d0d3ee6a929896a3b446a08ad871118112607..759dd58fa5549b8ebd9e58c45f7dd90a89cb8c36 100644 (file)
@@ -23,9 +23,6 @@
 #include "wx/encconv.h"
 
 #include <stdlib.h>
-#ifdef __WINE__
-#include <search.h>
-#endif
 
 // conversion tables, generated by scripts in $(WXWIN)/misc/unictabl:
 #ifdef __BORLANDC__
@@ -386,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)
 {
@@ -415,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++;
@@ -445,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++;