From 2ba7f89ca2becf81f486a7225156b25eea7bb384 Mon Sep 17 00:00:00 2001 From: WMJ Date: Sun, 24 May 2026 21:25:35 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=81=E5=B0=86HistoryComboBox=E6=94=B9?= =?UTF-8?q?=E6=88=90=E4=B8=8D=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Functions/HistoryComboBox.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/App/Functions/HistoryComboBox.cs b/App/Functions/HistoryComboBox.cs index 9132ceb..248e9c6 100644 --- a/App/Functions/HistoryComboBox.cs +++ b/App/Functions/HistoryComboBox.cs @@ -44,12 +44,25 @@ namespace PDFPatcher } int IndexOf(string o) { - var l = Contents; - if (l != null) { - return l.IndexOf(o); + if (Contents != null) { + var c = Contents; + var l = c.Count; + for (var i = 0; i < l; i++) { + if (String.Equals(c[i], o, StringComparison.OrdinalIgnoreCase)) { + return i; + } + } + return -1; } else { - return Items.IndexOf(o); + var c = Items; + var l = c.Count; + for (var i = 0; i < l; i++) { + if (String.Equals(c[i] as string, o, StringComparison.OrdinalIgnoreCase)) { + return i; + } + } + return -1; } }