diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-23 13:29:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-04 08:06:10 +0200 |
commit | 0e6a2601b39cbadaff7f7506ba9e804f108060db (patch) | |
tree | ffd6bb4970f689d20087b721eb8dfd4bc86cd53f /comphelper | |
parent | 457b349edbaf6d9dc747f3a631fee70e0c035bae (diff) |
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.
Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'comphelper')
4 files changed, 4 insertions, 6 deletions
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx index a724fdfe185e..224a81ac6774 100644 --- a/comphelper/source/misc/accessibletexthelper.cxx +++ b/comphelper/source/misc/accessibletexthelper.cxx @@ -241,7 +241,7 @@ namespace comphelper if ( !implIsValidIndex( nIndex, sText.getLength() ) ) throw IndexOutOfBoundsException(); - return sText.getStr()[nIndex]; + return sText[nIndex]; } // ----------------------------------------------------------------------------- diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 1cf977547d66..6f177e68bf2a 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -222,7 +222,7 @@ sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16( for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- ) { nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); - nResult ^= aString.getStr()[nInd]; + nResult ^= aString[nInd]; } nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 1b371487ad31..a4f36e8db0b0 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -490,7 +490,7 @@ sal_Bool OStorageHelper::PathHasSegment( const OUString& aPath, const OUString& if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) ) { - if ( nPathLen == nSegLen || aPath.getStr()[nSegLen] == (sal_Unicode)'/' ) + if ( nPathLen == nSegLen || aPath[nSegLen] == '/' ) bResult = sal_True; } diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index e5962c7c3973..d4867693fd13 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -67,9 +67,7 @@ static bool makeCanonicalFileURL( OUString & rURL ) if ( !aNormalizedURL.isEmpty() ) { - if ( aNormalizedURL - .getStr()[ aNormalizedURL.getLength() - 1 ] - != sal_Unicode( '/' ) ) + if ( !aNormalizedURL.endsWith("/") ) rURL = aNormalizedURL; else rURL = aNormalizedURL |