git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@37 99eadd0c-20b8-1223-b5c4-2a2b2df33de2

This commit is contained in:
niksedk 2010-10-13 07:19:00 +00:00
parent 50f2ac7701
commit 6ea087e091

View File

@ -5010,13 +5010,13 @@ namespace Nikse.SubtitleEdit.Forms
if (!localNamesEtc.Contains(word) && !namesEtc.Contains(word)) if (!localNamesEtc.Contains(word) && !namesEtc.Contains(word))
{ {
wordsAdded++; wordsAdded++;
localNamesEtc.Add(word); namesEtc.Add(word);
localNamesEtc.Sort();
} }
} }
if (MessageBox.Show("Add new words: " + wordsAdded.ToString(), "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) if (MessageBox.Show("Add new words: " + wordsAdded.ToString(), "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
{ {
namesEtc.Sort();
var namesEtcDoc = new XmlDocument(); var namesEtcDoc = new XmlDocument();
if (File.Exists(globalNamesEtcFileName)) if (File.Exists(globalNamesEtcFileName))
namesEtcDoc.Load(globalNamesEtcFileName); namesEtcDoc.Load(globalNamesEtcFileName);
@ -5027,13 +5027,13 @@ namespace Nikse.SubtitleEdit.Forms
if (de != null) if (de != null)
{ {
de.RemoveAll(); de.RemoveAll();
foreach (var name in localNamesEtc) foreach (var name in namesEtc)
{ {
XmlNode node = namesEtcDoc.CreateElement("name"); XmlNode node = namesEtcDoc.CreateElement("name");
node.InnerText = name; node.InnerText = name;
de.AppendChild(node); de.AppendChild(node);
} }
namesEtcDoc.Save(userNamesEtcXmlFileName); namesEtcDoc.Save(globalNamesEtcFileName);
} }
} }