eeschema crashes when delete a sheet label (pin sheet), undo this and move the label

This commit is contained in:
charras 2008-03-30 16:15:53 +00:00
parent 0f54a686cc
commit 4ca2072a7f
2 changed files with 20 additions and 2 deletions

View File

@ -9,6 +9,9 @@ email address.
================================================================================
+eeschema
Solved: eeschema crashes when create a new sheet, using the default filename and enter it.
Solved: eeschema crashes when delete a sheet label (pin sheet), undo this and move the label.
(bad value (not updated) for the DrawSheetLabelStruct.m_Parent member after redo command in sheet edit).
+all:
Added comments in gestfich.cpp to explain the default paths used by kicad to find help files and lib files

View File

@ -105,7 +105,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
{
Slabel = newitem->m_Label = label->GenCopy();
Slabel->m_Parent = newitem;
label = (DrawSheetLabelStruct*) label->Pnext;
label = label->Next();
}
while( label )
@ -113,7 +113,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
Slabel->Pnext = label->GenCopy();
Slabel = (DrawSheetLabelStruct*) Slabel->Pnext;
Slabel->m_Parent = newitem;
label = (DrawSheetLabelStruct*) label->Pnext;
label = label->Next();
}
/* don't copy screen data - just reference it. */
@ -140,6 +140,21 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
EXCHG( m_FileNameSize, copyitem->m_FileNameSize );
EXCHG( m_Label, copyitem->m_Label );
EXCHG( m_NbLabel, copyitem->m_NbLabel );
// Ensure sheet labels have their .m_Parent member poiuntin really on their parent, after swapping.
DrawSheetLabelStruct * label = m_Label;
while( label )
{
label->m_Parent = this;
label = label->Next();
}
label = copyitem->m_Label;
while( label )
{
label->m_Parent = copyitem;
label = label->Next();
}
}