summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-23 13:29:32 +0200
committerNoel Grandin <noel@peralex.com>2013-11-04 08:06:10 +0200
commit0e6a2601b39cbadaff7f7506ba9e804f108060db (patch)
treeffd6bb4970f689d20087b721eb8dfd4bc86cd53f /vcl
parent457b349edbaf6d9dc747f3a631fee70e0c035bae (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 'vcl')
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx3
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx2
3 files changed, 3 insertions, 4 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 636528a6eff6..945899763f21 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -451,8 +451,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( MultiAtomProvider* pProvider,
{
int nLen = aFamily.getLength();
if( nLen > 2 &&
- aFamily.getStr()[ nLen-2 ] == 'G' &&
- aFamily.getStr()[ nLen-1 ] == 'B' &&
+ aFamily.endsWith("GB") &&
pInfo->numOfChars > 255 )
{
m_aEncoding = RTL_TEXTENCODING_GBK;
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 97d92bad15db..7089abccd057 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1303,7 +1303,7 @@ void PDFWriterImpl::padPassword( const OUString& i_rPassword, sal_uInt8* o_pPadd
sal_Int32 nCurrentChar;
for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
- o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
+ o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString[nCurrentChar] );
//pad it with standard byte string
sal_Int32 i,y;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 2d1636b026e1..0ec20554b178 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -141,7 +141,7 @@ namespace psp
OString aStr( pEnvLocale );
sal_Int32 nLen = aStr.getLength();
aLoc.Language = OStringToOUString( aStr.copy( 0, nLen > 2 ? 2 : nLen ), RTL_TEXTENCODING_MS_1252 );
- if( nLen >=5 && aStr.getStr()[2] == '_' )
+ if( nLen >=5 && aStr[2] == '_' )
aLoc.Country = OStringToOUString( aStr.copy( 3, 2 ), RTL_TEXTENCODING_MS_1252 );
else
aLoc.Country = OUString();