diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 14:27:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-15 14:33:57 +0200 |
commit | f13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch) | |
tree | f9aaab122974d36c134fb1723ec3c1c8df51eeef /dbaccess | |
parent | 9270f74466d0eb841babaa24997f608631c70341 (diff) |
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations
Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/viewcontainer.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/filter/hsqldb/parseschema.cxx | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index ea3b8bef81d6..32fd35a7b704 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -136,11 +136,7 @@ ObjectType OViewContainer::appendObject( const OUString& _rForName, const Refere OUString sCommand; descriptor->getPropertyValue(PROPERTY_COMMAND) >>= sCommand; - OUStringBuffer aSQL; - aSQL.append( "CREATE VIEW " ); - aSQL.append ( sComposedName ); - aSQL.append( " AS " ); - aSQL.append ( sCommand ); + OUString aSQL = "CREATE VIEW " + sComposedName + " AS " + sCommand; Reference<XConnection> xCon = m_xConnection; OSL_ENSURE(xCon.is(),"Connection is null!"); @@ -148,7 +144,7 @@ ObjectType OViewContainer::appendObject( const OUString& _rForName, const Refere { ::utl::SharedUNOComponent< XStatement > xStmt( xCon->createStatement() ); if ( xStmt.is() ) - xStmt->execute( aSQL.makeStringAndClear() ); + xStmt->execute( aSQL ); } } diff --git a/dbaccess/source/filter/hsqldb/parseschema.cxx b/dbaccess/source/filter/hsqldb/parseschema.cxx index 60e7103cdfa2..d2215e96eb31 100644 --- a/dbaccess/source/filter/hsqldb/parseschema.cxx +++ b/dbaccess/source/filter/hsqldb/parseschema.cxx @@ -91,11 +91,7 @@ public: OUString lcl_createAlterForeign(const OUString& sForeignPart, const OUString& sTableName) { - OUStringBuffer sBuff("ALTER TABLE "); - sBuff.append(sTableName); - sBuff.append(" ADD "); - sBuff.append(sForeignPart); - return sBuff.makeStringAndClear(); + return "ALTER TABLE " + sTableName + " ADD " + sForeignPart; } } // anonymous namespace |