Don't double-up FUTURE_FORMAT_ERROR problem strings.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14780
This commit is contained in:
Jeff Young 2023-05-31 00:45:07 +01:00
parent 86abfd2cef
commit e82e4af483
1 changed files with 11 additions and 3 deletions

View File

@ -120,10 +120,18 @@ FUTURE_FORMAT_ERROR::FUTURE_FORMAT_ERROR( const PARSE_ERROR& aParseError,
const wxString& aRequiredVersion ) :
PARSE_ERROR()
{
init( aRequiredVersion );
if( const FUTURE_FORMAT_ERROR* ffe = dynamic_cast<const FUTURE_FORMAT_ERROR*>( &aParseError ) )
{
requiredVersion = ffe->requiredVersion;
problem = ffe->Problem();
}
else
{
init( aRequiredVersion );
if( !aParseError.Problem().IsEmpty() )
problem += wxS( "\n\n" ) + _( "Full error text:" ) + wxS( "\n" ) + aParseError.Problem();
if( !aParseError.Problem().IsEmpty() )
problem += wxS( "\n\n" ) + _( "Full error text:" ) + wxS( "\n" ) + aParseError.Problem();
}
lineNumber = aParseError.lineNumber;
byteIndex = aParseError.byteIndex;