Be more explicit about string conversions.

This commit is contained in:
Jeff Young 2022-02-03 21:47:10 +00:00
parent 6905cfb95b
commit b9eb3e9b05
6 changed files with 19 additions and 28 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -449,8 +449,8 @@ int DIALOG_SHIM::ShowQuasiModal()
// Get the optimal parent
wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
wxASSERT_MSG( !m_qmodal_parent_disabler,
wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
wxASSERT_MSG( !m_qmodal_parent_disabler, wxT( "Caller using ShowQuasiModal() twice on same "
"window?" ) );
// quasi-modal: disable only my "optimal" parent
m_qmodal_parent_disabler = new WDO_ENABLE_DISABLE( parent );
@ -488,8 +488,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
if( !IsQuasiModal() )
{
wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
"wasn't called" );
wxFAIL_MSG( wxT( "Either DIALOG_SHIM::EndQuasiModal was called twice, or ShowQuasiModal"
"wasn't called" ) );
return;
}
@ -549,8 +549,7 @@ void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
ignore_unused( TransferDataFromWindow() );
}
}
else if( id == GetEscapeId() ||
(id == wxID_CANCEL && GetEscapeId() == wxID_ANY) )
else if( id == GetEscapeId() || (id == wxID_CANCEL && GetEscapeId() == wxID_ANY) )
{
EndQuasiModal( wxID_CANCEL );
}

View File

@ -374,14 +374,14 @@ void wordbreakMarkup( std::vector<std::pair<wxString, int>>* aWords,
}
else
{
wxString space( wxT( " " ) );
wxString space( wxS( " " ) );
wxString textRun( aNode->string() );
wxArrayString words;
wxStringSplit( textRun, words, ' ' );
if( textRun.EndsWith( " " ) )
words.Add( " " );
if( textRun.EndsWith( wxS( " " ) ) )
words.Add( wxS( " " ) );
for( size_t ii = 0; ii < words.size(); ++ii )
{
@ -430,8 +430,8 @@ void FONT::LinebreakText( wxString& aText, int aColumnWidth, const VECTOR2I& aSi
if( aItalic )
textStyle |= TEXT_STYLE::ITALIC;
int spaceWidth = GetTextAsGlyphs( nullptr, nullptr, " ", aSize, VECTOR2I(), ANGLE_0, false,
VECTOR2I(), textStyle ).x;
int spaceWidth = GetTextAsGlyphs( nullptr, nullptr, wxS( " " ), aSize, VECTOR2I(), ANGLE_0,
false, VECTOR2I(), textStyle ).x;
wxArrayString textLines;
wxStringSplit( aText, textLines, '\n' );

View File

@ -488,7 +488,7 @@ bool PROJECT_FILE::MigrateFromLegacy( wxConfigBase* aCfg )
std::vector<wxString> groups;
groups.emplace_back( "" );
groups.emplace_back( wxEmptyString );
auto loadLegacyPairs =
[&]( const std::string& aGroup ) -> bool

View File

@ -488,7 +488,7 @@ std::string FormatProbeItems( bool aSelectConnections, const std::deque<EDA_ITEM
wxString ref = symbol->GetField( REFERENCE_FIELD )->GetText();
parts.insert( "F" + EscapeString( ref, CTX_IPC ) );
parts.insert( wxT( "F" ) + EscapeString( ref, CTX_IPC ) );
break;
}
@ -515,7 +515,7 @@ std::string FormatProbeItems( bool aSelectConnections, const std::deque<EDA_ITEM
full_path += "/" + sheet->m_Uuid.AsString();
parts.insert( "S" + full_path );
parts.insert( wxT( "S" ) + full_path );
break;
}
@ -527,7 +527,7 @@ std::string FormatProbeItems( bool aSelectConnections, const std::deque<EDA_ITEM
wxString ref = symbol->GetField( REFERENCE_FIELD )->GetText();
parts.insert( "P" + EscapeString( ref, CTX_IPC ) + "/"
parts.insert( wxT( "P" ) + EscapeString( ref, CTX_IPC ) + wxT( "/" )
+ EscapeString( pin->GetShownNumber(), CTX_IPC ) );
break;

View File

@ -407,14 +407,6 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList )
aList.emplace_back( _( "Connection Name" ), UnescapeString( Name() ) );
// NOTE(JE) Disabling this for now, because net codes are generated in the netlist exporter
// in order to avoid sort costs. It may make sense to just tear out net codes from the
// CONNECTION_GRAPH entirely in the future, as they are mostly only useful for netlist exports.
#if 0
if( !IsBus() )
aList.emplace_back( _( "Net Code" ), wxString::Format( "%d", m_net_code ) );
#endif
if( auto alias = m_graph->GetBusAlias( m_name ) )
{
msg.Printf( _( "Bus Alias %s Members" ), m_name );
@ -447,14 +439,14 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList )
return;
if( IsBus() )
aList.emplace_back( "Bus Code", wxString::Format( "%d", m_bus_code ) );
aList.emplace_back( wxT( "Bus Code" ), wxString::Format( "%d", m_bus_code ) );
aList.emplace_back( "Subgraph Code", wxString::Format( "%d", m_subgraph_code ) );
aList.emplace_back( wxT( "Subgraph Code" ), wxString::Format( "%d", m_subgraph_code ) );
if( SCH_ITEM* driver = Driver() )
{
msg.Printf( "%s at %p", driver->GetSelectMenuText( EDA_UNITS::MILLIMETRES ), driver );
aList.emplace_back( "Connection Source", msg );
aList.emplace_back( wxT( "Connection Source" ), msg );
}
#endif
}

View File

@ -952,7 +952,7 @@ void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
}
#if 0
// useful for debug only
aList.emplace_back( "UUID", m_Uuid.AsString() );
aList.emplace_back( wxT( "UUID" ), m_Uuid.AsString() );
#endif
}