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


On 11/17/2014 10:39 PM, Michael Stahl wrote:
On 16.11.2014 19:57, Matteo Casalin wrote:
Hi all,
      I was converting all sw call-places to Any::setValue that pass
sal_Bool to use bool instead. I wonder if this is a good choice or not,
is there any guideline?

it looks like the Any has specific support for C++ bool so it should
work fine.

I confirm that the code compiles fine (on Linux x86_64), so I'll proceed with these changes.


Also some of these call places look like:

      sal_Bool bTrue = sal_True;
      uno::Any aVal(&bTrue, ::getBooleanCppuType());
      some_function_call( aVal );

or

      uno::Any aAny;
      sal_Bool bFalse = sal_False;
      aTmp.setValue(&bFalse, ::getBooleanCppuType()  );
      some_function_call( aTmp );

could these be changed to use makeAny(bool)? Does this hold also if the
same Any object is used multiple times (each time calling setValue on it)?

it's much better to use a type-safe method like makeAny() or operator<<=
and not the Any::setValue()/getValue() methods that operate on unsafe void*.


Thank you Michael for the hints.
I will work on a patch that does both bool and makeAny (or <<=) and submit it to gerrit for a final review.

Matteo

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice



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.