summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx18
-rw-r--r--tools/source/inet/inetmime.cxx12
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)