Eeschema: fix large diffs when saving schematics.
Apparently the < operator was never implemented for SCH_JUNCTION objects
so they were not get sorted which was causing the large diffs between
schematic saves.
Fixes https://gitlab.com/kicad/code/kicad/issues/4370
(cherry picked from commit 35f3eb6220
)
This commit is contained in:
parent
86a710e175
commit
5ef9db6d67
|
@ -223,3 +223,22 @@ BITMAP_DEF SCH_JUNCTION::GetMenuImage() const
|
||||||
{
|
{
|
||||||
return add_junction_xpm;
|
return add_junction_xpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SCH_JUNCTION::operator <( const SCH_ITEM& aItem ) const
|
||||||
|
{
|
||||||
|
if( Type() != aItem.Type() )
|
||||||
|
return Type() < aItem.Type();
|
||||||
|
|
||||||
|
if( GetLayer() != aItem.GetLayer() )
|
||||||
|
return GetLayer() < aItem.GetLayer();
|
||||||
|
|
||||||
|
auto junction = static_cast<const SCH_JUNCTION*>( &aItem );
|
||||||
|
|
||||||
|
if( GetPosition().x != junction->GetPosition().x )
|
||||||
|
return GetPosition().x < junction->GetPosition().x;
|
||||||
|
|
||||||
|
return GetPosition().y < junction->GetPosition().y;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,8 @@ public:
|
||||||
|
|
||||||
EDA_ITEM* Clone() const override;
|
EDA_ITEM* Clone() const override;
|
||||||
|
|
||||||
|
virtual bool operator <( const SCH_ITEM& aItem ) const override;
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
void Show( int nestLevel, std::ostream& os ) const override;
|
void Show( int nestLevel, std::ostream& os ) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue