Increment numbers which have suffixes too.
Fixes https://gitlab.com/kicad/code/kicad/issues/9706
This commit is contained in:
parent
4e0ad07eb0
commit
016a98df86
|
@ -57,13 +57,15 @@ bool IncrementLabelMember( wxString& name, int aIncrement )
|
|||
if( name.IsEmpty() )
|
||||
return true;
|
||||
|
||||
int ii = name.Len() - 1;
|
||||
|
||||
// Ignore formatting constructs
|
||||
if( name.GetChar( ii ) == '}' )
|
||||
ii--;
|
||||
|
||||
wxString suffix;
|
||||
wxString digits;
|
||||
int ii = name.Len() - 1;
|
||||
|
||||
while( ii >= 0 && !wxIsdigit( name.GetChar( ii ) ) )
|
||||
{
|
||||
suffix = name.GetChar( ii ) + suffix;
|
||||
ii--;
|
||||
}
|
||||
|
||||
while( ii >= 0 && wxIsdigit( name.GetChar( ii ) ) )
|
||||
{
|
||||
|
@ -85,7 +87,7 @@ bool IncrementLabelMember( wxString& name, int aIncrement )
|
|||
if( number > -1 )
|
||||
{
|
||||
name.Remove( ii + 1 );
|
||||
name << number;
|
||||
name << number << suffix;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue