[PATCH] cleaning before = assignment lotuswordpro/source/filter/xfilter/xfparastyle.cxx

David Tardon dtardon at redhat.com
Mon Jul 16 22:23:19 PDT 2012


Hi,

On Mon, Jul 16, 2012 at 01:57:43PM -0700, julien2412 wrote:
> Thank you David for your answer.
> 
> I updated the way to check self assignment and add the cleaning of members
> (see
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=00ae1cec08ae970f0640c0cc5d612eb0b9035207)

Heh, it already did self assignment check, just with early return... You
do not have to take my suggestions literally :-)

> About the swap part, if you've got an example, I'd be interested.

Okay, you can look at
http://code.google.com/p/multidimalgorithm/source/detail?spec=svn0016d50d9cf6c6437598d196f59b2aa52110c8f9&r=bb3ea2226e49540027df50072aef4c86188f7d64#

Here is a detailed explanation (the example uses friend swap function
instead of member function, but that is just a detail):
http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom/3279550#3279550

D.


More information about the LibreOffice mailing list