From 89951b01ff3f5e549387dbca83edf2f87661672f Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 4 Oct 2020 09:42:18 +0200 Subject: [PATCH] Fix incorrect vertical position of check boxes in some wxGrid on wxWidgets 3.1.4. Fix also 2 compil warnings. These fixes come from the master branch --- pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp | 2 +- pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp | 2 +- pcbnew/dialogs/dialog_export_svg.cpp | 2 -- pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp | 2 +- pcbnew/dialogs/panel_modedit_defaults.cpp | 2 +- pcbnew/dialogs/panel_setup_text_and_graphics.cpp | 4 ++-- polygon/clipper.cpp | 3 ++- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp index 9e3b6b35cf..f29eed9abc 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -102,7 +102,7 @@ DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aP wxGridCellAttr* attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_modelsGrid->SetColAttr( 1, attr ); m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 19f2b819fd..a4d6c82cad 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -100,7 +100,7 @@ DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aP wxGridCellAttr* attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_modelsGrid->SetColAttr( 1, attr ); m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL ); diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index 268c7dd922..58ca7f7f89 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -91,8 +91,6 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_BASE_FRAME* aParent, BOARD* aBoard ) : m_board = aBoard; m_config = Kiface().KifaceSettings(); - memset( m_boxSelectLayer, 0, sizeof( m_boxSelectLayer ) ); - m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); initDialog(); diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index ffe5345cb9..901d237772 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -191,7 +191,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() #define SET_BOOL_VALUE( aRow, aCol, aValue ) \ attr = new wxGridCellAttr; \ attr->SetRenderer( new wxGridCellBoolRenderer() ); \ - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); \ + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \ attr->SetReadOnly(); \ m_grid->SetAttr( aRow, aCol, attr ); \ m_grid->SetCellValue( aRow, aCol, ( aValue ) ? "1" : "" ) diff --git a/pcbnew/dialogs/panel_modedit_defaults.cpp b/pcbnew/dialogs/panel_modedit_defaults.cpp index c9532f870d..061e63b60a 100644 --- a/pcbnew/dialogs/panel_modedit_defaults.cpp +++ b/pcbnew/dialogs/panel_modedit_defaults.cpp @@ -113,7 +113,7 @@ bool PANEL_MODEDIT_DEFAULTS::TransferDataToWindow() auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_grid->SetAttr( i, COL_TEXT_ITALIC, attr ); } } diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index f7e65575e9..a154fc5794 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -115,13 +115,13 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_grid->SetAttr( i, COL_TEXT_ITALIC, attr ); attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS - attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_grid->SetAttr( i, COL_TEXT_UPRIGHT, attr ); } } diff --git a/polygon/clipper.cpp b/polygon/clipper.cpp index 448aff4856..964575e28e 100644 --- a/polygon/clipper.cpp +++ b/polygon/clipper.cpp @@ -889,7 +889,8 @@ void DisposeOutPts( OutPt*& pp ) inline void InitEdge( TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt ) { - std::memset( e, 0, sizeof(TEdge) ); + // This clears the C++ way + *e = TEdge( { 0 } ); e->Next = eNext; e->Prev = ePrev;