[Libreoffice] [PATCH] Replaced tools/list with std::vector in funcdesc.hxx / funcdesc.cxx

Kohei Yoshida kyoshida at novell.com
Fri Jan 28 19:35:23 PST 2011

On Fri, 2011-01-28 at 19:57 +0100, Soeren Moeller wrote:
> Hi
> In the attached patches (0001 is the real patch, 0002 contains three
> comments missing in 0001) we have replaced use of tools/list by use of
> std::vector in ScFunctionMgr and ScFunctionCategory (in
> sc/inc/funcdesc.hxx and sc/source/core/funcdesc.cxx). We choose
> vector, as there is done random access to the lists, while they are
> only modified once (at creation). We changed the behaviour of
> ScFunctionMgr slightly, as Get() now no longer resets the iterators
> for First() and Next(), as this is quite counter intuitive. The patch
> builds fine, and the behaviour of scalc seems unchanged.

Yup, looks good, though I had to fix one memory leak in the Get() method
where the 'dummy' object was created on the heap but never deleted.  In
a situation like that, boost::scoped_ptr comes very handy as it
automatically deletes the object it houses when it goes out of scope.

Other than that, the rest of the code looks very good & polished.
Another job well done. :-)


Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>

More information about the LibreOffice mailing list