diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-12-29 11:18:05 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-12-29 11:44:19 +0100 |
commit | 07e15b1ff368e4168e72e61bb924a6760b81d89f (patch) | |
tree | 93dba3d5706f6af8fbd02b013ca051169692a838 /l10ntools | |
parent | Revert "String Cleanup and news OUString methods/constructors" (diff) | |
download | core-07e15b1ff368e4168e72e61bb924a6760b81d89f.tar.gz core-07e15b1ff368e4168e72e61bb924a6760b81d89f.zip |
po.cxx: use static and const to increase efficiency
Change-Id: I146808171df2240aaa7901978f94cb260a3def6e
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/po.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 06530a31576d..23506adb2265 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -265,7 +265,8 @@ namespace aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength()); sal_uInt32 nCRC = aCRC32.checksum(); //Use all readable ASCII character exclude xml special tags: ",',&,<,> - const OString sSymbols = "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + static const OString sSymbols = + "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; char sKeyId[5]; for( short nKeyInd = 0; nKeyInd < 4; ++nKeyInd ) { @@ -312,12 +313,14 @@ namespace { UErrorCode nIcuErr = U_ZERO_ERROR; - sal_uInt32 nSearchFlags = UREGEX_DOTALL | UREGEX_CASE_INSENSITIVE; + static const sal_uInt32 nSearchFlags = + UREGEX_DOTALL | UREGEX_CASE_INSENSITIVE; OUString sLocaleText( OStringToOUString(rText,RTL_TEXTENCODING_UTF8) ); - OUString sPattern("<[/]\?\?[a-z_-]+?(?:| +[a-z]+?=\".*?\") *[/]\?\?>"); - UnicodeString sSearchPat( - reinterpret_cast<const UChar*>( - sPattern.getStr()), sPattern.getLength() ); + static const OUString sPattern( + "<[/]\?\?[a-z_-]+?(?:| +[a-z]+?=\".*?\") *[/]\?\?>"); + static const UnicodeString sSearchPat( + reinterpret_cast<const UChar*>(sPattern.getStr()), + sPattern.getLength() ); UnicodeString sSource( reinterpret_cast<const UChar*>( sLocaleText.getStr()), sLocaleText.getLength() ); @@ -344,11 +347,11 @@ namespace static OString lcl_EscapeTags( const OString& rText ) { typedef std::vector<OString> StrVec_t; - const OString vInitializer[] = { + static const OString vInitializer[] = { "ahelp", "link", "item", "emph", "defaultinline", "switchinline", "caseinline", "variable", "bookmark_value", "image", "embedvar", "alt" }; - const StrVec_t vTagsForEscape( vInitializer, + static const StrVec_t vTagsForEscape( vInitializer, vInitializer + sizeof(vInitializer) / sizeof(vInitializer[0]) ); StrVec_t vFoundTags; lcl_FindAllTag(rText,vFoundTags); |