X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a29912f608e082001ee53b9873323c4bcd71f21..008270942921dba2c5e725504ea5cf652418e142:/utils/tex2rtf/src/readshg.cpp diff --git a/utils/tex2rtf/src/readshg.cpp b/utils/tex2rtf/src/readshg.cpp index 2a62d48bc5..6d3ffaff2b 100644 --- a/utils/tex2rtf/src/readshg.cpp +++ b/utils/tex2rtf/src/readshg.cpp @@ -6,7 +6,8 @@ // reverse-engineering // and guesswork at its best. // Author: Petr Smilauer -// Modified by: +// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support +// Ron Lee // Created: 01/01/99 // RCS-ID: $Id$ // Copyright: (c) Petr Smilauer @@ -25,7 +26,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include @@ -39,8 +39,8 @@ // HotSpots *array; // int n = ParseSHG("thing.shg", &array); -int ParseSHG( const char* fileName, HotSpot **hotspots) -{ FILE* fSHG = fopen( fileName, "rb"); +int ParseSHG( const wxChar* fileName, HotSpot **hotspots) +{ FILE* fSHG = wxFopen( fileName, _T("rb")); long offset; int nHotspots = 0; @@ -111,53 +111,53 @@ int ParseSHG( const char* fileName, HotSpot **hotspots) // Convert Windows .SHG file to HTML map file -bool SHGToMap(char *filename, char *defaultFile) +bool SHGToMap(wxChar *filename, wxChar *defaultFile) { // Test the SHG parser HotSpot *hotspots = NULL; int n = ParseSHG(filename, &hotspots); if (n == 0) - return FALSE; + return false; - char buf[100]; - sprintf(buf, "Converting .SHG file to HTML map file: there are %d hotspots in %s.", n, filename); + wxChar buf[100]; + wxSnprintf(buf, sizeof(buf), _T("Converting .SHG file to HTML map file: there are %d hotspots in %s."), n, filename); OnInform(buf); - char outBuf[256]; - strcpy(outBuf, filename); + wxChar outBuf[256]; + wxStrcpy(outBuf, filename); StripExtension(outBuf); - strcat(outBuf, ".map"); + wxStrcat(outBuf, _T(".map")); - FILE *fd = fopen(outBuf, "w"); + FILE *fd = wxFopen(outBuf, _T("w")); if (!fd) { - OnError("Could not open .map file for writing."); + OnError(_T("Could not open .map file for writing.")); delete[] hotspots; - return FALSE; + return false; } - fprintf(fd, "default %s\n", defaultFile); + wxFprintf(fd, _T("default %s\n"), defaultFile); for (int i = 0; i < n; i++) { - char *refFilename = "??"; + wxChar *refFilename = _T("??"); TexRef *texRef = FindReference(hotspots[i].szHlpTopic_Macro); if (texRef) refFilename = texRef->refFile; else { - char buf[300]; - sprintf(buf, "Warning: could not find hotspot reference %s", hotspots[i].szHlpTopic_Macro); + wxChar buf[300]; + wxSnprintf(buf, sizeof(buf), _T("Warning: could not find hotspot reference %s"), hotspots[i].szHlpTopic_Macro); OnInform(buf); } - fprintf(fd, "rect %s %d %d %d %d\n", refFilename, (int)hotspots[i].left, (int)hotspots[i].top, + wxFprintf(fd, _T("rect %s %d %d %d %d\n"), refFilename, (int)hotspots[i].left, (int)hotspots[i].top, (int)hotspots[i].right, (int)hotspots[i].bottom); } - fprintf(fd, "\n"); + wxFprintf(fd, _T("\n")); fclose(fd); delete[] hotspots; - return TRUE; + return true; }