wxStringTokenizer usage cleanup.
1) Always be explicit about what the delimiters are 2) If space is a delimiter, we probably want to skip empty fields (wxTOKEN_STRTOK) 3) If space is not a delimiter, we often need to trim the resultant tokens 4) Be more lenient about \t\r\n (and when they are included, include them in the same order)
This commit is contained in:
@@ -143,10 +143,10 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
|
||||
std::vector<wxString> pages;
|
||||
wxString pagesStr = From_UTF8( m_argParser.get<std::string>( ARG_PAGES ).c_str() );
|
||||
wxStringTokenizer tokenizer( pagesStr, "," );
|
||||
wxStringTokenizer tokenizer( pagesStr, ",", wxTOKEN_STRTOK );
|
||||
|
||||
while( tokenizer.HasMoreTokens() )
|
||||
pages.push_back( tokenizer.GetNextToken().Trim() );
|
||||
pages.push_back( tokenizer.GetNextToken().Trim( wxString::both) );
|
||||
|
||||
std::unique_ptr<JOB_EXPORT_SCH_PLOT> plotJob;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user