7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Revert "Do not use schematic object UUID comparisons when UUIDs are mutable."

This reverts commit 1dfe3ebc54.
This commit is contained in:
Wayne Stambaugh 2025-01-24 15:30:25 -05:00
parent 1dfe3ebc54
commit 4e80c6fdc1
5 changed files with 4 additions and 30 deletions

View File

@ -442,14 +442,11 @@ int SCH_ITEM::compare( const SCH_ITEM& aOther, int aCompareFlags ) const
return 0;
}
if( isUuidImmutable() )
{
if( m_Uuid < aOther.m_Uuid )
return -1;
if( m_Uuid < aOther.m_Uuid )
return -1;
if( m_Uuid > aOther.m_Uuid )
return 1;
}
if( m_Uuid > aOther.m_Uuid )
return 1;
return 0;
}

View File

@ -665,19 +665,6 @@ protected:
void getSymbolEditorMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
/**
* Return the status of the #SCH_ITEM objects UUID immutability.
*
* This method is used by compare() to determine if the object's UUIDs should be compared.
* Most #SCH_ITEM object UUIDs are created at run time an therefore should not be compared
* so the default returns false. Override this method for #SCH_ITEM objects that have
* immutable UUIDs.
*
* @retval true if the item's UUID is immutable.
* @retval false if the item's UUID is not immutable.
*/
virtual bool isUuidImmutable() const { return false; }
/**
* Provide the draw object specific comparison called by the == and < operators.
*

View File

@ -1887,11 +1887,6 @@ wxString SCH_PIN::getItemDescription( ALT* aAlt ) const
}
bool SCH_PIN::isUuidImmutable() const
{
// SCH_SYMBOL pin UUIDs are immutable. LIB_SYMBOL pins UUIDs are not immutable.
return ( static_cast<SCH_SYMBOL*>( GetParent() ) != nullptr );
}
int SCH_PIN::compare( const SCH_ITEM& aOther, int aCompareFlags ) const

View File

@ -333,9 +333,6 @@ protected:
*/
void printPinElectricalTypeName( const RENDER_SETTINGS* aSettings, const VECTOR2I& aPosition,
PIN_ORIENTATION aOrientation, bool aDimmed );
virtual bool isUuidImmutable() const override;
std::ostream& operator<<( std::ostream& aStream );
private:

View File

@ -208,8 +208,6 @@ public:
std::vector<int> ViewGetLayers() const override;
protected:
virtual bool isUuidImmutable() const override { return true; }
TRANSFORM m_transform; ///< The rotation/mirror transformation.
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to