[Libreoffice] [Patch] RTL_CONSTASCII_USTRINGPARAM for calc\sc\source\core\data

Kohei Yoshida kyoshida at novell.com
Sat Nov 6 09:20:28 PDT 2010


Hello Julien,

On Sat, 2010-11-06 at 01:03 +0100, julien wrote:
> Hello,
> 
> Here is a patch for calc\sc\source\core\data (i think there's no more in it)

Sorry, I can't apply this one since this breaks code pretty much all
places.

RTL_CONSTASCII_USTRINGPARAM is not a replacement for rtl::OUString
constructor; rather, you need to feed it to rtl::OUString() to
instantiate the string.

So, instead of 

  RTL_CONSTASCII_USTRINGPARAM("Text")

you need to

  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text"))

Note that when instantiating a local string instance, you can do it like
this

  rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("Text"));

since that implicitly calls OUString's constructor with the RTL_... as
its argument.  But most other cases require explicit call to the
constructor.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>



More information about the LibreOffice mailing list