On 03/19/2013 07:38 PM, Thomas Arnhold wrote:
#!/usr/bin/perl
# git grep 'RTL_CONSTASCII_USTRINGPARAM' -- '*.[hc]xx' | cut -d':' -f1 | sort -u | xargs perl
constascii.pl
foreach (@ARGV) {
my $file = $_;
my $data = "";
my $fh;
open($fh, "<$file");
while (<$fh>) { $data .= $_; }
close($fh);
# replace OUString(RTL_...)
$data =~
s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms;
BTW, did this work by luck, not causing any damage in cases like
OUString(RTL_CONSTASCII_USTRINGPARAM("\")"))
Stephan
# replace OUString sBuff(RTL...)
$data =~
s/(OUString\s+[a-zA-Z_][A-Za-z0-9_]*\s*)\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/$1\($2\)/gms;
# write file
open($fh, ">$file");
print $fh $data;
close($fh);
}
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.