diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-28 11:27:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-28 17:22:39 +0200 |
commit | fa87224130a4ab6c4b79f993cc990adc4be0465b (patch) | |
tree | 89ef6c5fbae775cfc508d96e20d052fa6bad114a /connectivity/source/commontools | |
parent | e1d7b0973d8318bd7f153350e2e8a38bec3b3e7b (diff) |
loplugin:stringloop basctl,chart2,connectivity
Change-Id: I21353dace60705d55b3d70f1e0bc610d55b84d63
Reviewed-on: https://gerrit.libreoffice.org/58210
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/TTableHelper.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools2.cxx | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 6c7cd5f5aafc..92447c8e94db 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -448,12 +448,11 @@ void OTableHelper::refreshIndexes() if(xResult.is()) { Reference< XRow > xRow(xResult,UNO_QUERY); - OUString aName; OUString sCatalogSep = getMetaData()->getCatalogSeparator(); OUString sPreviousRoundName; while( xResult->next() ) { - aName = xRow->getString(5); + OUString aName = xRow->getString(5); if(!aName.isEmpty()) aName += sCatalogSep; aName += xRow->getString(6); diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 5faf1146e67e..cd09553e06df 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -251,20 +251,20 @@ namespace ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); const OUString sQuote(_xMetaData->getIdentifierQuoteString()); - OUString sSql( " (" ); + OUStringBuffer sSql( " (" ); Reference< XPropertySet > xColProp; sal_Int32 nColCount = _xColumns->getCount(); for(sal_Int32 i=0;i<nColCount;++i) { if ( (_xColumns->getByIndex(i) >>= xColProp) && xColProp.is() ) - sSql += ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) - + ","; + sSql.append( ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) ) + .append(","); } if ( nColCount ) - sSql = sSql.replaceAt(sSql.getLength()-1, 1, ")"); - return sSql; + sSql[sSql.getLength()-1] = ')'; + return sSql.makeStringAndClear(); } } |