Undo commit -r 6389.

This commit is contained in:
Wayne Stambaugh 2016-02-15 15:19:22 -05:00
parent 73dc53dc35
commit 3d963166c7
5 changed files with 23 additions and 33 deletions

View File

@ -1253,31 +1253,6 @@ bool SCH_SHEET::IsModified() const
}
bool SCH_SHEET::IsAutoSaveRequired()
{
if( m_screen->IsModify() )
return true;
bool retv = false;
SCH_ITEM* item = m_screen->GetDrawItems();
while( item && !retv )
{
if( item->Type() == SCH_SHEET_T )
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
if( sheet->m_screen )
retv = sheet->m_screen->IsSave();
}
item = item->Next();
}
return retv;
}
void SCH_SHEET::ClearModifyStatus()
{
m_screen->ClrModify();

View File

@ -649,13 +649,6 @@ public:
*/
void ClearModifyStatus();
/**
* Function IsAutoSaveRequired
* checks the entire hierarchy for any modifications that require auto save.
* @return True if the hierarchy is modified otherwise false.
*/
bool IsAutoSaveRequired();
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override
#endif

View File

@ -684,6 +684,18 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
}
bool SCH_SHEET_LIST::IsAutoSaveRequired()
{
for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
{
if( sheet->LastScreen() && sheet->LastScreen()->IsSave() )
return true;
}
return false;
}
void SCH_SHEET_LIST::AnnotatePowerSymbols( PART_LIBS* aLibs )
{
int ref = 1;

View File

@ -436,6 +436,13 @@ public:
*/
SCH_SHEET_PATH* GetSheetByPath( const wxString aPath, bool aHumanReadable = true );
/**
* Function IsAutoSaveRequired
* checks the entire hierarchy for any modifications that require auto save.
* @return True if the hierarchy is modified otherwise false.
*/
bool IsAutoSaveRequired();
/**
* Function AnnotatePowerSymbols
* clear and annotates the entire hierarchy of the sheet path list.

View File

@ -1226,9 +1226,12 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
{
// In case this event happens before g_RootSheet is initialized which does happen
// on mingw64 builds.
if( g_RootSheet != NULL )
{
return g_RootSheet->IsAutoSaveRequired();
SCH_SHEET_LIST sheetList;
return sheetList.IsAutoSaveRequired();
}
return false;