Fix crash (only on Linux) when exporting a footprint from the footprint wizard frame.

Replace %zu be %d in wxString::Format (%zu format not known by wxString::Format on Windows 32 bits)
This commit is contained in:
jean-pierre charras 2015-09-07 17:20:15 +02:00
parent 7b0d597f6d
commit 991927a177
7 changed files with 15 additions and 24 deletions

View File

@ -140,7 +140,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
{
if( aFilterType == UNFILTERED )
{
msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1,
msg.Printf( wxT( "%3d %s:%s" ), int( newList.GetCount() + 1 ),
GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).GetFootprintName() ) );
newList.Add( msg );
@ -159,7 +159,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetPadCount() )
continue;
msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1,
msg.Printf( wxT( "%3d %s:%s" ), int( newList.GetCount() + 1 ),
GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).GetFootprintName() ) );
newList.Add( msg );

View File

@ -417,10 +417,10 @@ void LIB_POLYLINE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
wxString LIB_POLYLINE::GetSelectMenuText() const
{
return wxString::Format( _( "Polyline at (%s, %s) with %zu points" ),
return wxString::Format( _( "Polyline at (%s, %s) with %d points" ),
GetChars( CoordinateToString( m_PolyPoints[0].x ) ),
GetChars( CoordinateToString( m_PolyPoints[0].y ) ),
m_PolyPoints.size() );
int( m_PolyPoints.size() ) );
}

View File

@ -546,8 +546,8 @@ void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
return;
}
msg.Printf( _( "Select one of %zu components to delete\nfrom library '%s'." ),
nameList.GetCount(),
msg.Printf( _( "Select one of %d components to delete\nfrom library '%s'." ),
int( nameList.GetCount() ),
GetChars( lib->GetName() ) );
wxSingleChoiceDialog dlg( this, msg, _( "Delete Part" ), nameList );

View File

@ -173,7 +173,7 @@ NETLIST_OBJECT_LIST* SCH_EDIT_FRAME::BuildNetListBase()
return ret.release();
}
wxString msg = wxString::Format( _( "Net count = %zu" ), ret->size() );
wxString msg = wxString::Format( _( "Net count = %d" ), int( ret->size() ) );
SetStatusText( msg );

View File

@ -218,7 +218,7 @@ FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME()
void FOOTPRINT_WIZARD_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
if( m_messagesFrame )
m_messagesFrame->CloseMessagesWindow();
m_messagesFrame->SaveSettings();
SaveSettings( config() );
@ -655,20 +655,6 @@ FOOTPRINT_WIZARD_MESSAGES::FOOTPRINT_WIZARD_MESSAGES( FOOTPRINT_WIZARD_FRAME* aP
}
void FOOTPRINT_WIZARD_MESSAGES::CloseMessagesWindow()
{
if( !IsIconized() )
{
m_position = GetPosition();
m_size = GetSize();
}
SaveSettings();
Close();
}
FOOTPRINT_WIZARD_MESSAGES::~FOOTPRINT_WIZARD_MESSAGES()
{
}
@ -692,6 +678,12 @@ void FOOTPRINT_WIZARD_MESSAGES::ClearScreen()
void FOOTPRINT_WIZARD_MESSAGES::SaveSettings()
{
if( !IsIconized() )
{
m_position = GetPosition();
m_size = GetSize();
}
m_config->Write( MESSAGE_BOX_POSX_KEY, m_position.x );
m_config->Write( MESSAGE_BOX_POSY_KEY, m_position.y );
m_config->Write( MESSAGE_BOX_SIZEX_KEY, m_size.x );

View File

@ -212,7 +212,6 @@ public:
~FOOTPRINT_WIZARD_MESSAGES();
void PrintMessage( const wxString& aMessage );
void ClearScreen();
void CloseMessagesWindow();
void SaveSettings();
void LoadSettings();

View File

@ -388,7 +388,7 @@ void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode )
}
/* Compare function used for sorting candidates by increasing zone zubnet
/* Compare function used for sorting candidates by increasing zone subnet
*/
static bool CmpZoneSubnetValue( const BOARD_CONNECTED_ITEM* a, const BOARD_CONNECTED_ITEM* b )
{