summaryrefslogtreecommitdiff
path: root/dbaccess
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 /dbaccess
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 'dbaccess')
-rw-r--r--dbaccess/source/core/recovery/dbdocrecovery.cxx6
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index 312a6862fc18..f3de5ebba01b 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -102,7 +102,7 @@ namespace dbaccess
return false;
}
o_rCompDesc.sName = i_rIniLine.copy( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 );
- o_rCompDesc.bForEditing = ( i_rIniLine.getStr()[ nCommaPos + 1 ] == '1' );
+ o_rCompDesc.bForEditing = ( i_rIniLine[ nCommaPos + 1 ] == '1' );
return true;
}
@@ -152,7 +152,7 @@ namespace dbaccess
static bool lcl_isSectionStart( const OUString& i_rIniLine, OUString& o_rSectionName )
{
const sal_Int32 nLen = i_rIniLine.getLength();
- if ( ( nLen > 0 ) && ( i_rIniLine.getStr()[0] == '[' ) && ( i_rIniLine.getStr()[ nLen - 1 ] == ']' ) )
+ if ( i_rIniLine.startsWith("[") && i_rIniLine.endsWith("]") )
{
o_rSectionName = i_rIniLine.copy( 1, nLen -2 );
return true;
@@ -163,7 +163,7 @@ namespace dbaccess
static void lcl_stripTrailingLineFeed( OUString& io_rLine )
{
const sal_Int32 nLen = io_rLine.getLength();
- if ( ( nLen > 0 ) && ( io_rLine.getStr()[ nLen - 1 ] == '\n' ) )
+ if ( io_rLine.endsWith("\n") )
io_rLine = io_rLine.copy( 0, nLen - 1 );
}
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 24f5795d9777..126dbe865552 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -73,7 +73,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
if ( sValue == sFileName )
{
const sal_Int32 nFileNameLength = sFileName.getLength();
- if ( ( nFileNameLength > 0 ) && ( sFileName.getStr()[ nFileNameLength - 1 ] == '/' ) )
+ if ( sFileName.endsWith("/") )
sFileName = sFileName.copy( 0, nFileNameLength - 1 );
sLocation = ::svt::OFileNotation( rImport.GetAbsoluteReference( sFileName ) ).get( ::svt::OFileNotation::N_SYSTEM );