]> git.saurik.com Git - wxWidgets.git/commitdiff
More replacements of strcmp -> wxStr..
authorRobert Roebling <robert@roebling.de>
Sun, 7 Nov 1999 16:08:25 +0000 (16:08 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 7 Nov 1999 16:08:25 +0000 (16:08 +0000)
  Minor change in font code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filefn.cpp
src/common/intl.cpp
src/common/object.cpp
src/common/utilscmn.cpp
src/generic/dcpsg.cpp
src/unix/fontutil.cpp

index d65147d76d48dddb784ff2c8f795cfa34b2f5487..0783aa903d3285a874dfd9094f9e29b1ae785f88 100644 (file)
@@ -81,8 +81,6 @@
     #ifndef __TWIN32__
         #include <sys/unistd.h>
     #endif
-
-    #define stricmp strcasecmp
 #endif
 
 #ifdef __BORLANDC__ // Please someone tell me which version of Borland needs
index 42e9ff74d4cfec7f5fbeaba0f38adb8defb68f26..117271939001bed827cfd47d7f726517ef88e64f 100644 (file)
@@ -423,7 +423,7 @@ const char *wxMsgCatalog::GetString(const char *szOrig) const
       if ( nStr == 0 )
         return NULL;
 
-      if ( strcmp(szOrig, StringAtOfs(m_pOrigTable, nStr - 1)) == 0 )
+      if ( wxStrcmp(szOrig, StringAtOfs(m_pOrigTable, nStr - 1)) == 0 )
         return StringAtOfs(m_pTransTable, nStr - 1);
 
       if ( nIndex >= m_nHashSize - nIncr)
@@ -438,7 +438,7 @@ const char *wxMsgCatalog::GetString(const char *szOrig) const
            current;
     while ( bottom < top ) {
       current = (bottom + top) / 2;
-      int res = strcmp(szOrig, StringAtOfs(m_pOrigTable, current));
+      int res = wxStrcmp(szOrig, StringAtOfs(m_pOrigTable, current));
       if ( res < 0 )
         top = current;
       else if ( res > 0 )
index 0672600cf98e741c88fbafce2b1c3db102d43222..9f7e1913ee85f2e3c83aa8bc7f12d9821c8a9878 100644 (file)
@@ -205,7 +205,7 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info) const
     // PROBABLY NO LONGER TRUE now I've done DLL creation right.
     /*
 #if WXMAKINGDLL
-if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
+if (GetClassName() && info->GetClassName() && (wxStrcmp(GetClassName(), info->GetClassName()) == 0))
 return TRUE;
 #else
      */
index a96372e00dc051199f4443f2edc97706e4a1a901..5aef920b31ecbb171be4820cba97a0828ca5e2a0 100644 (file)
@@ -151,7 +151,7 @@ int strcasecmp(const char *str_1, const char *str_2)
   myLowerString(temp1);
   myLowerString(temp2);
 
-  int result = strcmp(temp1,temp2);
+  int result = wxStrcmp(temp1,temp2);
   delete[] temp1;
   delete[] temp2;
 
index 825e079caad1dbb9ea72667b20ebc24a68a71a0c..bc1b78711d279541166d00574f28a83de206b8bb 100644 (file)
@@ -1876,54 +1876,54 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
             while(fgets(line,sizeof(line),afmFile)!=NULL)
             {
                 /* A.) check for descender definition */
-                if (strncmp(line,"Descender",9)==0)
+                if (wxStrncmp(line,"Descender",9)==0)
                 {
                     if ((sscanf(line,"%s%d",descString,&lastDescender)!=2) ||
-                            (strcmp(descString,"Descender")!=0))
+                            (wxStrcmp(descString,"Descender")!=0))
                     {
                         wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad descender)\n"), afmName.c_str(),line );
                     }
                 }
                 /* JC 1.) check for UnderlinePosition */
-                else if(strncmp(line,"UnderlinePosition",17)==0)
+                else if(wxStrncmp(line,"UnderlinePosition",17)==0)
                 {
                     if ((sscanf(line,"%s%lf",upString,&UnderlinePosition)!=2) ||
-                            (strcmp(upString,"UnderlinePosition")!=0))
+                            (wxStrcmp(upString,"UnderlinePosition")!=0))
                     {
                         wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlinePosition)\n"), afmName.c_str(), line );
                     }
                 }
                 /* JC 2.) check for UnderlineThickness */
