backported small part of wxrcedit improvements patch into 2.4.0 -- correctly setting encoding and version on newly created files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-12-21 13:34:09 +00:00
parent 19ca811a88
commit b591964667

View File

@@ -92,7 +92,7 @@ void wxXmlRcEditDocument::Upgrade()
UpgradeNode(node);
}
node->DeleteProperty(wxT("version"));
node->AddProperty(wxT("version"), wxT(WX_XMLRES_CURRENT_VERSION_STRING));
node->AddProperty(wxT("version"), WX_XMLRES_CURRENT_VERSION_STRING);
}
@@ -341,6 +341,12 @@ void EditorFrame::NewFile()
m_FileName = "";
m_Resource = new wxXmlRcEditDocument;
m_Resource->SetRoot(new wxXmlNode(wxXML_ELEMENT_NODE, _("resource")));
m_Resource->SetFileEncoding("utf-8");
#if !wxUSE_UNICODE
m_Resource->SetEncoding(wxLocale::GetSystemEncodingName());
#endif
m_Resource->GetRoot()->AddProperty(_T("version"),
WX_XMLRES_CURRENT_VERSION_STRING);
m_Modified = FALSE;
RefreshTree();