From 064a9688c04f5eb4e8dc83ce525381666a633cbc Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 14 Jul 2022 09:55:24 -0700 Subject: [PATCH] Make annotation case-insensitive U1 and u1 are allowed but if they both exist in the same schematic, they will throw an ERC and annotation error. Reannotating will make them U1 and u2. Fixes https://gitlab.com/kicad/code/kicad/issues/11862 (cherry picked from commit 00c7b64b13679f32ed8695f3e1fea70b3808d256) --- eeschema/annotate.cpp | 5 +---- eeschema/sch_reference_list.h | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 835b5a97d7..8267d7ead2 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -49,10 +49,7 @@ void SCH_EDIT_FRAME::mapExistingAnnotation( std::map& aMap ) curr_full_uuid.push_back( symbol->m_Uuid ); - wxString ref = symbol->GetRef( curr_sheetpath ); - - if( symbol->GetUnitCount() > 1 ) - ref << LIB_SYMBOL::SubReference( symbol->GetUnitSelection( curr_sheetpath ) ); + wxString ref = symbol->GetRef( curr_sheetpath, true ); if( symbol->IsAnnotated( curr_sheetpath ) ) aMap[ curr_full_uuid.AsString() ] = ref; diff --git a/eeschema/sch_reference_list.h b/eeschema/sch_reference_list.h index 407743a172..90c4368a77 100644 --- a/eeschema/sch_reference_list.h +++ b/eeschema/sch_reference_list.h @@ -134,7 +134,7 @@ public: int CompareRef( const SCH_REFERENCE& item ) const { - return m_ref.compare( item.m_ref ); + return m_ref.CmpNoCase( item.m_ref ); } int CompareLibName( const SCH_REFERENCE& item ) const @@ -168,7 +168,7 @@ private: friend class SCH_REFERENCE_LIST; /// Symbol reference prefix, without number (for IC1, this is IC) ) - UTF8 m_ref; // it's private, use the accessors please + wxString m_ref; // it's private, use the accessors please SCH_SYMBOL* m_rootSymbol; ///< The symbol associated the reference object. LIB_SYMBOL* m_libPart; ///< The source symbol from a library. wxPoint m_symbolPos; ///< The physical position of the symbol in schematic @@ -454,7 +454,7 @@ public: printf( " [%-2d] ref:%-8s num:%-3d lib_part:%s\n", i, - schref.m_ref.c_str(), + schref.m_ref.ToStdString().c_str(), schref.m_numRef, TO_UTF8( schref.GetLibPart()->GetName() ) ); }