-                else if(strncmp(line,"UnderlineThickness",18)==0)
+                else if(wxStrncmp(line,"UnderlineThickness",18)==0)
                 {
                     if ((sscanf(line,"%s%lf",utString,&UnderlineThickness)!=2) ||
-                            (strcmp(utString,"UnderlineThickness")!=0))
+                            (wxStrcmp(utString,"UnderlineThickness")!=0))
                     {
                         wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlineThickness)\n"), afmName.c_str(), line );
                     }
                 }
                 /* JC 3.) check for EncodingScheme */
-                else if(strncmp(line,"EncodingScheme",14)==0)
+                else if(wxStrncmp(line,"EncodingScheme",14)==0)
                 {
                     if ((sscanf(line,"%s%s",utString,encString)!=2) ||
-                            (strcmp(utString,"EncodingScheme")!=0))
+                            (wxStrcmp(utString,"EncodingScheme")!=0))
                     {
                         wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad EncodingScheme)\n"), afmName.c_str(), line );
                     }
-                    else if (strncmp(encString, "AdobeStandardEncoding", 21))
+                    else if (wxStrncmp(encString, "AdobeStandardEncoding", 21))
                     {
                         wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (unsupported EncodingScheme %hs)\n"),
                                 afmName.c_str(),line, encString);
                     }
                 }
                 /* B.) check for char-width */
-                else if(strncmp(line,"C ",2)==0)
+                else if(wxStrncmp(line,"C ",2)==0)
                 {
                     if (sscanf(line,"%s%d%s%s%d",cString,&ascii,semiString,WXString,&cWidth)!=5)
                     {
                         wxLogDebug(wxT("AFM-file '%hs': line '%hs' has an error (bad character width)\n"),afmName.c_str(),line);
                     }
-                    if(strcmp(cString,"C")!=0 || strcmp(semiString,";")!=0 || strcmp(WXString,"WX")!=0)
+                    if(wxStrcmp(cString,"C")!=0 || wxStrcmp(semiString,";")!=0 || wxStrcmp(WXString,"WX")!=0)
                     {
                         wxLogDebug(wxT("AFM-file '%hs': line '%hs' has a format error\n"),afmName.c_str(),line);
                     }
index 774dd534bd46e8020038e41848d35e0d6572ea2e..cdf3cd009866dddc5094f4d1b5271f414a9f4e60 100644 (file)
@@ -184,7 +184,7 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
 
         case wxFONTENCODING_SYSTEM:
             info->xregistry =
-            info->xencoding = wxT('*');
+            info->xencoding = wxT("*");
             break;
 
         default:
@@ -222,20 +222,29 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize,
     // encoding, it's useless to do all other approximations (i.e. size,
     // family &c don't matter much)
     wxNativeEncodingInfo info;
-    if ( !wxGetNativeFontEncoding(encoding, &info) ||
-         !wxTestFontEncoding(info) )
+    if (encoding == wxFONTENCODING_SYSTEM)
+    {
+        // This will always work so we don't test to save time
+        wxGetNativeFontEncoding(wxFONTENCODING_SYSTEM, &info);
+    }
+    else
     {
-        if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+        if ( !wxGetNativeFontEncoding(encoding, &info) ||
+             !wxTestFontEncoding(info) )
         {
-            // unspported encoding - replace it with the default
-            //
-            // NB: we can't just return 0 from here because wxGTK code doesn't
-            //     check for it (i.e. it supposes that we'll always succeed),
-            //     so it would provoke a crash
-            wxGetNativeFontEncoding(wxFONTENCODING_SYSTEM, &info);
-        }
+            if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) )
+            {
+                // unspported encoding - replace it with the default
+                //
+                // NB: we can't just return 0 from here because wxGTK code doesn't
+                //     check for it (i.e. it supposes that we'll always succeed),
+                //     so it would provoke a crash
+                wxGetNativeFontEncoding(wxFONTENCODING_SYSTEM, &info);
+            }
+       }
     }
-    //else: we have the correct xregistry/xencoding in info structure
+    
+    // OK, we have the correct xregistry/xencoding in info structure
 
     wxNativeFont font = wxLoadQueryFont( pointSize, family, style, weight,
                                          underlined, facename,