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


On 20/09/12 18:54, Michael Stahl wrote:
On 20/09/12 19:23, julien2412 wrote:
Hello,

WAE is enabled in my autogen.lastrun for master sources. I just updated and
had this during compilation:
/home/julien/compile-libreoffice/libo/sc/source/core/tool/rangenam.cxx: In
member function ‘void ScRangeData::SetCode(ScTokenArray&)’:
/home/julien/compile-libreoffice/libo/sc/source/core/tool/rangenam.cxx:642:50:
error: ‘auto_ptr’ is deprecated (declared at
/usr/include/c++/4.7/backward/auto_ptr.h:87)
[-Werror=deprecated-declarations]
cc1plus: all warnings being treated as errors
I have werror enabled, it didn't complain for me ( presumably my gcc is too old )

Here are the lines:
     640 void ScRangeData::SetCode( ScTokenArray& rArr )
     641 {
     642     ::std::auto_ptr<ScTokenArray> pOldCode( pCode);     // old pCode
will be deleted
     643     pCode = new ScTokenArray( rArr );
     644     InitCode();
     645 }


Could it be replaced by a non deprecated function (I don't know between
std::shared_ptr, std::unique_ptr or boost functions)?
usually can be replaced with boost::scoped_ptr.

but in this case i wonder, what purpose does pOldCode serve?
why isn't pCode some kind of smart pointer?

no idea, I would have just deleted pCode in in the first line but there is liberal use of the following pattern

    SAL_WNODEPRECATED_DECLARATIONS_PUSH
    ::std::auto_ptr<ScTokenArray> pOldCode( pCode);
    SAL_WNODEPRECATED_DECLARATIONS_POP

in that file which made me think perhaps there is some reason to keep the old object while replacing it, for some reason I didn't notice the pragma macro foo.

Noel

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.