X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc25a89ac1e6c5208db24bfc0abc8666b791dc6..ccdcde00d9ae27ca20ff6c3c9495918a0ec725aa:/contrib/src/ogl/ogldiag.cpp diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 6698e5b143..f5b880414b 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -14,7 +14,7 @@ #endif // For compilers that support precompilation, includes "wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -26,6 +26,10 @@ #include +#ifdef new +#undef new +#endif + #if wxUSE_IOSTREAMH #include #include @@ -33,7 +37,7 @@ #include #include #ifdef _MSC_VER -using namespace std; +//using namespace std; #endif #endif @@ -253,9 +257,9 @@ bool wxDiagram::SaveFile(const wxString& filename) } OnDatabaseSave(*database); - char tempFile[400]; - wxGetTempFileName("diag", tempFile); - FILE* file = fopen(tempFile, "w"); + wxString tempFile; + wxGetTempFileName(wxT("diag"), tempFile); + FILE* file = fopen(tempFile.mb_str(wxConvFile), "w"); if (! file) { wxEndBusyCursor(); @@ -346,11 +350,11 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) wxExpr *clause = database.FindClauseByFunctor("shape"); while (clause) { - char *type = NULL; + wxChar *type = NULL; long parentId = -1; - clause->AssignAttributeValue("type", &type); - clause->AssignAttributeValue("parent", &parentId); + clause->AssignAttributeValue(wxT("type"), &type); + clause->AssignAttributeValue(wxT("parent"), &parentId); wxClassInfo *classInfo = wxClassInfo::FindClass(type); if (classInfo) { @@ -390,12 +394,12 @@ void wxDiagram::ReadLines(wxExprDatabase& database) wxExpr *clause = database.FindClauseByFunctor("line"); while (clause) { - wxString type(""); + wxString type; long parentId = -1; clause->GetAttributeValue("type", type); clause->GetAttributeValue("parent", parentId); - wxClassInfo *classInfo = wxClassInfo::FindClass((char*) (const char*) type); + wxClassInfo *classInfo = wxClassInfo::FindClass(type); if (classInfo) { wxLineShape *shape = (wxLineShape *)classInfo->CreateObject();