From c988c5b21b0a6fb3577e2d7f0df2e5b341e32c3c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 15 Nov 2004 17:11:37 +0000 Subject: [PATCH] RC parse fixes from Michael Shamgar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/utils/convertrc/rc2xml.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/contrib/utils/convertrc/rc2xml.cpp b/contrib/utils/convertrc/rc2xml.cpp index ca5adde3c4..7cd81a8a68 100644 --- a/contrib/utils/convertrc/rc2xml.cpp +++ b/contrib/utils/convertrc/rc2xml.cpp @@ -438,17 +438,35 @@ wxString rc2xml::GetQuoteField() wxString phrase; //ASCII code 34 " int ch=0; + int ch1=0; + ReadChar(ch); + // !! Changed by MS, 15th/11/04. Can now read strings such as + // """Catapult"" - blah blah", ... + while (ch!=34) ReadChar(ch); - ReadChar(ch); - while (ch!=34) + // found first '"' + while (true) { - phrase+=(char)ch; - ReadChar(ch); + ReadChar(ch); + if (ch == 34) + { + // another quote? + ReadChar(ch1); + if (ch1 != 34) + { + // real end of string.. + break; + } + + // add a single quote - fall through + } + phrase+=(char)ch; } + return phrase; } @@ -777,6 +795,9 @@ name=LookUpId(name); void rc2xml::WriteLabel(wxString label) { label.Replace(_T("&"),_T("$")); + // changes by MS, handle '<' '>' characters within a label. + label.Replace("<","<"); + label.Replace(">",">"); m_xmlfile.Write(_T("\t\t\t\n")); } -- 2.45.2