From b310d433f888f96078651f981df116e862f512ac Mon Sep 17 00:00:00 2001 From: Michael Kavanagh Date: Wed, 7 Nov 2018 23:07:38 +0000 Subject: [PATCH] Enable creation and use of empty page layout MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.19.1" This is a multi-part message in MIME format. --------------2.19.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Also default new page layout to be blank. Fixes: lp:1486031 https://bugs.launchpad.net/kicad/+bug/1486031 --- common/page_layout/title_block_shapes.cpp | 5 ----- common/page_layout/worksheet_layout.cpp | 1 - include/worksheet_shape_builder.h | 19 ------------------- pagelayout_editor/files.cpp | 1 - pagelayout_editor/pl_editor_frame.cpp | 7 +------ 5 files changed, 1 insertion(+), 32 deletions(-) --------------2.19.1 Content-Type: text/x-patch; name="0001-Enable-creation-and-use-of-empty-page-layout.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-Enable-creation-and-use-of-empty-page-layout.patch" diff --git a/common/page_layout/title_block_shapes.cpp b/common/page_layout/title_block_shapes.cpp index 72f75d28f..bd4736a19 100644 --- a/common/page_layout/title_block_shapes.cpp +++ b/common/page_layout/title_block_shapes.cpp @@ -83,10 +83,6 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList( SetMargins( LTmargin, RBmargin ); SetPageSize( aPageInfo.GetSizeMils() ); - // Build the basic layout shape, if the layout list is empty - if( pglayout.GetCount() == 0 && !pglayout.VoidListAllowed() ) - pglayout.SetPageLayout(); - WORKSHEET_DATAITEM::m_WSunits2Iu = m_milsToIu / milsTomm; WORKSHEET_DATAITEM::m_Color = aColor; // the default color to draw items WORKSHEET_DATAITEM::m_AltColor = aAltColor; // an alternate color to draw items @@ -255,4 +251,3 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList( } } } - diff --git a/common/page_layout/worksheet_layout.cpp b/common/page_layout/worksheet_layout.cpp index 1416bc57f..a14ed3e76 100644 --- a/common/page_layout/worksheet_layout.cpp +++ b/common/page_layout/worksheet_layout.cpp @@ -65,7 +65,6 @@ static WORKSHEET_LAYOUT* wksAltInstance; WORKSHEET_LAYOUT::WORKSHEET_LAYOUT() { - m_allowVoidList = false; m_leftMargin = 10.0; // the left page margin in mm m_rightMargin = 10.0; // the right page margin in mm m_topMargin = 10.0; // the top page margin in mm diff --git a/include/worksheet_shape_builder.h b/include/worksheet_shape_builder.h index a9418b466..dc670aa80 100644 --- a/include/worksheet_shape_builder.h +++ b/include/worksheet_shape_builder.h @@ -603,10 +603,6 @@ public: class WORKSHEET_LAYOUT { std::vector m_list; - bool m_allowVoidList; // If false, the default page layout - // will be loaded the first time - // WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList - // is run (useful mainly for page layout editor) double m_leftMargin; // the left page margin in mm double m_rightMargin; // the right page margin in mm double m_topMargin; // the top page margin in mm @@ -641,21 +637,6 @@ public: void SetTopMargin( double aMargin ); void SetBottomMargin( double aMargin ); - /** - * In Kicad applications, a page layout description is needed - * So if the list is empty, a default description is loaded, - * the first time a page layout is drawn. - * However, in page layout editor, an empty list is acceptable. - * AllowVoidList allows or not the empty list - */ - void AllowVoidList( bool Allow ) { m_allowVoidList = Allow; } - - /** - * @return true if an empty list is allowed - * (mainly allowed for page layout editor). - */ - bool VoidListAllowed() { return m_allowVoidList; } - /** * erase the list of items */ diff --git a/pagelayout_editor/files.cpp b/pagelayout_editor/files.cpp index 547da52ec..c0d9a6773 100644 --- a/pagelayout_editor/files.cpp +++ b/pagelayout_editor/files.cpp @@ -108,7 +108,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) switch( id ) { case wxID_NEW: - pglayout.AllowVoidList( true ); SetCurrFileName( wxEmptyString ); pglayout.ClearList(); OnNewPageLayout(); diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 9556a8c5d..ae24d42fb 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -144,12 +144,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : // Initialize the current page layout WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance(); -#if 0 //start with empty layout - pglayout.AllowVoidList( true ); - pglayout.ClearList(); -#else // start with the default Kicad layout - pglayout.SetPageLayout(); -#endif + pglayout.ClearList(); //start with empty layout OnNewPageLayout(); } --------------2.19.1--