Handle not found fonts reliably

Check if the font isn't found when selecting (we seem to always have a
selection even if we fail on GTK) and properly set the index of the
final <not found> font name
This commit is contained in:
Seth Hillbrand 2024-06-16 13:06:28 -07:00
parent 90cd3286fa
commit 5c699e3c1e
1 changed files with 3 additions and 3 deletions

View File

@ -78,12 +78,12 @@ void FONT_CHOICE::SetFontSelection( KIFONT::FONT* aFont )
}
else
{
SetStringSelection( aFont->GetName() );
bool result = SetStringSelection( aFont->GetName() );
if( GetSelection() == wxNOT_FOUND )
if( !result )
{
Append( aFont->GetName() + m_notFound );
SetSelection( GetCount() );
SetSelection( GetCount() - 1 );
}
}