diff --git a/eeschema/dialog_print_using_printer.cpp b/eeschema/dialog_print_using_printer.cpp index 09ee7a26e3..a37e217d0b 100644 --- a/eeschema/dialog_print_using_printer.cpp +++ b/eeschema/dialog_print_using_printer.cpp @@ -323,7 +323,6 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage ) #ifdef __WXDEBUG__ WinEDA_SchematicFrame* parent = m_Parent->GetParent(); -#endif wxLogDebug( wxT( "Printer name: " ) + parent->GetPageSetupData().GetPrintData().GetPrinterName() ); wxLogDebug( wxT( "Paper ID: %d" ), @@ -335,6 +334,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage ) parent->GetPageSetupData().GetPrintData().GetOrientation() ); wxLogDebug( wxT( "Quality: %d"), parent->GetPageSetupData().GetPrintData().GetQuality() ); +#endif return true; } diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 476e27db3e..13c233c1c8 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -603,6 +603,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) g_Drag_Pistes_On = true; case ID_POPUP_PCB_MOVE_MODULE_REQUEST: + if( GetCurItem() == NULL ) + break; // If the current Item is a pad, text module ...: Get its parent if( GetCurItem()->Type() != TYPE_MODULE ) SetCurItem( GetCurItem()->GetParent() ); @@ -628,6 +630,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: /* get module by name and move it */ SetCurItem( GetModuleByName() ); module = (MODULE*) GetCurItem(); + if( module == NULL ) + break; if( module->IsLocked() ) { wxString msg; @@ -636,11 +640,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) DisplayInfoMessage( this, msg ); break; } - if( GetCurItem() ) - { - DrawPanel->MouseToCursorSchema(); - StartMove_Module( (MODULE*) GetCurItem(), &dc ); - } + DrawPanel->MouseToCursorSchema(); + StartMove_Module( module, &dc ); break; case ID_POPUP_PCB_DELETE_MODULE: