diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-05-28 19:41:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-17 11:55:13 +0200 |
commit | 9881bea8d41997fb46579eb5f0314300159c96cc (patch) | |
tree | f52daa7055d2d28959e2d1ad576d963b7c0d3b2d /comphelper | |
parent | ec4034c4a4f23574401ba2a74b635d9ed4befbc8 (diff) |
remove unnecessary use of OUString::getStr
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4
Reviewed-on: https://gerrit.libreoffice.org/38114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/docpasswordhelper.cxx | 5 | ||||
-rw-r--r-- | comphelper/source/misc/string.cxx | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 0ca3c01a55ab..ecf16fa2d3df 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -181,13 +181,12 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32( sal_uInt16 nHighResult = pInitialCode[nLen - 1]; sal_uInt16 nLowResult = 0; - const sal_Unicode* pStr = aUString.getStr(); for ( sal_uInt32 nInd = 0; nInd < nLen; nInd++ ) { // NO Encoding during conversion! // The specification says that the low byte should be used in case it is not NULL - char nHighChar = (char)( pStr[nInd] >> 8 ); - char nLowChar = (char)( pStr[nInd] & 0xFF ); + char nHighChar = (char)( aUString[nInd] >> 8 ); + char nLowChar = (char)( aUString[nInd] & 0xFF ); char nChar = nLowChar ? nLowChar : nHighChar; for ( int nMatrixInd = 0; nMatrixInd < 7; ++nMatrixInd ) diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 2728e0bca12b..be1f49b7236c 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -459,7 +459,6 @@ OUString removeAny(OUString const& rIn, OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok, const OUString& rNewToken) { - const sal_Unicode* pStr = rIn.getStr(); sal_Int32 nLen = rIn.getLength(); sal_Int32 nTok = 0; sal_Int32 nFirstChar = 0; @@ -469,7 +468,7 @@ OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok, while ( i < nLen ) { // Increase token count if match - if (*pStr == cTok) + if (rIn[i] == cTok) { ++nTok; @@ -479,7 +478,6 @@ OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok, break; } - ++pStr; ++i; } |