From 2d2d237e444287711222e1826c4181e0a6e85c98 Mon Sep 17 00:00:00 2001 From: ReikoKitsune Date: Tue, 15 Mar 2016 14:14:42 +0300 Subject: [PATCH] Corect char comboBox behavior. --- src/NFirmwareEditor/MainWindow.cs | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/NFirmwareEditor/MainWindow.cs b/src/NFirmwareEditor/MainWindow.cs index 5898725..4fb42bb 100644 --- a/src/NFirmwareEditor/MainWindow.cs +++ b/src/NFirmwareEditor/MainWindow.cs @@ -512,6 +512,7 @@ private void RemoveStringEditControls() private void CreateStringEditControls(byte[] firmwareString, IDictionary imageCache) { + var nullByteFound = false; for (var i = 0; i < firmwareString.Length; i++) { if (i == firmwareString.Length - 1 && firmwareString[i] == 0x00) continue; @@ -526,8 +527,7 @@ private void CreateStringEditControls(byte[] firmwareString, IDictionary(LastSelectedStringMetadata, i) }; - icb.Items.Add(nullItem); - + if (i > 0) icb.Items.Add(nullItem); var selectedItem = nullItem; foreach (var imageMetadata in CurrentImageBlockForStrings) { @@ -540,7 +540,9 @@ private void CreateStringEditControls(byte[] firmwareString, IDictionary