diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-21 15:15:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-21 15:15:56 +0100 |
commit | 5c99f2c8524625491ba1b4d736bdd457d258eea3 (patch) | |
tree | f06430a6bf8421d43eccaf9204c0a1811d77d570 /tools/source/fsys | |
parent | dceb440f6fde4cf93e4059ddd183d1293ff5fee3 (diff) |
Move INetMIME::getHexDigit(int to its only place of use
Change-Id: I8d02a51a0da5aad4cd95e15fe6bb329b43e32067
Diffstat (limited to 'tools/source/fsys')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 455ece0e057f..45af3393afe3 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -36,6 +36,7 @@ #include <sal/types.h> #include <algorithm> +#include <cassert> #include <limits> #include <memory> @@ -406,13 +407,26 @@ inline INetURLObject::SchemeInfo const & INetURLObject::getSchemeInfo() const return getSchemeInfo(m_eScheme); } +namespace { + +sal_Unicode getHexDigit(sal_uInt32 nWeight) +{ + assert(nWeight < 16); + static const sal_Unicode aDigits[16] + = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', + 'D', 'E', 'F' }; + return aDigits[nWeight]; +} + +} + // static inline void INetURLObject::appendEscape(OUStringBuffer & rTheText, sal_uInt32 nOctet) { rTheText.append( '%' ); - rTheText.append( (sal_Unicode)INetMIME::getHexDigit(int(nOctet >> 4)) ); - rTheText.append( (sal_Unicode)INetMIME::getHexDigit(int(nOctet & 15)) ); + rTheText.append( getHexDigit(nOctet >> 4) ); + rTheText.append( getHexDigit(nOctet & 15) ); } namespace { |