diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index a9d3fcc9f9..b481754bb6 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -116,14 +116,14 @@ wxFlexGridSizer* DIALOG_ABOUT::createFlexGridSizer() void DIALOG_ABOUT::createNotebooks() { createNotebookHtmlPage( m_notebook, _( "About" ), IMAGES::INFORMATION, - m_info.GetDescription() ); + m_info.GetDescription() ); wxString version = GetVersionInfoData( m_titleName, true ); createNotebookHtmlPage( m_notebook, _( "Version" ), IMAGES::VERSION, version, true ); createNotebookPageByCategory( m_notebook, _( "Developers" ) , IMAGES::DEVELOPERS, - m_info.GetDevelopers() ); + m_info.GetDevelopers() ); createNotebookPage( m_notebook, _( "Doc Writers" ), IMAGES::DOCWRITERS, m_info.GetDocWriters() ); @@ -308,7 +308,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt if( sub_contributor->GetExtra() != wxEmptyString ) { wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1, - sub_contributor->GetExtra() ); + sub_contributor->GetExtra() ); fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 ); } else @@ -360,8 +360,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt // Email address of contributor at third column if ( contributor->GetExtra() != wxEmptyString ) { - wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1, - contributor->GetExtra() ); + wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1, contributor->GetExtra() ); fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 ); } else @@ -395,7 +394,8 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString& int flags = aSelection ? wxHW_SCROLLBAR_AUTO : ( wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION ); // the HTML page is going to be created with previously created HTML content - auto htmlWindow = new HTML_WINDOW( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags ); + HTML_WINDOW* htmlWindow = new HTML_WINDOW( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, + flags ); // HTML font set to font properties as they are used for widgets to have an unique look // under different platforms with HTML @@ -431,13 +431,9 @@ wxStaticBitmap* DIALOG_ABOUT::createStaticBitmap( wxScrolledWindow* aParent, wxB wxDefaultPosition, wxDefaultSize, 0 ); if( aIcon ) - { bitmap->SetBitmap( *aIcon ); - } else - { bitmap->SetBitmap( KiBitmap( BITMAPS::right ) ); - } return bitmap; } diff --git a/common/dialogs/dialog_color_picker.cpp b/common/dialogs/dialog_color_picker.cpp index bcf14a03eb..7b798acc2b 100644 --- a/common/dialogs/dialog_color_picker.cpp +++ b/common/dialogs/dialog_color_picker.cpp @@ -208,7 +208,8 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo for( int jj = 0; jj < NBCOLORS; ++jj, grid_col++ ) { if( grid_col * table_row_count >= NBCOLORS ) - { // the current grid row is filled, and we must fill the next grid row + { + // the current grid row is filled, and we must fill the next grid row grid_col = 0; grid_row++; } @@ -617,10 +618,12 @@ void DIALOG_COLOR_PICKER::onRGBMouseDrag( wxMouseEvent& event ) return; } - if( m_selectedCursor != &m_cursorBitmapRed && - m_selectedCursor != &m_cursorBitmapGreen && - m_selectedCursor != &m_cursorBitmapBlue ) + if( m_selectedCursor != &m_cursorBitmapRed + && m_selectedCursor != &m_cursorBitmapGreen + && m_selectedCursor != &m_cursorBitmapBlue ) + { return; + } // Adjust the HSV cursor position to follow the mouse cursor // The cursor position is relative to the m_bitmapHSV wxBitmap center @@ -711,8 +714,10 @@ bool DIALOG_COLOR_PICKER::setHSvaluesFromCursor( const wxPoint& aMouseCursor ) double dist_from_centre = hypot( (double)mousePos.x, (double)mousePos.y ); if( dist_from_centre > half_size ) + { // Saturation cannot be calculated: return false; + } m_cursorBitmapHSV = mousePos; diff --git a/common/dialogs/dialog_hotkey_list.cpp b/common/dialogs/dialog_hotkey_list.cpp index ffa3853eb7..5c07fbb137 100644 --- a/common/dialogs/dialog_hotkey_list.cpp +++ b/common/dialogs/dialog_hotkey_list.cpp @@ -33,16 +33,15 @@ DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent, TOOL_MANAGER* aToolMgr ): DIALOG_SHIM( aParent, wxID_ANY, _( "Hotkey List" ) ) { - const auto margin = KIUI::GetStdMargin(); - - auto main_sizer = new wxBoxSizer( wxVERTICAL ); + const int margin = KIUI::GetStdMargin(); + wxBoxSizer* main_sizer = new wxBoxSizer( wxVERTICAL ); m_hk_list = new PANEL_HOTKEYS_EDITOR( aParent, this, true ); m_hk_list->AddHotKeys( aToolMgr ); main_sizer->Add( m_hk_list, 1, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, margin ); - auto sdb_sizer = new wxStdDialogButtonSizer; + wxStdDialogButtonSizer* sdb_sizer = new wxStdDialogButtonSizer; sdb_sizer->AddButton( new wxButton( this, wxID_OK ) ); sdb_sizer->Realize(); diff --git a/common/dialogs/dialog_image_editor.cpp b/common/dialogs/dialog_image_editor.cpp index 5ab2e5f276..5dccd48683 100644 --- a/common/dialogs/dialog_image_editor.cpp +++ b/common/dialogs/dialog_image_editor.cpp @@ -93,7 +93,9 @@ bool DIALOG_IMAGE_EDITOR::CheckValues() if( !IsOK( this, wxString::Format( _( "This scale results in an image which is very large " "(%.1f mm or %.2f in). Are you sure?" ), 25.4 / 300 * size_max, size_max /300.0 ) ) ) + { return false; + } } return true; diff --git a/common/dialogs/dialog_image_editor_fbp.fbp b/common/dialogs/dialog_image_editor_base.fbp similarity index 100% rename from common/dialogs/dialog_image_editor_fbp.fbp rename to common/dialogs/dialog_image_editor_base.fbp diff --git a/common/html_window.cpp b/common/html_window.cpp index ad900e9e5c..5cdfd25219 100644 --- a/common/html_window.cpp +++ b/common/html_window.cpp @@ -39,15 +39,14 @@ bool HTML_WINDOW::SetPage( const wxString& aSource ) { m_pageSource = aSource; - wxString fgColor = - wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ).GetAsString( wxC2S_HTML_SYNTAX ); - wxString bgColor = - wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ).GetAsString( wxC2S_HTML_SYNTAX ); - wxString linkColor = - wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ).GetAsString( wxC2S_HTML_SYNTAX ); + wxColour fgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); + wxColour bgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ); + wxColour linkColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ); wxString html = wxString::Format( wxT( "\n\n" ), - fgColor, bgColor, linkColor ); + fgColor.GetAsString( wxC2S_HTML_SYNTAX ), + bgColor.GetAsString( wxC2S_HTML_SYNTAX ), + linkColor.GetAsString( wxC2S_HTML_SYNTAX ) ); html.Append( aSource ); html.Append( wxT( "\n\n" ) ); diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index 37b491b427..1bc86d17e2 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -98,9 +98,9 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, LIB_TABLE* aLibTable, { wxPoint html_size = ConvertDialogToPixels( wxPoint( 80, 80 ) ); - m_details_ctrl = - new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition, - wxSize( html_size.x, html_size.y ), wxHW_SCROLLBAR_AUTO ); + m_details_ctrl = new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition, + wxSize( html_size.x, html_size.y ), + wxHW_SCROLLBAR_AUTO ); sizer->Add( m_details_ctrl, 2, wxTOP | wxEXPAND, 5 ); }