mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Always provide a SCH_SCREEN to SCH_COMMIT.
Fixes KICAD-YKY
This commit is contained in:
parent
c51d26e70a
commit
a0940b10d4
@ -253,7 +253,7 @@ HANDLER_RESULT<ItemRequestStatus> API_HANDLER_SCH::handleCreateUpdateItemsIntern
|
||||
if( aCreate )
|
||||
{
|
||||
item->Serialize( newItem );
|
||||
commit->Add( item.release() );
|
||||
commit->Add( item.release(), screen );
|
||||
|
||||
if( !m_activeClients.count( aClientName ) )
|
||||
pushCurrentCommit( aClientName, _( "Added items via API" ) );
|
||||
@ -266,7 +266,7 @@ HANDLER_RESULT<ItemRequestStatus> API_HANDLER_SCH::handleCreateUpdateItemsIntern
|
||||
{
|
||||
schItem->SwapItemData( static_cast<SCH_ITEM*>( item.get() ) );
|
||||
schItem->Serialize( newItem );
|
||||
commit->Modify( schItem );
|
||||
commit->Modify( schItem, screen );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ void DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked( wxCommandEvent& aEvent )
|
||||
wxBusyCursor dummy;
|
||||
SCH_COMMIT commit( m_editFrame );
|
||||
|
||||
commit.Modify( m_symbol );
|
||||
commit.Modify( m_symbol, m_editFrame->GetScreen() );
|
||||
|
||||
// Create the set of fields to be updated
|
||||
m_updateFields.clear();
|
||||
|
@ -198,7 +198,7 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
// We don't know that anything will be added to the entered group, but it does no harm to
|
||||
// add it to the commit anyway.
|
||||
if( enteredGroup )
|
||||
Modify( enteredGroup );
|
||||
Modify( enteredGroup, frame->GetScreen() );
|
||||
|
||||
// Handle wires with Hop Over shapes:
|
||||
for( COMMIT_LINE& entry : m_entries )
|
||||
@ -222,7 +222,7 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
wxCHECK2( schItem, continue );
|
||||
|
||||
if( changeType == CHT_REMOVE && schItem->GetParentGroup() )
|
||||
Modify( schItem->GetParentGroup()->AsEdaItem() );
|
||||
Modify( schItem->GetParentGroup()->AsEdaItem(), entry.m_screen );
|
||||
}
|
||||
|
||||
for( COMMIT_LINE& entry : m_entries )
|
||||
|
@ -471,7 +471,7 @@ bool SCH_EDIT_FRAME::SaveSelectionToDesignBlock( const LIB_ID& aLibId )
|
||||
{
|
||||
SCH_COMMIT commit( m_toolManager );
|
||||
|
||||
commit.Modify( group );
|
||||
commit.Modify( group, GetScreen() );
|
||||
group->SetDesignBlockLibId( aLibId );
|
||||
|
||||
commit.Push( "Set Group Design Block Link" );
|
||||
|
@ -447,7 +447,9 @@ int SCH_FIND_REPLACE_TOOL::ReplaceAll( const TOOL_EVENT& aEvent )
|
||||
auto doReplace =
|
||||
[&]( SCH_ITEM* aItem, SCH_SHEET_PATH* aSheet, EDA_SEARCH_DATA& aData )
|
||||
{
|
||||
commit.Modify( aItem, aSheet ? aSheet->LastScreen() : nullptr, RECURSE_MODE::NO_RECURSE );
|
||||
wxCHECK_RET( aSheet, wxT( "must have a sheetpath for undo" ) );
|
||||
|
||||
commit.Modify( aItem, aSheet->LastScreen(), RECURSE_MODE::NO_RECURSE );
|
||||
|
||||
if( aItem->Replace( aData, aSheet ) )
|
||||
{
|
||||
|
@ -616,8 +616,7 @@ public:
|
||||
|
||||
private:
|
||||
void dragPinsOnEdge( const std::vector<SEG>& aOldEdges, const std::vector<VECTOR2I>& aMoveVecs,
|
||||
int aEdgeUnit, COMMIT& aCommit,
|
||||
std::vector<EDA_ITEM*>& aUpdatedItems ) const
|
||||
int aEdgeUnit, COMMIT& aCommit, std::vector<EDA_ITEM*>& aUpdatedItems ) const
|
||||
{
|
||||
wxCHECK( aOldEdges.size() == aMoveVecs.size(), /* void */ );
|
||||
|
||||
@ -668,12 +667,11 @@ private:
|
||||
if( aMoveVecs[i] == VECTOR2I( 0, 0 ) || !symbol )
|
||||
continue;
|
||||
|
||||
const std::vector<SCH_PIN*> pins = getPinsOnSeg( *symbol, aEdgeUnit, aOldEdges[i],
|
||||
false );
|
||||
const std::vector<SCH_PIN*> pins = getPinsOnSeg( *symbol, aEdgeUnit, aOldEdges[i], false );
|
||||
|
||||
for( SCH_PIN* pin : pins )
|
||||
{
|
||||
aCommit.Modify( pin );
|
||||
aCommit.Modify( pin, editor.GetScreen() );
|
||||
aUpdatedItems.push_back( pin );
|
||||
|
||||
// Move the pin
|
||||
|
@ -688,7 +688,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent )
|
||||
if( !symbol )
|
||||
return 0;
|
||||
|
||||
commit.Modify( symbol );
|
||||
commit.Modify( symbol, m_frame->GetScreen() );
|
||||
|
||||
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
|
||||
wxCHECK( selTool, -1 );
|
||||
@ -920,7 +920,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
|
||||
|
||||
SCH_COMMIT commit( m_toolMgr );
|
||||
|
||||
commit.Modify( symbol );
|
||||
commit.Modify( symbol, m_frame->GetScreen() );
|
||||
m_selectionTool->ClearSelection();
|
||||
|
||||
for( SCH_ITEM& item : symbol->GetDrawItems() )
|
||||
|
@ -123,7 +123,7 @@ bool SYMBOL_EDITOR_PIN_TOOL::EditPinProperties( SCH_PIN* aPin, bool aFocusPinNum
|
||||
LIB_SYMBOL* parentSymbol = static_cast<LIB_SYMBOL*>( aPin->GetParentSymbol() );
|
||||
|
||||
if( aPin->GetEditFlags() == 0 )
|
||||
commit.Modify( parentSymbol );
|
||||
commit.Modify( parentSymbol, m_frame->GetScreen() );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
@ -415,7 +415,7 @@ SCH_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const SCH_PIN* aSourcePin )
|
||||
SCH_COMMIT commit( m_frame );
|
||||
LIB_SYMBOL* symbol = m_frame->GetCurSymbol();
|
||||
|
||||
commit.Modify( symbol );
|
||||
commit.Modify( symbol, m_frame->GetScreen() );
|
||||
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( aSourcePin->Duplicate( true, &commit ) );
|
||||
|
||||
|
@ -363,7 +363,7 @@ protected:
|
||||
|
||||
if( deleted.size() == (unsigned) table->GetRowCount() )
|
||||
{
|
||||
commit.Remove( table );
|
||||
commit.Remove( table, getScreen() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -440,7 +440,7 @@ protected:
|
||||
|
||||
if( deleted.size() == (unsigned) table->GetColCount() )
|
||||
{
|
||||
commit.Remove( table );
|
||||
commit.Remove( table, getScreen() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user