bool SCH_FIND_COLLECTOR::ReplaceItem( SCH_SHEET_PATH* aSheetPath ) { if( PassedEnd() ) return false; wxCHECK_MSG( IsValidIndex( m_foundIndex ), false, wxT( "Invalid replace list index in SCH_FIND_COLLECTOR." ) ); EDA_ITEM* item = m_List[ m_foundIndex ]; bool replaced = item->Replace( m_findReplaceData, aSheetPath ); if( replaced ) SetForceSearch(); return replaced; }
bool SCH_FIND_COLLECTOR::ReplaceItem() { if( atEnd() ) return false; wxCHECK_MSG( IsValidIndex( m_foundIndex ), false, wxT( "Invalid replace list index in SCH_FIND_COLLECTOR." ) ); EDA_ITEM* item = m_List[ m_foundIndex ]; bool replaced = item->Replace( m_findReplaceData ); // If the replace was successful, remove the item from the find list to prevent // iterating back over it again. if( replaced ) { Remove( m_foundIndex ); m_data.erase( m_data.begin() + m_foundIndex ); } return replaced; }