From 710a8dc67965b8440d4ccd14b5d8f93aa4db56be Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 6 Oct 2019 14:38:49 -0700 Subject: [PATCH 1/3] Init all FormattedParts strings fields to an empty string Fixes issue #51. --- SourceGen/DisplayList.cs | 5 ++++- SourceGen/Exporter.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SourceGen/DisplayList.cs b/SourceGen/DisplayList.cs index 23df263..f8941af 100644 --- a/SourceGen/DisplayList.cs +++ b/SourceGen/DisplayList.cs @@ -366,7 +366,10 @@ namespace SourceGen { // Private constructor -- create instances with factory methods. - private FormattedParts() { } + private FormattedParts() { + Offset = Addr = Bytes = Flags = Attr = Label = Opcode = Operand = Comment = + string.Empty; + } /// /// Clones the specified object. diff --git a/SourceGen/Exporter.cs b/SourceGen/Exporter.cs index 67d61d3..b1adc25 100644 --- a/SourceGen/Exporter.cs +++ b/SourceGen/Exporter.cs @@ -502,7 +502,7 @@ namespace SourceGen { bool suppressLabel = false; if (LongLabelNewLine && (line.LineType == LineListGen.Line.Type.Code || line.LineType == LineListGen.Line.Type.Data)) { - int labelLen = string.IsNullOrEmpty(parts.Label) ? 0 : parts.Label.Length; + int labelLen = parts.Label.Length; if (labelLen > maxLabelLen) { // put on its own line string lstr; From 951c0d793603824b0294bfe98cb066e48a274bd7 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 6 Oct 2019 10:46:55 -0700 Subject: [PATCH 2/3] Fix ListView click locator The code that figures out which row and column you clicked in wasn't taking horizontal scrolling into account. Issue #49. --- CommonWPF/WPFExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CommonWPF/WPFExtensions.cs b/CommonWPF/WPFExtensions.cs index 4d33c9f..890b4b9 100644 --- a/CommonWPF/WPFExtensions.cs +++ b/CommonWPF/WPFExtensions.cs @@ -147,9 +147,13 @@ namespace CommonWPF { // for it, so for now just fudge it. const int FUDGE = 4; + // Need to take horizontal scrolling into account. + ScrollViewer sv = lv.GetVisualChild(); + double scrollPos = sv.HorizontalOffset; + Point p = e.GetPosition(lv); GridView gv = (GridView)lv.View; - double startPos = FUDGE; + double startPos = FUDGE - scrollPos; for (int index = 0; index < gv.Columns.Count; index++) { GridViewColumn col = gv.Columns[index]; From bfe2abd1738dbca38fdaa72e5069511dece8a898 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 6 Oct 2019 15:30:33 -0700 Subject: [PATCH 3/3] Version 1.3.2 --- SourceGen/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SourceGen/App.xaml.cs b/SourceGen/App.xaml.cs index 8d584e2..3a172f2 100644 --- a/SourceGen/App.xaml.cs +++ b/SourceGen/App.xaml.cs @@ -25,6 +25,6 @@ namespace SourceGen { /// SourceGen version number. /// public static readonly CommonUtil.Version ProgramVersion = - new CommonUtil.Version(1, 3, 1, CommonUtil.Version.PreRelType.Final, 0); + new CommonUtil.Version(1, 3, 2, CommonUtil.Version.PreRelType.Final, 0); } }