X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8715875f72af75123d13bb69d6ec6b185f568ea9..ad02525dadb780a4bacb6482ac633e90a10fe25c:/utils/tex2rtf/src/texutils.cpp diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 349d232b42..58d5bb7076 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -41,10 +41,8 @@ using namespace std; #include #include "tex2any.h" -#if !WXWIN_COMPATIBILITY_2_4 static inline wxChar* copystring(const wxChar* s) { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } -#endif wxHashTable TexReferences(wxKEY_STRING); wxList BibList(wxKEY_STRING); @@ -209,7 +207,7 @@ wxChar *FindTopicName(TexChunk *chunk) * */ -void StartSimulateArgument(wxChar *data) +void StartSimulateArgument(const wxChar *data) { wxStrcpy(currentArgData, data); haveArgData = true; @@ -225,8 +223,11 @@ void EndSimulateArgument(void) * */ -int ParseUnitArgument(wxChar *unitArg) +int ParseUnitArgument(const wxChar *unitArg_) { + wxWxCharBuffer unitBuf(unitArg_); + wxChar *unitArg = unitBuf.data(); + float conversionFactor = 1.0; float unitValue = 0.0; int len = wxStrlen(unitArg); @@ -472,7 +473,7 @@ void BibEatWhiteSpace(wxString& line) { while(!line.empty() && (line[0] == _T(' ') || line[0] == _T('\t') || line[0] == (wxChar)EOF)) { - if (line[0] == 10) + if (line[0] == '\r') BibLine ++; line = line.substr(1); } @@ -562,7 +563,7 @@ wxString BibReadToEOL(wxString& line) // If in quotes, read white space too. If not, // stop at white space or comment. while (!line.empty() && line[0] != _T('"') && - (inQuotes || ((line[0] != _T(' ')) && (line[0] != 9) && + (inQuotes || ((line[0] != _T(' ')) && (line[0] != '\t') && (line[0] != _T(';')) && (line[0] != _T('%')) && (line[0] != _T('#'))))) { val << line[0]; @@ -706,7 +707,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true, wxUnusedVar(stopping); } -bool ReadBib(wxChar *filename) +bool ReadBib(const wxChar *filename) { if (!wxFileExists(filename)) return false; @@ -1158,7 +1159,7 @@ void ResolveBibReferences(void) } // Remember we need to resolve this citation -void AddCitation(wxChar *citeKey) +void AddCitation(const wxChar *citeKey) { if (!CitationList.Member(citeKey)) CitationList.Add(citeKey); @@ -1169,7 +1170,7 @@ void AddCitation(wxChar *citeKey) } } -TexRef *FindReference(wxChar *key) +TexRef *FindReference(const wxChar *key) { return (TexRef *)TexReferences.Get(key); } @@ -1185,6 +1186,7 @@ bool StringTobool(const wxString& val) up.MakeUpper(); if (up.IsSameAs(_T("YES")) || + up.IsSameAs(_T("TRUE")) || up.IsSameAs(_T("ON")) || up.IsSameAs(_T("OK")) | up.IsSameAs(_T("1")))