X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd107c50be43e8d4dbdba20df162faf119a3781c..667e2c55eab8820efc2e7dc06611724641e9bcf3:/contrib/src/ogl/ogldiag.cpp?ds=sidebyside diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 2eac01591a..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 @@ -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();