Fixed logic for SUM.FMT

Fixed logic to update formats
Fixed logic to paste dashes
This commit is contained in:
Rich 2012-12-06 16:35:46 +00:00
parent 4d0346f0f8
commit fd983f616c
3 changed files with 27 additions and 30 deletions

View File

@ -1989,35 +1989,27 @@ namespace VEPROMS
} }
private void btnUpdateFormat_Click(object sender, EventArgs e) private void btnUpdateFormat_Click(object sender, EventArgs e)
{ {
string tmp = Properties.Settings.Default.FormatPath; string fmtPath = Properties.Settings.Default.FormatPath ?? "";
DirectoryInfo di = null; DirectoryInfo di = null;
//if (tmp != null && tmp !="") di = new DirectoryInfo(Properties.Settings.Default.FormatPath); do
if (tmp == null) tmp = "";
di = new DirectoryInfo(Properties.Settings.Default.FormatPath);
//if (((tmp ?? "") == "") || (di != null && (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall"))))
if (di != null)
{ {
//while (((tmp ?? "") == "") || (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall"))) fbd.Description = "Select folder containing FmtAll and GenMacAll folders to update formats";
do fbd.SelectedPath = fmtPath;
DialogResult dr = fbd.ShowDialog();
if (dr == DialogResult.Cancel)
{ {
fbd.Description = "Select folder containing FmtAll and GenMacAll folders to update formats"; bottomProgBar.Text = "Format Update Cancelled";
fbd.SelectedPath = tmp; return;
DialogResult dr = fbd.ShowDialog(); }
if (dr == DialogResult.Cancel) di = new DirectoryInfo(fbd.SelectedPath);
{ fmtPath = di.FullName;
bottomProgBar.Text = "Format Update Cancelled"; } while (((fmtPath ?? "") == "") || (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall")));
return; Properties.Settings.Default.FormatPath = fbd.SelectedPath;
} Properties.Settings.Default.Save();
di = new DirectoryInfo(fbd.SelectedPath); string fmtPathAll = di.FullName + @"\fmtall";
tmp = di.FullName; string genmacPathAll = di.FullName + @"\genmacall";
} while (((tmp ?? "") == "") || (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall")));
Properties.Settings.Default.FormatPath = fbd.SelectedPath;
Properties.Settings.Default.Save();
}
string fmtPath = di.FullName + @"\fmtall";
string genmacPath = di.FullName + @"\genmacall";
Format.FormatLoaded += new FormatEvent(Format_FormatLoaded); Format.FormatLoaded += new FormatEvent(Format_FormatLoaded);
Format.UpdateFormats(fmtPath, genmacPath); Format.UpdateFormats(fmtPathAll, genmacPathAll);
Format.FormatLoaded -= new FormatEvent(Format_FormatLoaded); Format.FormatLoaded -= new FormatEvent(Format_FormatLoaded);
} }
@ -2029,7 +2021,7 @@ namespace VEPROMS
bottomProgBar.Maximum = int.Parse(args.Status.Split(" ".ToCharArray())[0]); bottomProgBar.Maximum = int.Parse(args.Status.Split(" ".ToCharArray())[0]);
} }
else else
bottomProgBar.Value++; if(!args.Status.Contains("SubFormat"))bottomProgBar.Value++;
bottomProgBar.Text = args.Status; bottomProgBar.Text = args.Status;
bottomProgBar.TextVisible = true; bottomProgBar.TextVisible = true;
Application.DoEvents(); Application.DoEvents();

View File

@ -1074,6 +1074,9 @@ namespace Volian.Controls.Library
string ptext = myDO.GetData(DataFormats.Text).ToString(); string ptext = myDO.GetData(DataFormats.Text).ToString();
ptext = ptext.TrimEnd("\r\n\t ".ToCharArray()); ptext = ptext.TrimEnd("\r\n\t ".ToCharArray());
if (PasteNoReturnsSetting) ptext = ptext.Replace("\r\n", " "); if (PasteNoReturnsSetting) ptext = ptext.Replace("\r\n", " ");
ptext = ptext.Replace("\u2013", "-"); // Replace EN Dash with hyphen
ptext = ptext.Replace("\u2014", "-"); // Replace EM Dash with hyphen
ptext = ptext.Replace("\u2011", "-"); // Replace non-breaking hyphen with hyphen
myRtb.SelectedText = ptext; myRtb.SelectedText = ptext;
//myRtb.SelectedText = myDO.GetData(DataFormats.Text).ToString(); //myRtb.SelectedText = myDO.GetData(DataFormats.Text).ToString();
} }

View File

@ -3102,10 +3102,12 @@ namespace fmtxml
if (rightCheckOffBox[0] == -2 && rightCheckOffBox[1] == -2) fmtdata.ProcData.CheckOffData.SkipSpaces = "true"; if (rightCheckOffBox[0] == -2 && rightCheckOffBox[1] == -2) fmtdata.ProcData.CheckOffData.SkipSpaces = "true";
else else
{ {
fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "0"; if (fmtdata.ProcData.CheckOffData.LayoutList == null)
fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[0]; fmtdata.ProcData.CheckOffData.LayoutList = new Absolute [2];
fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "1"; fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "0";
fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[1]; fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[0];
fmtdata.ProcData.CheckOffData.LayoutList[1].RnoLevel = "1";
fmtdata.ProcData.CheckOffData.LayoutList[1].Column = rightCheckOffBox[1];
} }
} }
for (int i = 0; i < MAXCHKHEADINGS; i++) for (int i = 0; i < MAXCHKHEADINGS; i++)