Fix inserting items into wxListCtrl in wxGenericPrintSetupDialog

Set the ID before calling InsertItem(), otherwise it just fails
(inserting an item without ID used to work in the generic version but
never worked in the MSW one and was changed back in 2.9 to not work in
the generic version neither for consistency).
This commit is contained in:
Vadim Zeitlin 2022-11-26 20:09:36 +01:00
parent 02f7a5361d
commit 6832a58695

View file

@ -501,7 +501,8 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
item.SetMask( wxLIST_MASK_TEXT );
item.SetColumn( 1 );
item.SetText( _("Default printer") );
item.SetId( m_printerListCtrl->InsertItem( item ) );
item.SetId( 0 );
m_printerListCtrl->InsertItem( item );
if (data->GetPrinterName().empty())
{