From c29dfe026e3e73a1341d29d72b699ac8fbfe37a0 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 5 Jan 2023 13:33:19 -0800 Subject: [PATCH] Force recursing annotation when set to auto Automatic annotation should always annotate new elements regardless of where in the hierarchy they are Fixes https://gitlab.com/kicad/code/kicad/issues/13378 --- .../panel_eeschema_annotation_options.cpp | 2 - ...panel_eeschema_annotation_options_base.cpp | 6 +- ...panel_eeschema_annotation_options_base.fbp | 74 +++---------------- .../panel_eeschema_annotation_options_base.h | 3 +- eeschema/tools/sch_edit_tool.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 2 +- 6 files changed, 14 insertions(+), 75 deletions(-) diff --git a/eeschema/dialogs/panel_eeschema_annotation_options.cpp b/eeschema/dialogs/panel_eeschema_annotation_options.cpp index 0a793fe322..912c97418d 100644 --- a/eeschema/dialogs/panel_eeschema_annotation_options.cpp +++ b/eeschema/dialogs/panel_eeschema_annotation_options.cpp @@ -43,7 +43,6 @@ PANEL_EESCHEMA_ANNOTATION_OPTIONS::PANEL_EESCHEMA_ANNOTATION_OPTIONS( void PANEL_EESCHEMA_ANNOTATION_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg ) { m_checkAutoAnnotate->SetValue( aCfg->m_AnnotatePanel.automatic ); - m_checkRecursive->SetValue( aCfg->m_AnnotatePanel.recursive ); switch( aCfg->m_AnnotatePanel.sort_order ) { @@ -96,7 +95,6 @@ bool PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataFromWindow() EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings(); cfg->m_AnnotatePanel.automatic = m_checkAutoAnnotate->GetValue(); - cfg->m_AnnotatePanel.recursive = m_checkRecursive->GetValue(); cfg->m_AnnotatePanel.sort_order = m_rbSortBy_Y_Position->GetValue() ? ANNOTATE_ORDER_T::SORT_BY_Y_POSITION diff --git a/eeschema/dialogs/panel_eeschema_annotation_options_base.cpp b/eeschema/dialogs/panel_eeschema_annotation_options_base.cpp index 6b65d221df..d231e37a97 100644 --- a/eeschema/dialogs/panel_eeschema_annotation_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_annotation_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -24,10 +24,6 @@ PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE( m_checkAutoAnnotate->SetValue(true); sbSizerAutomatic->Add( m_checkAutoAnnotate, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - m_checkRecursive = new wxCheckBox( sbSizerAutomatic->GetStaticBox(), wxID_ANY, _("Recursively annotate subsheets"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkRecursive->SetValue(true); - sbSizerAutomatic->Add( m_checkRecursive, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - bLeftColumn->Add( sbSizerAutomatic, 0, wxALL|wxEXPAND, 5 ); diff --git a/eeschema/dialogs/panel_eeschema_annotation_options_base.fbp b/eeschema/dialogs/panel_eeschema_annotation_options_base.fbp index 34d2be6122..bd8d567e0d 100644 --- a/eeschema/dialogs/panel_eeschema_annotation_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_annotation_options_base.fbp @@ -35,6 +35,7 @@ 1 + 0 1 impl_virtual @@ -104,6 +105,7 @@ Dock 0 Left + 0 1 1 @@ -142,70 +144,6 @@ - - 5 - wxLEFT|wxRIGHT|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Recursively annotate subsheets - - 0 - - - 0 - - 1 - m_checkRecursive - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - @@ -254,6 +192,7 @@ Dock 0 Left + 0 1 1 @@ -320,6 +259,7 @@ Dock 0 Left + 0 1 1 @@ -388,6 +328,7 @@ Dock 0 Left + 0 1 1 @@ -454,6 +395,7 @@ Dock 0 Left + 0 1 1 @@ -561,6 +503,7 @@ Dock 0 Left + 0 1 1 @@ -629,6 +572,7 @@ Dock 0 Left + 0 1 1 @@ -697,6 +641,7 @@ Dock 0 Left + 0 1 1 @@ -765,6 +710,7 @@ Dock 0 Left + 0 1 1 diff --git a/eeschema/dialogs/panel_eeschema_annotation_options_base.h b/eeschema/dialogs/panel_eeschema_annotation_options_base.h index 7c0c2c603c..c8450f6834 100644 --- a/eeschema/dialogs/panel_eeschema_annotation_options_base.h +++ b/eeschema/dialogs/panel_eeschema_annotation_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -45,7 +45,6 @@ class PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE : public RESETTABLE_PANEL protected: wxCheckBox* m_checkAutoAnnotate; - wxCheckBox* m_checkRecursive; wxRadioButton* m_rbSortBy_X_Position; wxStaticBitmap* annotate_down_right_bitmap; wxRadioButton* m_rbSortBy_Y_Position; diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 300a41ee3e..40ab11e45e 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1117,7 +1117,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) NULL_REPORTER reporter; m_frame->AnnotateSymbols( ANNOTATE_SELECTION, (ANNOTATE_ORDER_T) annotate.sort_order, - (ANNOTATE_ALGO_T) annotate.method, annotate.recursive, + (ANNOTATE_ALGO_T) annotate.method, true /* recursive */, annotateStartNum, false, false, reporter, appendUndo ); } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 52aa35b544..469db319e6 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -2043,7 +2043,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) for( SCH_SHEET_PATH& instance : pasteInstances ) { SCH_SHEET_PATH sheetPath = updatePastedSheet( instance, clipPath, sheet, - ( forceKeepAnnotations && annotate.recursive ), + ( forceKeepAnnotations && annotate.automatic ), &pastedSheets[instance], &pastedSymbols[instance] );