diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 8edf806fce..1020369e03 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -70,11 +70,6 @@ void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly, bool* aAppendUndo SaveCopyInUndoList( aScreen, component, UNDO_REDO::CHANGED, *aAppendUndo ); *aAppendUndo = true; component->ClearAnnotation( aSheet ); - - // Clear the modified component flag set by component->ClearAnnotation - // because we do not use it here and we should not leave this flag set, - // when an editing is finished: - component->ClearFlags(); } }; diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index e394e09578..c2cbd96150 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -946,7 +946,7 @@ bool SCH_COMPONENT::ResolveTextVar( wxString* token, int aDepth ) const } -void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheetPath ) +void SCH_COMPONENT::ClearAnnotation( const SCH_SHEET_PATH* aSheetPath ) { // Build a reference with no annotation, // i.e. a reference ended by only one '?' @@ -986,8 +986,6 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheetPath ) // UpdateAllScreenReferences for the active sheet. // But this call cannot made here. m_Fields[REFERENCE].SetText( defRef ); //for drawing. - - SetModified(); } diff --git a/eeschema/sch_component.h b/eeschema/sch_component.h index 93eacd9a46..fa8933989e 100644 --- a/eeschema/sch_component.h +++ b/eeschema/sch_component.h @@ -327,7 +327,7 @@ public: * @param aSheetPath is the hierarchical path of the symbol to clear or remove all * annotations for this symbol if NULL. */ - void ClearAnnotation( SCH_SHEET_PATH* aSheetPath ); + void ClearAnnotation( const SCH_SHEET_PATH* aSheetPath ); /** * Add an instance to the alternate references list (m_instanceReferences), if this entry diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index cf825a90af..6fabd036c9 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -929,11 +929,6 @@ void SCH_SCREEN::ClearAnnotation( SCH_SHEET_PATH* aSheetPath ) SCH_COMPONENT* component = static_cast( item ); component->ClearAnnotation( aSheetPath ); - - // Clear the modified component flag set by component->ClearAnnotation - // because we do not use it here and we should not leave this flag set, - // when an editing is finished: - component->ClearFlags(); } } @@ -945,10 +940,10 @@ void SCH_SCREEN::EnsureAlternateReferencesExist() for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) ) { - auto component = static_cast( item ); + SCH_COMPONENT* component = static_cast( item ); // Add (when not existing) all sheet path entries - for( const auto& sheet : GetClientSheetPaths() ) + for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() ) component->AddSheetPathReferenceEntryIfMissing( sheet.Path() ); } }