Apache OpenOffice (AOO) Bugzilla – Issue 23145
API: cfgmgr2.OSetElementGroupUpdateAccess::XChild
Last modified: 2017-05-20 09:32:10 UTC
XChild::getParent() does return null, although a parent should be returned. See attached example code.
Created attachment 11719 [details] Test code. Just unpack and follow the README.
The behavior is correct. A OSetElement...Access can be in one of two states: Inserted or free. An inserted object can be accessed as element of a set and returns that set as its parent. It must not be disposed (the parent is the owner). It can be removed from the parent (via removeByName) or replaced by another object in the parent (via replaceByName()) to become free. A free object is not element of a set and returns NULL for its parent. A freshly created (via XSingleServiceFactory::createInstance()) object starts life free. It should be disposed by client code when done. It can be inserted into a set (via insertByName() or replaceByName()) and then enters the inserted state. The object in the test case is created free and never inserted, so returning NULL is correct behavior.
Return to submitter as worksforme
and changing to resolved again
Reviewed again, and found behaviour to be indeed correct. This means the test has to be changed.
change test later.
set target correctly.