[PATCH] automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted ...

Thomas Arnhold thomas-libo at arnhold.org
Tue Mar 19 03:29:26 PDT 2013


Hi Oliver,

right. But I wanted to remove the macro only.

There were 1663 cases like foo = [::rtl::]OUString("..") in the source 
before my commit. Now there are 2885. Huge increase, I know, but the 
other ones could be improved, too. Maybe with some script foo. 
Regardless how this is done it will be easier to review in comparison to 
removing the macro and the explicit OUString at once.

Thomas

On 19.03.2013 10:37, Olivier Hallot wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello
>
> since you have
>
> - -    aMap[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES"));
> - -    aMap[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO"));
> +    aMap[0] = ::rtl::OUString("YES");
> +    aMap[1] = ::rtl::OUString("NO");
>
> in the same way, you can push further
>
> - -    aMap[0] = ::rtl::OUString("YES");
> - -    aMap[1] = ::rtl::OUString("NO");
> +    aMap[0] = "YES";
> +    aMap[1] = "NO";
>
> and AFAIK, explicit OUString is necessary only with return and ? such as
>
> return OUString("bla bla bla");
>
> and
>
> aOUString = bCond ? OUString("String_true") : OUString("String_false");
>
> Olivier
>
>
> Em 19-03-2013 05:26, Thomas Arnhold (via Code Review) escreveu:
>> Hi,
>>
>> I have submitted a patch for review:
>>
>>      https://gerrit.libreoffice.org/2832
>>
>> To pull it, you can do:
>>
>>      git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/32/2832/1
>>
>> automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
>>
>> Done with a perl regex:
>>
>> s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms



More information about the LibreOffice mailing list