From 6dd542213738204a72007a016b8746f2e7a07d7b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 25 May 2024 12:01:06 +0100 Subject: [PATCH] CmpNoCase() returns 0 for a match (which evals to false as a bool). Fixes https://gitlab.com/kicad/code/kicad/-/issues/18087 (cherry picked from commit 26fe4c05e160acbc43daa3612e65afff80852700) --- common/string_utils.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 675da328e8..f3a794c4ba 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -907,11 +907,12 @@ bool ApplyModifier( double& value, const wxString& aString ) } if( units.length() - && !units.CmpNoCase( wxT( "F" ) ) - && !units.CmpNoCase( wxT( "hz" ) ) - && !units.CmpNoCase( wxT( "W" ) ) - && !units.CmpNoCase( wxT( "V" ) ) - && !units.CmpNoCase( wxT( "H" ) ) ) + && !units.IsSameAs( wxT( "F" ), false ) + && !units.IsSameAs( wxT( "hz" ), false ) + && !units.IsSameAs( wxT( "W" ), false ) + && !units.IsSameAs( wxT( "V" ), false ) + && !units.IsSameAs( wxT( "A" ), false ) + && !units.IsSameAs( wxT( "H" ), false ) ) { return false; }