added \ escaping in XRC (patch 1042675)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -788,14 +788,34 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
|
||||
else
|
||||
str2 << wxT('&') << *dt;
|
||||
}
|
||||
// Remap \n to CR, \r to LF, \t to TAB:
|
||||
// Remap \n to CR, \r to LF, \t to TAB, \\ to \:
|
||||
else if (*dt == wxT('\\'))
|
||||
switch (*(++dt))
|
||||
{
|
||||
case wxT('n') : str2 << wxT('\n'); break;
|
||||
case wxT('t') : str2 << wxT('\t'); break;
|
||||
case wxT('r') : str2 << wxT('\r'); break;
|
||||
default : str2 << wxT('\\') << *dt; break;
|
||||
case wxT('n'):
|
||||
str2 << wxT('\n');
|
||||
break;
|
||||
|
||||
case wxT('t'):
|
||||
str2 << wxT('\t');
|
||||
break;
|
||||
|
||||
case wxT('r'):
|
||||
str2 << wxT('\r');
|
||||
break;
|
||||
|
||||
case wxT('\\') :
|
||||
// "\\" wasn't translated to "\" prior to 2.5.3.0:
|
||||
if (m_resource->CompareVersion(2,5,3,0) >= 0)
|
||||
{
|
||||
str2 << wxT('\\');
|
||||
break;
|
||||
}
|
||||
// else fall-through to default: branch below
|
||||
|
||||
default:
|
||||
str2 << wxT('\\') << *dt;
|
||||
break;
|
||||
}
|
||||
else str2 << *dt;
|
||||
}
|
||||
|
Reference in New Issue
Block a user