Preserve leading zeroes in reference designators
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15760
This commit is contained in:
parent
d6b76ae9df
commit
9271fde71d
|
@ -852,6 +852,7 @@ void SCH_REFERENCE::Split()
|
|||
std::string refText = GetRefStr();
|
||||
|
||||
m_numRef = -1;
|
||||
m_numRefStr.Clear();
|
||||
|
||||
int ll = refText.length() - 1;
|
||||
|
||||
|
@ -883,7 +884,8 @@ void SCH_REFERENCE::Split()
|
|||
m_numRef = atoi( cp );
|
||||
}
|
||||
|
||||
refText.erase( ll+1 ); // delete from ll+1 to end
|
||||
m_numRefStr = std::string( refText, ll + 1 );
|
||||
refText.erase( ll + 1 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
if( GetLibPart() && GetLibPart()->IsPower() )
|
||||
ref = wxT( "0" );
|
||||
|
||||
return ref << m_numRef;
|
||||
return m_numRefStr.IsEmpty() ? ( ref << m_numRef ) : ( ref << m_numRefStr );
|
||||
}
|
||||
|
||||
int CompareValue( const SCH_REFERENCE& item ) const
|
||||
|
@ -245,6 +245,7 @@ private:
|
|||
int m_sheetNum; ///< The sheet number for the reference.
|
||||
KIID m_symbolUuid; ///< UUID of the symbol.
|
||||
int m_numRef; ///< The numeric part of the reference designator.
|
||||
wxString m_numRefStr; ///< The numeric part in original string form (may have leading zeroes)
|
||||
int m_flag;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue