From f50a1c3d667fb948bfbdcbd4b3021d896c6635cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 21 Dec 2004 17:35:42 +0000 Subject: [PATCH] wxString and wxChar* access for file functions. Source cleaning. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/opengl/isosurf/isosurf.cpp | 2 +- src/generic/dcpsg.cpp | 7 +++---- src/generic/helpext.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index 95485de92d..2cc7b686dd 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -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 "); diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index bcd73beb26..c978aa2b24 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -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 diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 78a30c12ae..8a07d4648c 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -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] -- 2.45.2