This removes inheritance from the symbol.
This doesn't play well with undo, but then again, neither does symbol
deletion, so that seems like a higher-level symbol editor issue.
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8895
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo. Avoids needing to
repeatly update.
Also updates AUTHORS.txt from current repo with contributor names
SYMBOL_BUFFER GetSymbol and GetOriginal cannot return null,
as the SYMBOL_BUFFER class internally ensures that the
original and current symbol pointers are always filled
through checks in the ctor and setters.
This means that clients don't need to null-check the returns,
which is good because they mostly already do not.
Return references instead, to formalise the non-nullity of
these pointers and absolve the calling code of having to
consider if they might be null.
Previously, SYMBOL_BUFFER took plain pointers and took ownership
of it (plus the ownership of an internal new'd pointer).
Use unique_ptr to express this relationship more clearly and
safely.
Add a non-null assert in SYMBOL_BUFFER's ctor.
Use more restricted-scope variables in a couple of places where
a re-used variable was not required.
There are still memory-leak opportunities in here, for example
SaveBuffer new's things and can return without handing them over
or deleting.
Again, this doesn't retain part-ownership of the pointer
and null is a wxCHECK failure. So hoist the null check
and then handle it as a ref (=non null, caller owns).
Also fixes a trivial mem leak in test_symbol_library_manager.cpp.
DeleteBuffer took a std::shared_ptr by value. This means
it claims to take (and keep) part-ownership of the pointed-to
item. However, this function does not take any ownership or
change the item, it just refers to it. It also does not null-check
the pointer. So it should be a const reference to the item.
Ownership semantics are then: the caller retains ownership
while the function executes.
(It also saves a shared_ptr ref count, but that won't be
important here).
* Fix issue handling symbols with multiple inheritance.
* Remove unused code from the symbol library manager object.
* Splits out the library buffer and symbol buffer object so the can be unit
tested without having to mock the symbol library manager object.
* Add unit tests for library buffer and symbol buffer objects.