Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 14/05/12 15:15, Noel Grandin wrote:
Hi

These patches are more work in the SW module to convert SV_DECL_PTRARR 
to std::vector or boost::ptr_vector

thanks again, pushed to master.

These patches were compiled with debug=true, so I'm pretty sure I 
converted all of the debug stuff as well.

much better, though there was still a DBGUTIL-only place left...

And it passes "make check" at the global level.

i wondered about the copy constructor that you removed in patch #1,
which was pretty horrible (i mean the copy ctor, not your removal), and
worried that it may be automatically generated, but apparently it is
not, i get a compiler error when trying to invoke it.

also i tried to derive the class from boost::noncopyable, but ran into
surprising problems, namely that its base class SwClient is already
derived from boost::noncopyable, so GCC said:

direct base ‘boost::noncopyable_::noncopyable’ inaccessible in
‘SwAuthorityFieldType’ due to ambiguity

it is very surprising that it was possible to write a copy constructor
for this class before, investigation revealed that it did not invoke the
SwClient copy constructor, but another SwClient constructor (indirectly)...

more seriously is this in patch #5. tautofmt.cxx:

                    SwTableAutoFmt* p = &(*pTableTbl)[ nIndex ];
                    pTableTbl->erase( pTableTbl->begin() + nIndex );

                    p->SetName( aFormatName );

the boost::ptr_vector::erase deletes the element, so p is invalid.  have
tried to fix this with the boost::ptr_vector::transfer method.

also, patch #6 introduced a memory leak, because the SwTableLines member
needs to be explicitly cleaned up in the destructor now it is a std::vector.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.