On 13/06/2010 22:36, Bartosz Kosiorek wrote: > Hi. hi Bartosz,
> In the > http://wiki.services.openoffice.org/wiki/To-Dos#Replace_code_with_3rd_party > there is section about "Replace self made containers with STL containers. > SvPointerArray, BigPointerArray" > But in higher section there is "Remove duplicate code: BigPointerArray vs. > SvPointerArray" > So should we replace this arrays with "STL containers" or merge > SvPointerArray and BigPointerArray? > > On which container we could replace this obsolete arrays? there are lots of SvArray containers defined in the files: http://svn.services.openoffice.org/opengrok/xref/DEV300_m82/svl/inc/svl/svarray.hxx http://svn.services.openoffice.org/opengrok/xref/DEV300_m82/svl/source/memtools/svarray.cxx these are defined as a bunch of ugly macros, and were designed in the early 90ies when STL did not exist. [ kr once told me that a couple years ago, they even had a ridiculously inefficient linear memory allocation policy, but that is hopefully fixed now :) ] one of the deficiencies is that there's no way to put a smart pointer into them, so what you have to do is put a pointer to the smart pointer into them, and (sometimes) explicitly delete that pointer to smart pointer, which is really retarded. the SvArrays should be replaced by appropriate STL types (mostly vector, i guess, but probably in some cases stacks or deques or something else). the BigPointerArray is the core data structure used for Writer documents; it is not a flat array, but an array of arrays, because that limits the effort needed when a node is deleted (all subsequent nodes must be relocated in the array!). that is not so easy to replace, so it has a lower priority. > What is your opinion? that it's about time that somebody works on this :) > Best Regards > Bartosz regards, michael -- "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -- Martin Fowler et al, Refactoring: Improving the Design of Existing Code --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org