Browse Source

Fully order schematic saves

newinvert
Seth Hillbrand 2 years ago
parent
commit
e14e956c1d
  1. 3
      eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp
  2. 10
      eeschema/sch_sheet_path.cpp
  3. 4
      eeschema/sch_sheet_path.h
  4. 8
      eeschema/sch_symbol.cpp
  5. 3
      eeschema/sch_symbol.h

3
eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp

@ -648,9 +648,6 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
{
wxCHECK_RET( aSymbol != nullptr && m_out != nullptr, "" );
// Sort symbol instance data to minimize file churn.
aSymbol->SortInstances( SortSymbolInstancesByProjectUuid );
std::string libName;
wxString symbol_name = aSymbol->GetLibId().Format();

10
eeschema/sch_sheet_path.cpp

@ -94,16 +94,6 @@ public:
#endif
};
bool SortSymbolInstancesByProjectUuid( const SCH_SYMBOL_INSTANCE& aLhs,
const SCH_SYMBOL_INSTANCE& aRhs )
{
wxCHECK( !aLhs.m_Path.empty() && !aRhs.m_Path.empty(), false );
return aLhs.m_Path[0] < aRhs.m_Path[0];
}
namespace std
{
size_t hash<SCH_SHEET_PATH>::operator()( const SCH_SHEET_PATH& path ) const

4
eeschema/sch_sheet_path.h

@ -58,10 +58,6 @@ struct SCH_SYMBOL_INSTANCE
};
extern bool SortSymbolInstancesByProjectUuid( const SCH_SYMBOL_INSTANCE& aLhs,
const SCH_SYMBOL_INSTANCE& aRhs );
/**
* A simple container for sheet instance information.
*/

8
eeschema/sch_symbol.cpp

@ -625,14 +625,6 @@ void SCH_SYMBOL::RemoveInstance( const KIID_PATH& aInstancePath )
}
void SCH_SYMBOL::SortInstances( bool (*aSortFunction)( const SCH_SYMBOL_INSTANCE& aLhs,
const SCH_SYMBOL_INSTANCE& aRhs ) )
{
if( m_instanceReferences.size() > 1 )
std::sort( m_instanceReferences.begin(), m_instanceReferences.end(), aSortFunction );
}
void SCH_SYMBOL::AddHierarchicalReference( const KIID_PATH& aPath, const wxString& aRef, int aUnit )
{
// Search for an existing path and remove it if found (should not occur)

3
eeschema/sch_symbol.h

@ -176,9 +176,6 @@ public:
void RemoveInstance( const KIID_PATH& aInstancePath );
void SortInstances( bool ( *aSortFunction )( const SCH_SYMBOL_INSTANCE& aLhs,
const SCH_SYMBOL_INSTANCE& aRhs ) );
/**
* Return true for items which are moved with the anchor point at mouse cursor
* and false for items moved with no reference to anchor.

Loading…
Cancel
Save