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


On 17/11/11 17:18, Michael Meeks wrote:
Hi Muthu,

On Wed, 2011-11-16 at 17:34 +0530, Muthu Subramanian K wrote:
I have attached a trivial code removal with this mail.
I read the code, (since pUndoSet is set to null in the very constructor,
I guess this if() would never get executed), but, I could have missed
something here - hence the need for review.

      Looks like that was explicitly added in:

commit 493855a92f443535abca8fed0f04ac7c4668a85d
Author: Pascal Junck <pjunck@openoffice.org>
Date:   Wed Nov 3 10:06:38 2004 +0000

    INTEGRATION: CWS aw019 (1.14.140); FILE MERGED
    2004/09/28 15:53:27 aw 1.14.140.1: #i11190#

      Are you certain it is not needed ? then again, an in-line delete rather
than the if(){} etc. might be good.

no idea if it is needed, but how about replacing pUndoSet with a smart
pointer like boost::scoped_ptr?

then the next line would become 'pUndoSet.reset(new ...)', if pUndoSet
is not null it will be deleted automatically, and you can get rid of the
delete in the destructor as well.

Muthu, please take a look at:
http://www.boost.org/doc/libs/1_46_0/libs/smart_ptr/scoped_ptr.htm

regards,
 michael


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.