diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-26 16:17:51 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 23:00:05 -0600 |
commit | 0860d2bca15536e1277a136c8d1390c5fa3bd271 (patch) | |
tree | 3e7291280eeeff664dd4e2fd2e731ca1770c7f97 /svl/source | |
parent | ad6f9f2f00df27eec2fc6e640eb1a662644de6a4 (diff) |
String => OUString conversion of svl's PasswordHelper
Change-Id: I7e107c37c43a8c9d868b579a2c389de558594a77
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/misc/PasswordHelper.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx index 61c949a1cb89..78102e8c3f73 100644 --- a/svl/source/misc/PasswordHelper.cxx +++ b/svl/source/misc/PasswordHelper.cxx @@ -20,7 +20,6 @@ #include <svl/PasswordHelper.hxx> #include <rtl/digest.h> -#include <tools/string.hxx> using namespace com::sun::star; @@ -35,14 +34,14 @@ void SvPasswordHelper::GetHashPassword(uno::Sequence<sal_Int8>& rPassHash, const } } -void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPassHash, const String& sPass) +void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass) { - xub_StrLen nSize(sPass.Len()); + sal_Int32 nSize(sPass.getLength()); sal_Char* pCharBuffer = new sal_Char[nSize * sizeof(sal_Unicode)]; - for (xub_StrLen i = 0; i < nSize; ++i) + for (sal_Int32 i = 0; i < nSize; ++i) { - sal_Unicode ch(sPass.GetChar(i)); + sal_Unicode ch(sPass[ i ]); pCharBuffer[2 * i] = static_cast< sal_Char >(ch & 0xFF); pCharBuffer[2 * i + 1] = static_cast< sal_Char >(ch >> 8); } @@ -52,14 +51,14 @@ void SvPasswordHelper::GetHashPasswordLittleEndian(uno::Sequence<sal_Int8>& rPas delete[] pCharBuffer; } -void SvPasswordHelper::GetHashPasswordBigEndian(uno::Sequence<sal_Int8>& rPassHash, const String& sPass) +void SvPasswordHelper::GetHashPasswordBigEndian(uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass) { - xub_StrLen nSize(sPass.Len()); + sal_Int32 nSize(sPass.getLength()); sal_Char* pCharBuffer = new sal_Char[nSize * sizeof(sal_Unicode)]; - for (xub_StrLen i = 0; i < nSize; ++i) + for (sal_Int32 i = 0; i < nSize; ++i) { - sal_Unicode ch(sPass.GetChar(i)); + sal_Unicode ch(sPass[ i ]); pCharBuffer[2 * i] = static_cast< sal_Char >(ch >> 8); pCharBuffer[2 * i + 1] = static_cast< sal_Char >(ch & 0xFF); } @@ -69,12 +68,12 @@ void SvPasswordHelper::GetHashPasswordBigEndian(uno::Sequence<sal_Int8>& rPassHa delete[] pCharBuffer; } -void SvPasswordHelper::GetHashPassword(uno::Sequence<sal_Int8>& rPassHash, const String& sPass) +void SvPasswordHelper::GetHashPassword(uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass) { GetHashPasswordLittleEndian(rPassHash, sPass); } -bool SvPasswordHelper::CompareHashPassword(const uno::Sequence<sal_Int8>& rOldPassHash, const String& sNewPass) +bool SvPasswordHelper::CompareHashPassword(const uno::Sequence<sal_Int8>& rOldPassHash, const OUString& sNewPass) { bool bResult = false; |