mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Thread safety.
This commit is contained in:
parent
80c447f869
commit
1b21b880e6
@ -71,9 +71,8 @@ wxString ExpandTextVars( const wxString& aSource, const PROJECT* aProject, int a
|
|||||||
wxString ExpandTextVars( const wxString& aSource,
|
wxString ExpandTextVars( const wxString& aSource,
|
||||||
const std::function<bool( wxString* )>* aResolver, int aFlags )
|
const std::function<bool( wxString* )>* aResolver, int aFlags )
|
||||||
{
|
{
|
||||||
static wxRegEx userDefinedWarningError( wxS( "^(ERC|DRC)_(WARNING|ERROR).*$" ) );
|
wxString newbuf;
|
||||||
wxString newbuf;
|
size_t sourceLen = aSource.length();
|
||||||
size_t sourceLen = aSource.length();
|
|
||||||
|
|
||||||
newbuf.Alloc( sourceLen ); // best guess (improves performance)
|
newbuf.Alloc( sourceLen ); // best guess (improves performance)
|
||||||
|
|
||||||
@ -94,7 +93,10 @@ wxString ExpandTextVars( const wxString& aSource,
|
|||||||
if( token.IsEmpty() )
|
if( token.IsEmpty() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( ( aFlags & FOR_ERC_DRC ) == 0 && userDefinedWarningError.Matches( token ) )
|
if( ( aFlags & FOR_ERC_DRC ) == 0 && ( token.StartsWith( wxS( "ERC_WARNING" ) )
|
||||||
|
|| token.StartsWith( wxS( "ERC_ERROR" ) )
|
||||||
|
|| token.StartsWith( wxS( "DRC_WARNING" ) )
|
||||||
|
|| token.StartsWith( wxS( "DRC_ERROR" ) ) ) )
|
||||||
{
|
{
|
||||||
// Only show user-defined warnings/errors during ERC/DRC
|
// Only show user-defined warnings/errors during ERC/DRC
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user