libgeda: Make o_complex_copy() actually copy. [2460301]
commitea46d8defce4390b9650e8d2a5035de4794673df
authorPeter TB Brett <peter@peter-b.co.uk>
Wed, 12 Aug 2009 19:05:01 +0000 (12 20:05 +0100)
committerPeter TB Brett <peter@peter-b.co.uk>
Wed, 12 Aug 2009 19:05:01 +0000 (12 20:05 +0100)
treef42d360980c4ffef2ba4a627785209df68b8e63e
parent476299cad187c839cb252d6d2d985590f99bb6e9
libgeda: Make o_complex_copy() actually copy. [2460301]

In the past, o_complex_copy() has instantiated a new COMPLEX by
calling o_complex_new(), which reads in symbol data from the symbol
library.  A separate o_complex_copy_embedded() function performed a
copy for embedded objects, by actually performing a deep copy of the
COMPLEX to be copied.

Also note that components being placed from the component selector are
copied into place.

This lead to a bug reported by Peter Clifton, whereby the contents of
an embedded symbol could vary.

- If placed normally and then embedded, the attributes promoted out of
  the COMPLEX prior to preparing to place were "resurrected" by the
  magical file-reading powers of o_complex_copy(), and these
  attributes were then kept when the symbol was embedded.

- If placed as embedded, the attributes were *not* resurrected,
  meaning that the promotable attributes were *not* present in the
  embedded symbol.

This patch modifies o_complex_copy() to explicitly carry out a deep
copy of the object to be copied, removing the file-reading behaviour
(this seems to be the Right Thing in this context).  It also removes
o_complex_copy_embedded(), since it is then superfluous.
libgeda/include/libgeda/prototype.h
libgeda/src/o_complex_basic.c
libgeda/src/o_list.c