]> git.saurik.com Git - wxWidgets.git/commitdiff
wxString and wxChar* access for file functions. Source cleaning.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 21 Dec 2004 17:35:42 +0000 (17:35 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 21 Dec 2004 17:35:42 +0000 (17:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/opengl/isosurf/isosurf.cpp
src/generic/dcpsg.cpp
src/generic/helpext.cpp

index 95485de92ddabfef8f91076774101d1cd4f3f44b..2cc7b686dd500d38db1164d302c075c8a2c15109 100644 (file)
@@ -77,7 +77,7 @@ static GLfloat yrot;
 
 static void read_surface( const wxChar *filename )
 {
-    FILE *f = wxFopen(filename,_T("r"));
+    FILE *f = wxFopen(wxFNCONV(filename),_T("r"));
     if (!f)
     {
         wxString msg = _T("Couldn't read ");
index bcd73beb2623e247a4dfe8a31c7ccfa333b3688a..c978aa2b24f1015a303363d7a20295df00baf015 100644 (file)
@@ -1561,8 +1561,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
             m_printData.SetFilename(filename);
         }
 
-        // FIXME: use fn_str() here under Unicode?
-        m_pstream = wxFopen( m_printData.GetFilename().c_str(), wxT("w+") );
+        m_pstream = wxFopen( m_printData.GetFilename().fn_str(), wxT("w+") );
 
         if (!m_pstream)
         {
@@ -1972,7 +1971,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         {
             afmName = data->GetFontMetricPath();
             afmName << wxFILE_SEP_PATH << name;
-            afmFile = wxFopen(afmName,wxT("r"));
+            afmFile = wxFopen(afmName.fn_str(),wxT("r"));
         }
 
 #if defined(__UNIX__) && !defined(__VMS__)
@@ -1986,7 +1985,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
                    << wxT("afm") << wxFILE_SEP_PATH
 #endif
                    << name;
-           afmFile = wxFopen(afmName,wxT("r"));
+           afmFile = wxFopen(afmName.fn_str(),wxT("r"));
         }
 #endif
 
index 78a30c12aea3984c4c9e7cba715252f0f78ad3d5..8a07d4648c032c0617b07f706620fefdc9a45fad 100644 (file)
@@ -231,7 +231,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
 
    wxBusyCursor b; // display a busy cursor
 
-   if(! ifile.IsEmpty())
+   if(! ifile.empty())
    {
       file = ifile;
       if(! wxIsAbsolutePath(file))
@@ -254,7 +254,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
       // set to be "de", then look in "/usr/local/myapp/help/de/"
       // first and fall back to "/usr/local/myapp/help" if that
       // doesn't exist.
-      if(wxGetLocale() && !wxGetLocale()->GetName().IsEmpty())
+      if(wxGetLocale() && !wxGetLocale()->GetName().empty())
       {
          wxString newfile;
          newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName();
@@ -287,7 +287,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
    m_MapList = new wxList;
    m_NumOfEntries = 0;
 
-   FILE *input = wxFopen(mapFile,wxT("rt"));
+   FILE *input = wxFopen(mapFile.fn_str(),wxT("rt"));
    if(! input)
       return false;
    do
@@ -401,7 +401,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
 
    int          idx = 0, j;
    bool         rc;
-   bool         showAll = k.IsEmpty();
+   bool         showAll = k.empty();
    wxList::compatibility_iterator node = m_MapList->GetFirst();
    wxExtHelpMapEntry *entry;
 
@@ -412,12 +412,12 @@ wxExtHelpController::KeywordSearch(const wxString& k,
       {
          entry = (wxExtHelpMapEntry *)node->GetData();
          compB = entry->doc; compB.LowerCase();
-         if((showAll || compB.Contains(k)) && ! compB.IsEmpty())
+         if((showAll || compB.Contains(k)) && ! compB.empty())
          {
             urls[idx] = entry->url;
             // doesn't work:
             // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR));
-            //if(choices[idx].IsEmpty()) // didn't contain the ';'
+            //if(choices[idx].empty()) // didn't contain the ';'
             //   choices[idx] = (**i).doc;
             choices[idx] = wxEmptyString;
             for(j=0;entry->doc.c_str()[j]