diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-12-09 21:09:59 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-12-29 00:23:00 +0100 |
commit | 08004507b53c99f9c67c95e33162adda5b19a6a6 (patch) | |
tree | f806a13ca70fa3fd8bced6450d704239ee1b580a /connectivity/source/commontools | |
parent | 3bfe10125888bcbd9f35daa4724b6fe913f4414b (diff) |
Further reduction of OUString copy operations
Change-Id: I79339e7cf8fa6b6a6f19ba598fc66d9e0df558ae
Reviewed-on: https://gerrit.libreoffice.org/65669
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/AutoRetrievingBase.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx index c99e6b5e82b1..d1170fdd972b 100644 --- a/connectivity/source/commontools/AutoRetrievingBase.cxx +++ b/connectivity/source/commontools/AutoRetrievingBase.cxx @@ -27,25 +27,24 @@ namespace connectivity { OSL_ENSURE( m_bAutoRetrievingEnabled,"Illegal call here. isAutoRetrievingEnabled is false!"); OUString sStmt = _sInsertStatement.toAsciiUpperCase(); - OUString sStatement; if ( sStmt.startsWith("INSERT") ) { - sStatement = m_sGeneratedValueStatement; static const char sTable[] = "$table"; - const sal_Int32 nColumnIndex {sStatement.indexOf("$column")}; + const sal_Int32 nColumnIndex {m_sGeneratedValueStatement.indexOf("$column")}; if ( nColumnIndex>=0 ) { // we need a column } - const sal_Int32 nTableIndex {sStatement.indexOf(sTable)}; + const sal_Int32 nTableIndex {m_sGeneratedValueStatement.indexOf(sTable)}; if ( nTableIndex>=0 ) { // we need a table name sal_Int32 nIntoIndex = sStmt.indexOf("INTO ") + 5; while (nIntoIndex<sStmt.getLength() && sStmt[nIntoIndex]==' ') ++nIntoIndex; const OUString sTableName = sStmt.getToken(0, ' ', nIntoIndex); - sStatement = sStatement.replaceAt(nTableIndex, strlen(sTable), sTableName); + return m_sGeneratedValueStatement.replaceAt(nTableIndex, strlen(sTable), sTableName); } + return m_sGeneratedValueStatement; } - return sStatement; + return OUString(); } } |