Apache OpenOffice (AOO) Bugzilla – Issue 99711
stoc: unused code and bogus code
Last modified: 2009-07-24 10:53:10 UTC
in stoc/source/servicemanager/invocation.cxx we have some weirdness. a) pItems = new MemberItem[nTotalCount] with no matching delete[] b) ppItems = new MemberItems*[nTotalCount] with no matching delete[] c) the address of each item in pItems is assigned to a position in ppItems and then we sort "ppItems", so we have a nicely ordered set of pointers in ppItems. And then we traverse "pItems" in order, which of course remains in the original order. The intent may have been to either sort "pItems" or to traverse "ppItems" in order. Attached is option1 and option2. option1 removes ppItems and adds delete[] pItems and removes the useless sort, so current behaviour continues. Probably the preferred option, as what we're doing now presumably has been what we've been doing for a decade or so, so why change it. option2 removes ppItems and adds delete[] pItems and changes the sort to sort pItems which might have been the original intent
Created attachment 60543 [details] option 1
Created attachment 60544 [details] option 2
Stephan, please have a look ...
.
applied attached stoc.option1.patch (with slight modifications) as cws/sb109/stoc/source/invocation/invocation.cxx@270978 and cws/sb109/stoc/source/servicemanager/servicemanager.cxx@270978; generating sorted data (option 2) appears to be unnecessary
stoc went to 0 in m47, http://people.redhat.com/caolanm/callcatcher/DEV300_m47/ closing
*** Issue 103769 has been marked as a duplicate of this issue. ***