void SCH_SCREEN::CheckComponentsToPartsLinks()
{
    // Initialize or reinitialize the pointer to the LIB_PART for each component
    // found in m_drawList, but only if needed (change in lib or schematic)
    // therefore the calculation time is usually very low.

    if( m_drawList.GetCount() )
    {
        PART_LIBS*  libs = Prj().SchLibs();
        int         mod_hash = libs->GetModifyHash();

        // Must we resolve?
        if( m_modification_sync != mod_hash )
        {
            SCH_TYPE_COLLECTOR c;

            c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly );

            SCH_COMPONENT::ResolveAll( c, libs );

            m_modification_sync = mod_hash;     // note the last mod_hash

            // guard against unneeded runs through this code path by printing trace
            DBG(printf("%s: resync-ing %s\n", __func__, TO_UTF8( GetFileName() ) );)
        }
bool SCH_EDIT_FRAME::IsSearchCacheObsolete( const SCH_FIND_REPLACE_DATA& aSearchCriteria )
{
    PART_LIBS*  libs = Prj().SchLibs();
    int         mod_hash = libs->GetModifyHash();

    // the cache is obsolete whenever any library changes.
    if( mod_hash != m_foundItems.GetLibHash() )
    {
        m_foundItems.SetForceSearch();
        m_foundItems.SetLibHash( mod_hash );
        return true;
    }
    else if( m_foundItems.IsSearchRequired( aSearchCriteria ) )
        return true;
    else
        return false;
}
void SCH_SCREEN::BuildSchCmpLinksToLibCmp()
{
    // Initialize or reinitialize the pointer to the LIB_PART for each component
    // found in m_drawList, but only if needed (change in lib or schematic)
    // therefore the calculation time is usually very low.

    if( m_drawList.GetCount() )
    {
        PART_LIBS*  libs = Prj().SchLibs();
        int         mod_hash = libs->GetModifyHash();

        // Must we resolve?
        if( m_modification_sync != mod_hash )
        {
            SCH_TYPE_COLLECTOR c;

            c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly );

            SCH_COMPONENT::ResolveAll( c, libs );

            m_modification_sync = mod_hash;     // note the last mod_hash
        }
    }
}