Don't copy embedded files for temp objects
Just takes a long time and we throw it away a ms later
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22547
(cherry picked from commit d94d2c9a05)
This commit is contained in:
@@ -591,6 +591,21 @@ EMBEDDED_FILES::EMBEDDED_FILES( const EMBEDDED_FILES& other ) :
|
||||
}
|
||||
|
||||
|
||||
EMBEDDED_FILES::EMBEDDED_FILES( const EMBEDDED_FILES& other, bool aDeepCopy ) :
|
||||
m_embedFonts( other.m_embedFonts )
|
||||
{
|
||||
if( aDeepCopy )
|
||||
{
|
||||
for( const auto& [name, file] : other.m_files )
|
||||
m_files[name] = new EMBEDDED_FILE( *file );
|
||||
|
||||
m_fontFiles = other.m_fontFiles;
|
||||
}
|
||||
|
||||
m_fileAddedCallback = other.m_fileAddedCallback;
|
||||
}
|
||||
|
||||
|
||||
// Copy assignment operator
|
||||
EMBEDDED_FILES& EMBEDDED_FILES::operator=( const EMBEDDED_FILES& other )
|
||||
{
|
||||
|
||||
@@ -165,9 +165,10 @@ LIB_SYMBOL::LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent, SYMBOL_LIB*
|
||||
}
|
||||
|
||||
|
||||
LIB_SYMBOL::LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary ) :
|
||||
LIB_SYMBOL::LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary,
|
||||
bool aCopyEmbeddedFiles ) :
|
||||
SYMBOL( aSymbol ),
|
||||
EMBEDDED_FILES( aSymbol ),
|
||||
EMBEDDED_FILES( aSymbol, aCopyEmbeddedFiles ),
|
||||
m_me( this, null_deleter() )
|
||||
{
|
||||
m_library = aLibrary;
|
||||
|
||||
@@ -84,7 +84,8 @@ public:
|
||||
LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent = nullptr,
|
||||
SYMBOL_LIB* aLibrary = nullptr );
|
||||
|
||||
LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr );
|
||||
LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr,
|
||||
bool aCopyEmbeddedFiles = true );
|
||||
|
||||
virtual ~LIB_SYMBOL()
|
||||
{}
|
||||
|
||||
@@ -2091,7 +2091,8 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer )
|
||||
std::vector<SCH_PIN*> originalPins = originalSymbol->GetPins( unit, bodyStyle );
|
||||
|
||||
// Copy the source so we can re-orient and translate it.
|
||||
LIB_SYMBOL tempSymbol( *originalSymbol );
|
||||
LIB_SYMBOL tempSymbol( *originalSymbol, nullptr, false );
|
||||
|
||||
std::vector<SCH_PIN*> tempPins = tempSymbol.GetPins( unit, bodyStyle );
|
||||
|
||||
tempSymbol.SetFlags( aSymbol->GetFlags() );
|
||||
@@ -2219,6 +2220,7 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer )
|
||||
m_gal->SetFillColor( marker_color );
|
||||
m_gal->DrawCurve( left, top, bottom, right, 1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
|
||||
EMBEDDED_FILES( EMBEDDED_FILES&& other ) noexcept;
|
||||
EMBEDDED_FILES( const EMBEDDED_FILES& other );
|
||||
EMBEDDED_FILES( const EMBEDDED_FILES& other, bool aDeepCopy );
|
||||
|
||||
~EMBEDDED_FILES()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user