From ee23342e313d3fe9366ee9a70a072d00d3fe135c Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 15 Feb 2016 15:10:57 -0500 Subject: [PATCH] Undo commit -r6541. --- eeschema/files-io.cpp | 2 +- eeschema/sch_sheet.cpp | 24 ++++++------------------ eeschema/sch_sheet.h | 12 ------------ 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index ff0c5f3769..e0a6ee6417 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -327,7 +327,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); Zoom_Automatique( false ); SetSheetNumberAndCount(); - g_RootSheet->SetPageNumbers(); + m_canvas->Refresh( true ); return true; diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 4d149a1e6d..d197b4d22f 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -56,7 +56,6 @@ SCH_SHEET::SCH_SHEET( const wxPoint& pos ) : m_screen = NULL; m_name.Printf( wxT( "Sheet%8.8lX" ), (long) m_TimeStamp ); m_fileName.Printf( wxT( "file%8.8lX.sch" ), (long) m_TimeStamp ); - m_number = 1; } @@ -73,7 +72,6 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) : m_name = aSheet.m_name; m_fileName = aSheet.m_fileName; m_pins = aSheet.m_pins; - m_number = aSheet.m_number; for( size_t i = 0; i < m_pins.size(); i++ ) m_pins[i].SetParent( this ); @@ -184,6 +182,11 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg ) SCH_SHEET_PIN* sheetPin; char* ptcar; + if( IsRootSheet() ) + m_number = 1; + else + m_number = GetRootSheet()->CountSheets(); + SetTimeStamp( GetNewTimeStamp() ); // sheets are added to the GetDrawItems() like other schematic components. @@ -1163,21 +1166,6 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter ) } -void SCH_SHEET::SetPageNumbers() -{ - int pageNumber = 1; - std::vector< const SCH_SHEET* > sheets; - - GetRootSheet()->GetSheets( sheets ); - - for( unsigned i = 0; i < sheets.size(); i++ ) - { - const_cast< SCH_SHEET* >( sheets[i] )->m_number = pageNumber; - pageNumber += 1; - } -} - - SCH_SHEET* SCH_SHEET::FindSheetByName( const wxString& aSheetName ) { std::vector< const SCH_SHEET* > sheets; @@ -1187,7 +1175,7 @@ SCH_SHEET* SCH_SHEET::FindSheetByName( const wxString& aSheetName ) for( unsigned i = 0; i < sheets.size(); i++ ) { if( sheets[i]->GetName().CmpNoCase( aSheetName ) == 0 ) - return const_cast< SCH_SHEET* >( sheets[i] ); + return const_cast< SCH_SHEET*>( sheets[i] ); } return NULL; diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index f5182f8b97..5e11eb6dab 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -610,18 +610,6 @@ public: EDA_ITEM* Clone() const; - /** - * Function SetPageNumbers - * - * sets the page numbers for each sheet by load order. - * - * The root sheet is always used to set the page numbers no matter which sheet this - * function is called. This function will only have meaning when loading legacy - * schematics. The upcoming s-expression schematic file format will allow for user - * defined page numbers. - */ - void SetPageNumbers(); - /** * Function FindSheetByName *