summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-07 22:57:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-08 10:14:21 +0100
commitd7a2e94e653f1b164eeeffd32f328b7eb69a0c77 (patch)
tree97579989ac6d597a63e577863eede250f94a02c8 /l10ntools
parent3c5c11bf631b92ebe46b4f061e8673d8de98e40a (diff)
Use OUStringLiteral
Change-Id: I720f70f81db92d75cdd83aa20a1cbf5a311b092b
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/localize.cxx42
1 files changed, 15 insertions, 27 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index e9130afa5764..1edf0a0aa2f2 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -45,16 +45,11 @@ using namespace std;
namespace {
-struct AsciiString {
- char const * string;
- sal_Int32 length;
-};
-
bool matchList(
- const OUString& rUrl, const AsciiString* pList, size_t nLength)
+ const OUString& rUrl, const OUStringLiteral* pList, size_t nLength)
{
for (size_t i = 0; i != nLength; ++i) {
- if (rUrl.endsWithAsciiL(pList[i].string, pList[i].length)) {
+ if (rUrl.endsWith(pList[i])) {
return true;
}
}
@@ -62,31 +57,24 @@ bool matchList(
}
bool passesNegativeList(const OUString& rUrl) {
- static const AsciiString list[] = {
- { RTL_CONSTASCII_STRINGPARAM("/dictionaries.xcu") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/dictionaries/da_DK/help/da/help.tree") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/dictionaries/da_DK/help/da/"
- "org.openoffice.da.hunspell.dictionaries/page1.xhp") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/dictionaries/da_DK/help/da/"
- "org.openoffice.da.hunspell.dictionaries/page2.xhp") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/dictionaries/hu_HU/help/hu/help.tree") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/dictionaries/hu_HU/help/hu/"
- "org.openoffice.hu.hunspell.dictionaries/page1.xhp") },
- { RTL_CONSTASCII_STRINGPARAM(
- "/officecfg/registry/data/org/openoffice/Office/"
- "Accelerators.xcu") }
+ static const OUStringLiteral list[] = {
+ "/dictionaries.xcu",
+ "/dictionaries/da_DK/help/da/help.tree",
+ ("/dictionaries/da_DK/help/da/"
+ "org.openoffice.da.hunspell.dictionaries/page1.xhp"),
+ ("/dictionaries/da_DK/help/da/"
+ "org.openoffice.da.hunspell.dictionaries/page2.xhp"),
+ "/dictionaries/hu_HU/help/hu/help.tree",
+ ("/dictionaries/hu_HU/help/hu/"
+ "org.openoffice.hu.hunspell.dictionaries/page1.xhp"),
+ "/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu"
};
return !matchList(rUrl, list, SAL_N_ELEMENTS(list));
}
bool passesPositiveList(const OUString& rUrl) {
- static const AsciiString list[] = {
- { RTL_CONSTASCII_STRINGPARAM("/description.xml") }
+ static const OUStringLiteral list[] = {
+ "/description.xml"
};
return matchList(rUrl, list, SAL_N_ELEMENTS(list));
}