Check known m_Desc field before m_Fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16971
This commit is contained in:
Jeff Young 2024-02-18 21:13:54 +00:00
parent f4a085575a
commit 25291d6e3a
2 changed files with 6 additions and 6 deletions

View File

@ -674,10 +674,10 @@ void LIB_TREE_MODEL_ADAPTER::GetValue( wxVariant& aVariant,
{
const wxString& key = m_colIdxMap.at( aCol );
if( node->m_Fields.count( key ) )
valueStr = UnescapeString( node->m_Fields.at( key ) );
else if( key == wxT( "Description" ) )
if( key == wxT( "Description" ) )
valueStr = UnescapeString( node->m_Desc );
else if( node->m_Fields.count( key ) )
valueStr = UnescapeString( node->m_Fields.at( key ) );
else
valueStr = wxEmptyString;
}

View File

@ -282,10 +282,10 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
wxString valueStr;
if( node->m_Fields.count( key ) )
valueStr = node->m_Fields.at( key );
else if( key == wxT( "Description" ) )
if( key == wxT( "Description" ) )
valueStr = node->m_Desc;
else if( node->m_Fields.count( key ) )
valueStr = node->m_Fields.at( key );
else
valueStr = wxEmptyString;