mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Nullptr safety.
This commit is contained in:
parent
68f1cd0a08
commit
6609e79868
@ -601,6 +601,8 @@ void SCH_COMMIT::Revert()
|
||||
|
||||
case CHT_MODIFY:
|
||||
{
|
||||
wxCHECK2( copy, break );
|
||||
|
||||
if( view )
|
||||
view->Remove( item );
|
||||
|
||||
|
@ -2490,6 +2490,8 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
|
||||
SPIN_STYLE spinStyle = SPIN_STYLE::SPIN::RIGHT;
|
||||
LABEL_FLAG_SHAPE shape = LABEL_FLAG_SHAPE::L_UNSPECIFIED;
|
||||
|
||||
wxCHECK2( sourceText, continue );
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case SCH_LABEL_T:
|
||||
@ -2587,24 +2589,24 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
|
||||
|
||||
auto getValidNetname =
|
||||
[]( const wxString& aText )
|
||||
{
|
||||
wxString local_txt = aText;
|
||||
local_txt.Replace( "\n", "_" );
|
||||
local_txt.Replace( "\r", "_" );
|
||||
local_txt.Replace( "\t", "_" );
|
||||
{
|
||||
wxString local_txt = aText;
|
||||
local_txt.Replace( "\n", "_" );
|
||||
local_txt.Replace( "\r", "_" );
|
||||
local_txt.Replace( "\t", "_" );
|
||||
|
||||
// Bus groups can have spaces; bus vectors and signal names cannot
|
||||
if( !NET_SETTINGS::ParseBusGroup( aText, nullptr, nullptr ) )
|
||||
local_txt.Replace( " ", "_" );
|
||||
// Bus groups can have spaces; bus vectors and signal names cannot
|
||||
if( !NET_SETTINGS::ParseBusGroup( aText, nullptr, nullptr ) )
|
||||
local_txt.Replace( " ", "_" );
|
||||
|
||||
// label strings are "escaped" i.e. a '/' is replaced by "{slash}"
|
||||
local_txt = EscapeString( local_txt, CTX_NETNAME );
|
||||
// label strings are "escaped" i.e. a '/' is replaced by "{slash}"
|
||||
local_txt = EscapeString( local_txt, CTX_NETNAME );
|
||||
|
||||
if( local_txt.IsEmpty() )
|
||||
return _( "<empty>" );
|
||||
else
|
||||
return local_txt;
|
||||
};
|
||||
if( local_txt.IsEmpty() )
|
||||
return _( "<empty>" );
|
||||
else
|
||||
return local_txt;
|
||||
};
|
||||
|
||||
switch( convertTo )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user