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


On 05/05/2014 09:07 AM, sberg wrote:
On 04/25/2014 11:06 PM, julien2412 [via Document Foundation Mail
Archive] wrote:
 > I've begun to replace some parts and had this when I've changed this:
 > else if ( pType == ::getCppuType((const sal_uInt16*)0) )
 > into this:
 > else if ( pType == cppu::UnoType<const sal_uInt16>::get() )

That's the problem with getCppuType, that sal_uInt16 (representing UNO
UNSIGNED SHORT) and sal_Unicode (representing UNO CHAR) can be typedefs
for one and the same type, so getCppuType arbitrarily has to decide for
one of those.

With cppu::UnoType, instead use cppu::UnoUnsignedShortType and
cppu::UnoCharType as template arguments, respectively.

And for completeness: Use cppu::UnoSequenceType<> instead of css::uno::Sequence<> when the (recursive) element type is one of those special UnoUnsignedShortType/UnoCharType. (Cf. <http://cgit.freedesktop.org/libreoffice/core/commit/?id=127a5f5e12d33203f871ee810e4b7ef557b7764b> "Sequence<UnoUnsignedShortType> -> UnoSequenceType<UnoUnsignedShortType>.")

(And, finally, css::uno::Reference<> is redundant there, so

  cppu::UnoType<XComponentContext>::get()

is shorthand for

  cppu::UnoType<Reference<XComponentContext>>::get()

and probably preferable.)

Stephan

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.