X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d257b8db10b5f464d896ff0d4249237d8f587a1..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/gtk1/utilsres.cpp diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index 45bdc9fec1..f8f41519a6 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utilres.cpp +// Name: src/gtk1/utilsres.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,11 +11,15 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/string.h" -#include "wx/list.h" -#include "wx/log.h" + +#ifndef WX_PRECOMP + #include "wx/list.h" + #include "wx/string.h" + #include "wx/log.h" + #include "wx/app.h" +#endif + #include "wx/config.h" -#include "wx/app.h" //----------------------------------------------------------------------------- // resource functions @@ -24,7 +28,7 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file ) { wxString filename( file ); - if (filename.IsEmpty()) filename = wxT(".wxWindows"); + if (filename.empty()) filename = wxT(".wxWindows"); wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename ); @@ -60,7 +64,7 @@ bool wxWriteResource(const wxString& section, const wxString& entry, int value, bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file ) { wxString filename( file ); - if (filename.IsEmpty()) filename = wxT(".wxWindows"); + if (filename.empty()) filename = wxT(".wxWindows"); wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename ); @@ -69,16 +73,16 @@ bool wxGetResource(const wxString& section, const wxString& entry, wxChar **valu wxString result; if (conf.Read( entry, &result )) { - if (!result.IsEmpty()) + if (!result.empty()) { wxChar *s = new wxChar[result.Len()+1]; wxStrcpy( s, result.c_str() ); *value = s; - return TRUE; + return true; } } - return FALSE; + return false; } bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file ) @@ -87,11 +91,11 @@ bool wxGetResource(const wxString& section, const wxString& entry, float *value, bool succ = wxGetResource(section, entry, (wxChar **)&s, file); if (succ) { - *value = (float)wxStrtod(s, NULL); + *value = (float)wxStrtod(s, (wchar_t **) NULL); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file ) @@ -100,11 +104,11 @@ bool wxGetResource(const wxString& section, const wxString& entry, long *value, bool succ = wxGetResource(section, entry, (wxChar **)&s, file); if (succ) { - *value = wxStrtol(s, NULL, 10); + *value = wxStrtol(s, (wchar_t **) NULL, 10); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file ) @@ -113,10 +117,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c bool succ = wxGetResource(section, entry, (wxChar **)&s, file); if (succ) { - *value = (int)wxStrtol(s, NULL, 10); + *value = (int)wxStrtol(s, (wchar_t **) NULL, 10); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } -