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 | |
parent | dceb440f6fde4cf93e4059ddd183d1293ff5fee3 (diff) |
Move INetMIME::getHexDigit(int to its only place of use
Change-Id: I8d02a51a0da5aad4cd95e15fe6bb329b43e32067
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 18 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 12 |
2 files changed, 16 insertions, 14 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 { diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 8fc5a4515a73..ad15355f19de 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1145,18 +1145,6 @@ bool INetMIME::isIMAPAtomChar(sal_uInt32 nChar) } // static -sal_uInt32 INetMIME::getHexDigit(int nWeight) -{ - DBG_ASSERT(nWeight >= 0 && nWeight < 16, - "INetMIME::getHexDigit(): Bad weight"); - - static const sal_Char aDigits[16] - = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', - 'D', 'E', 'F' }; - return aDigits[nWeight]; -} - -// static bool INetMIME::equalIgnoreCase(const sal_Unicode * pBegin1, const sal_Unicode * pEnd1, const sal_Char * pString2) |