Use const to store xml text instead

This commit is contained in:
ivandroly 2015-06-30 05:56:55 +00:00
parent 04e0e56cda
commit 93d31e73f8

View File

@ -775,6 +775,7 @@ namespace Nikse.SubtitleEdit.Logic.Dictionaries
private XmlDocument LoadXmlReplaceListDocument()
{
const string xmlText = "<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/></ReplaceList>";
var doc = new XmlDocument();
if (File.Exists(_replaceListXmlFileName))
{
@ -784,12 +785,12 @@ namespace Nikse.SubtitleEdit.Logic.Dictionaries
}
catch
{
doc.LoadXml("<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/></ReplaceList>");
doc.LoadXml(xmlText);
}
}
else
{
doc.LoadXml("<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/></ReplaceList>");
doc.LoadXml(xmlText);
}
return doc;
}
@ -801,6 +802,7 @@ namespace Nikse.SubtitleEdit.Logic.Dictionaries
private XmlDocument LoadXmlReplaceListUserDocument()
{
const string xmlText = "<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/><RemovedWholeWords/><RemovedPartialLines/><RemovedBeginLines/><RemovedEndLines/><RemovedWholeLines/></ReplaceList>";
var doc = new XmlDocument();
if (File.Exists(ReplaceListXmlFileNameUser))
{
@ -810,12 +812,12 @@ namespace Nikse.SubtitleEdit.Logic.Dictionaries
}
catch
{
doc.LoadXml("<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/><RemovedWholeWords/><RemovedPartialLines/><RemovedBeginLines/><RemovedEndLines/><RemovedWholeLines/></ReplaceList>");
doc.LoadXml(xmlText);
}
}
else
{
doc.LoadXml("<ReplaceList><WholeWords/><PartialLines/><BeginLines/><EndLines/><WholeLines/><RemovedWholeWords/><RemovedPartialLines/><RemovedBeginLines/><RemovedEndLines/><RemovedWholeLines/></ReplaceList>");
doc.LoadXml(xmlText);
}
return doc;
}