Hide m_galCanvas and m_galCanvasActive behind accessors. Fix DLIST concatonation API corner case.

This commit is contained in:
Dick Hollenbeck
2013-12-26 16:36:43 -06:00
parent 768f7c0e45
commit bf9db2148c
10 changed files with 97 additions and 91 deletions
+23 -22
View File
@@ -87,31 +87,32 @@ void DHEAD::append( EDA_ITEM* aNewElement )
void DHEAD::append( DHEAD& aList )
{
wxCHECK_RET( aList.GetCount() != 0, wxT( "Attempt to append empty list." ) );
// Change the item's list to me.
for( EDA_ITEM* item = aList.first; item != NULL; item = item->Next() )
item->SetList( this );
if( first ) // list is not empty, set last item's next to the first item in aList
if( aList.first )
{
wxCHECK_RET( last != NULL, wxT( "Last list element not set." ) );
// Change the item's list to me.
for( EDA_ITEM* item = aList.first; item; item = item->Next() )
item->SetList( this );
last->SetNext( aList.first );
aList.first->SetBack( last );
last = aList.last;
if( first ) // this list is not empty, set last item's next to the first item in aList
{
wxCHECK_RET( last != NULL, wxT( "Last list element not set." ) );
last->SetNext( aList.first );
aList.first->SetBack( last );
last = aList.last;
}
else // this list is empty, first and last are same as aList
{
first = aList.first;
last = aList.last;
}
count += aList.count;
aList.count = 0;
aList.first = NULL;
aList.last = NULL;
}
else // list is empty, first and last are same as aList
{
first = aList.first;
last = aList.last;
}
count += aList.count;
aList.count = 0;
aList.first = NULL;
aList.last = NULL;
}