diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index 10c67e3621..e677893d7c 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -1085,7 +1085,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnUpdateUI( wxUpdateUIEvent& event ) getSelectedArea( m_grid, &firstSelectedRow, &selectedRowCount ); - if( selectedRowCount > 1 != m_groupSelected->IsEnabled() ) + if( ( selectedRowCount > 1 ) != m_groupSelected->IsEnabled() ) m_groupSelected->Enable( selectedRowCount > 1 ); } diff --git a/eeschema/tools/ee_tool_base.h b/eeschema/tools/ee_tool_base.h index 204b62e57a..b5d1cb690e 100644 --- a/eeschema/tools/ee_tool_base.h +++ b/eeschema/tools/ee_tool_base.h @@ -154,17 +154,21 @@ protected: SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); wxASSERT( editFrame ); - if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T ) + if( editFrame ) { - editFrame->SaveCopyInUndoList( editFrame->GetScreen(), - static_cast( aItem->GetParent() ), - UNDO_REDO::CHANGED, aAppend, aDirtyConnectivity ); - } - else - { - editFrame->SaveCopyInUndoList( editFrame->GetScreen(), - static_cast( aItem ), aType, aAppend, - aDirtyConnectivity ); + if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T ) + { + editFrame->SaveCopyInUndoList( editFrame->GetScreen(), + static_cast( aItem->GetParent() ), + UNDO_REDO::CHANGED, aAppend, + aDirtyConnectivity ); + } + else + { + editFrame->SaveCopyInUndoList( editFrame->GetScreen(), + static_cast( aItem ), aType, + aAppend, aDirtyConnectivity ); + } } } diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index e957dd8fa4..97bef5aefd 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 CERN - * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -885,14 +885,11 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, segment->SetEndPoint( cursorPos ); // Find new bend point for current mode - if( segment ) - { - if( twoSegments && m_wires.size() >= 2 ) - computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos, - currentMode ); - else - segment->SetEndPoint( cursorPos ); - } + if( twoSegments && m_wires.size() >= 2 ) + computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos, + currentMode ); + else + segment->SetEndPoint( cursorPos ); for( SCH_LINE* wire : m_wires ) {