summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-04-26 07:55:38 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-04-26 10:41:42 +0200
commit4049fe21481fe0bbce52f3fd9f09952d1e112e2d (patch)
tree5625eecd27d8af690f21668e617d09efe5c06c76 /stoc
parent82e789bfc8c215a7b27d4ca8d6567590717168da (diff)
Two more uses of rtl::createUriCharClass
...that 6a9f342addf8b1c766163575c7b63e7fcc1f714e "Introduce rtl::createUriCharClass" had missed Change-Id: Id37399cb88df25aff22d42e889aea12c1ca90797 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133423 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx21
1 files changed, 3 insertions, 18 deletions
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index ac37da853a83..a8203a811ce0 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -129,25 +129,10 @@ OUString parsePart(
}
OUString encodeNameOrParamFragment(OUString const & fragment) {
- static sal_Bool const nameOrParamFragment[] = {
- false, false, false, false, false, false, false, false,
- false, false, false, false, false, false, false, false,
- false, false, false, false, false, false, false, false,
- false, false, false, false, false, false, false, false,
- false, true, false, false, true, false, false, true, // !"#$%&'
- true, true, true, true, true, true, true, false, // ()*+,-./
- true, true, true, true, true, true, true, true, // 01234567
- true, true, true, true, false, false, false, false, // 89:;<=>?
- true, true, true, true, true, true, true, true, // @ABCDEFG
- true, true, true, true, true, true, true, true, // HIJKLMNO
- true, true, true, true, true, true, true, true, // PQRSTUVW
- true, true, true, true, false, true, false, true, // XYZ[\]^_
- false, true, true, true, true, true, true, true, // `abcdefg
- true, true, true, true, true, true, true, true, // hijklmno
- true, true, true, true, true, true, true, true, // pqrstuvw
- true, true, true, false, false, false, true, false}; // xyz{|}~
+ static constexpr auto nameOrParamFragment = rtl::createUriCharClass(
+ u8"!$'()*+,-.0123456789:;@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz~");
return rtl::Uri::encode(
- fragment, nameOrParamFragment, rtl_UriEncodeIgnoreEscapes,
+ fragment, nameOrParamFragment.data(), rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8);
}