diff --git a/common/page_layout/page_layout_reader.cpp b/common/page_layout/page_layout_reader.cpp index 3091950b53..184eab4a8f 100644 --- a/common/page_layout/page_layout_reader.cpp +++ b/common/page_layout/page_layout_reader.cpp @@ -36,6 +36,9 @@ #include #include +#include +#include + using namespace TB_READER_T; @@ -330,7 +333,7 @@ void PAGE_LAYOUT_READER_PARSER::parsePolyOutline( WORKSHEET_DATAITEM_POLYPOLYGON } } -#include + void PAGE_LAYOUT_READER_PARSER::parseBitmap( WORKSHEET_DATAITEM_BITMAP * aItem ) { T token; @@ -766,7 +769,7 @@ void WORKSHEET_LAYOUT::SetDefaultLayout() // Returns defaultPageLayout as a string; wxString WORKSHEET_LAYOUT::DefaultLayout() { - return wxString(defaultPageLayout); + return wxString( defaultPageLayout ); } // emptyPageLayout is a "empty" page layout description @@ -780,17 +783,13 @@ void WORKSHEET_LAYOUT::SetEmptyLayout() SetPageLayout( emptyPageLayout, false, wxT( "empty page" ) ); } -// Returns emptyPageLayout as a string; + wxString WORKSHEET_LAYOUT::EmptyLayout() { - return wxString(emptyPageLayout); + return wxString( emptyPageLayout ); } -/** - * Populates the list from a S expr description stored in a string - * @param aPageLayout = the S expr string - */ void WORKSHEET_LAYOUT::SetPageLayout( const char* aPageLayout, bool Append, const wxString& aSource ) { if( ! Append ) @@ -808,12 +807,7 @@ void WORKSHEET_LAYOUT::SetPageLayout( const char* aPageLayout, bool Append, cons } } -#include -// SetLayout() try to load the aFullFileName custom layout file, -// if aFullFileName is empty, try the filename defined by the -// environment variable KICAD_WKSFILE (a *.kicad_wks filename). -// if does not exists, loads the default page layout. void WORKSHEET_LAYOUT::SetPageLayout( const wxString& aFullFileName, bool Append ) { wxString fullFileName = aFullFileName; diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index de1b334db2..97c7bd23dc 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -425,12 +425,15 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway, m_pi->SaveLibrary( getLibFileName().GetFullPath() ); + // Eagle sheets do not use a worksheet frame by default WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance(); - pglayout.SetEmptyLayout( ); + pglayout.SetEmptyLayout(); - wxFileName layoutfn( m_kiway->Prj().GetProjectPath(), "empty.kicad_wks"); + wxFileName layoutfn( m_kiway->Prj().GetProjectPath(), "empty.kicad_wks" ); wxFile layoutfile; - if( layoutfile.Create( layoutfn.GetFullPath() ) ) { + + if( layoutfile.Create( layoutfn.GetFullPath() ) ) + { layoutfile.Write( WORKSHEET_LAYOUT::EmptyLayout() ); layoutfile.Close(); }