This fix required sorting all of the LIB_PART draw items to ensure
accurate comparison between the symbols stored in the schematic and the
original library symbols. This has a noticeable impact on symbol library
load performance. It may also cause significant changes the next time
the library is saved due to changes in the draw item sorting. Hashing
may be a better solution here but this addressed the immediate problem.
A skeleton method SCH_SCREEN::SwapSymbolLinks() was added because there
is most likely an issue with orphaned symbols in the schematic library
symbol cache during undo/redo operations. More testing is required to
verify this.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7263
Consider a pin synchronized iff the names and electrical types match in
addition to the position, orientation and demorgan variant.
Also, only modify one matching pin per unit. This prevents
moving/editing a full stack of pins on the same unit when synchonized.
Fixes https://gitlab.com/kicad/code/kicad/issues/2590