diff --git a/kicad/dialogs/dialog_template_selector_base.cpp b/kicad/dialogs/dialog_template_selector_base.cpp index a8f40c48aa..5eec1bfa0f 100644 --- a/kicad/dialogs/dialog_template_selector_base.cpp +++ b/kicad/dialogs/dialog_template_selector_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Apr 23 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -102,7 +102,7 @@ TEMPLATE_SELECTION_PANEL_BASE::~TEMPLATE_SELECTION_PANEL_BASE() TEMPLATE_WIDGET_BASE::TEMPLATE_WIDGET_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) { - this->SetMinSize( wxSize( 74,-1 ) ); + this->SetMinSize( wxSize( 74,150 ) ); this->SetMaxSize( wxSize( 74,-1 ) ); wxBoxSizer* bSizer4; diff --git a/kicad/dialogs/dialog_template_selector_base.fbp b/kicad/dialogs/dialog_template_selector_base.fbp index 513197df81..2d3b44e46a 100644 --- a/kicad/dialogs/dialog_template_selector_base.fbp +++ b/kicad/dialogs/dialog_template_selector_base.fbp @@ -14,6 +14,7 @@ dialog_template_selector_base 1000 none + 1 DIALOG_TEMPLATE_SELECTOR_BASE @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -644,7 +646,7 @@ 0 wxID_ANY 74,-1 - 74,-1 + 74,150 TEMPLATE_WIDGET_BASE 74,118 diff --git a/kicad/dialogs/dialog_template_selector_base.h b/kicad/dialogs/dialog_template_selector_base.h index 283ec7ba30..d1ae7a38f5 100644 --- a/kicad/dialogs/dialog_template_selector_base.h +++ b/kicad/dialogs/dialog_template_selector_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Apr 23 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp index af82fc824d..e4c697c12d 100644 --- a/kicad/project_template.cpp +++ b/kicad/project_template.cpp @@ -253,27 +253,25 @@ wxString* PROJECT_TEMPLATE::GetTitle(void) while( input.IsOk() && !input.Eof() && !done ) { wxString line = text.ReadLine(); + wxString upperline = line.Clone().Upper(); - start = line.Find( wxT( "" ) ); - if( start == wxNOT_FOUND ) - start = line.Find( wxT( "<TITLE>" ) ); - - finish = line.Find( wxT( "" ) ); - if( finish == wxNOT_FOUND ) - finish = line.Find( wxT( "" ) ); + start = upperline.Find( wxT( "" ) ); + finish = upperline.Find( wxT( "" ) ); + int length = finish - start - 7; // find the opening tag if( start != wxNOT_FOUND ) { if( finish != wxNOT_FOUND ) { - title = line.SubString( start + 7, finish ); + title = line( start + 7, length ); } else { - title = line.SubString( start + 7, line.Len() - 1 ); - done = true; + title = line.Mid( start + 7 ); } + + done = true; } else { @@ -282,15 +280,11 @@ wxString* PROJECT_TEMPLATE::GetTitle(void) title += line.SubString( 0, finish ); done = true; } - else - { - title += line; - } } // Remove line endings - title.Replace( wxT( "\r" ), wxT( "" ) ); - title.Replace( wxT( "\n" ), wxT( "" ) ); + title.Replace( wxT( "\r" ), wxT( " " ) ); + title.Replace( wxT( "\n" ), wxT( " " ) ); } }