Don't set dirty bit when adding MARKERs.

They're not saved in the file, so they shouldn't dirty it.

Fixes: lp:1762497
* https://bugs.launchpad.net/kicad/+bug/1762497
This commit is contained in:
Jeff Young 2018-04-09 20:56:27 +01:00
parent cb134fd065
commit 84151990cd
5 changed files with 12 additions and 7 deletions

View File

@ -130,7 +130,8 @@ public:
COMMIT& Stage( const PICKED_ITEMS_LIST& aItems, UNDO_REDO_T aModFlag = UR_UNSPECIFIED );
///> Executes the changes.
virtual void Push( const wxString& aMessage = wxT( "A commit" ), bool aCreateUndoEntry = true ) = 0;
virtual void Push( const wxString& aMessage = wxT( "A commit" ),
bool aCreateUndoEntry = true, bool aSetDirtyBit = true ) = 0;
///> Revertes the commit by restoring the modifed items state.
virtual void Revert() = 0;

View File

@ -56,7 +56,7 @@ BOARD_COMMIT::~BOARD_COMMIT()
}
void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool aSetDirtyBit )
{
// Objects potentially interested in changes:
PICKED_ITEMS_LIST undoList;
@ -283,7 +283,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
panel->RedrawRatsnest();
}
frame->OnModify();
if( aSetDirtyBit )
frame->OnModify();
frame->UpdateMsgPanel();
clear();

View File

@ -42,7 +42,9 @@ public:
virtual ~BOARD_COMMIT();
virtual void Push( const wxString& aMessage = wxT( "A commit" ), bool aCreateUndoEntry = true ) override;
virtual void Push( const wxString& aMessage = wxT( "A commit" ),
bool aCreateUndoEntry = true, bool aSetDirtyBit = true ) override;
virtual void Revert() override;
private:

View File

@ -99,7 +99,7 @@ void DRC::addMarkerToPcb( MARKER_PCB* aMarker )
{
BOARD_COMMIT commit( m_pcbEditorFrame );
commit.Add( aMarker );
commit.Push( wxEmptyString, false );
commit.Push( wxEmptyString, false, false );
}
@ -339,7 +339,7 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
}
if( aCreateMarkers )
commit.Push( wxEmptyString, false );
commit.Push( wxEmptyString, false, false );
return nerrors;
}

View File

@ -152,7 +152,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
for( auto marker : markers )
commit.Add( marker );
commit.Push( wxEmptyString, false );
commit.Push( wxEmptyString, false, false );
};
// Returns false if we should return false from call site, or true to continue