[Libreoffice] [PUSHED] Re: [PATCH 02/12] RTL_CONSTASCII_USTRINGPARAM in components cui options

Kevin Hunter hunteke at earlham.edu
Thu Nov 18 05:36:10 PST 2010


As I assume you're using a regex, you might consider catching this by 
doing the search and replace in series.  Here's an example:

1. Catch the 'OUString +?= ...createFromAscii...' case and replace with 
'OUString var( RTL...)'

search: OUString\s*\w+\s*\+?=\s*\S*createFromAscii\(\s*"([^"]*)"\s*\)
replace: $1 $2( RTL_CONSTASCII_USTRINGPARAM( "$4" ))

2. Then go back for a second pass with something like this:

search: ::createFromAscii\(\s*"([^"]*)"\s*\)
replace: $1 $2( RTL_CONSTASCII_USTRINGPARAM( "$4" ))

The solution isn't perfect, as it still misses certain edge cases, but 
should at least help a little bit.

Cheers,

Kevin

At 3:51pm -0500 Wed, 17 Nov 2010, Pierre-André Jacquod wrote:
> Sharp eyes.. Just to keep you trainded..:-(
> No really sorry, Despite reviewing diff, I did not catch this one.
> Will take more care
>
>
> On 11/17/2010 05:18 PM, Caolán McNamara wrote:
>> On Tue, 2010-11-16 at 22:39 +0100, Pierre-André Jacquod wrote:
>>> On 11/16/2010 10:37 PM, Pierre-André Jacquod wrote:
>>>> Hello,
>>>> being off for some days, here the collection of patches I produced in
>>>> between.
>>
>> Mostly good, but careful here, see...
>>
>> -        aAutoStr += ::rtl::OUString::createFromAscii( " (" );
>> +        aAutoStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(") );
>>
>> you changed the string by accident from a bracket with a preceding space
>> to one with no preceding space, clearly what's between "" has to remain
>> the same :-). Fixed that typo and the rest looks good, pushed.



More information about the LibreOffice mailing list