diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-03-09 21:47:17 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-03-09 21:47:31 +0100 |
commit | 6dddefc6e7ff6dc5cde46dde069ba1d7db4ac34b (patch) | |
tree | 7dafa2c2f9ac052a8b371f70c267c5c847dd2c5a /dbaccess | |
parent | d9a3752143027bbf0d9383074fd378631309a3b0 (diff) |
fdo#43460: use isEmpty()
Change-Id: Ia768e684d3cf255239c04d024b35488830cc9fe6
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/CacheSet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/api/OptimisticSet.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adodatalinks.cxx | 2 |
9 files changed, 29 insertions, 29 deletions
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 734989b63440..1efe897dce16 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -296,7 +296,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR ::std::list< sal_Int32> aOrgValues; fillParameters(_rInsertRow,_xTable,aCondition,aSql,aOrgValues); aSql[aSql.getLength() - 1] = ' '; - if ( aCondition.getLength() ) + if ( !aCondition.isEmpty() ) { aCondition.setLength(aCondition.getLength()-5); diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 4df02302607a..f1538b9f9e0f 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -634,18 +634,18 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow else ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_VALUE_CHANGED ), SQL_GENERAL_ERROR, m_xConnection ); - if(sKeyCondition.getLength() || sIndexCondition.getLength()) + if(!sKeyCondition.isEmpty() || !sIndexCondition.isEmpty()) { aSql.append(" WHERE "); - if(sKeyCondition.getLength() && sIndexCondition.getLength()) + if(!sKeyCondition.isEmpty() && !sIndexCondition.isEmpty()) { aSql.append(sKeyCondition.makeStringAndClear() + sIndexCondition.makeStringAndClear()); } - else if(sKeyCondition.getLength()) + else if(!sKeyCondition.isEmpty()) { aSql.append(sKeyCondition.makeStringAndClear()); } - else if(sIndexCondition.getLength()) + else if(!sIndexCondition.isEmpty()) { aSql.append(sIndexCondition.makeStringAndClear()); } diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index cbfcb6280b43..816b9d88d24f 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -72,7 +72,7 @@ namespace void lcl_fillKeyCondition(const ::rtl::OUString& i_sTableName,const ::rtl::OUString& i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions) { ::rtl::OUStringBuffer& rKeyCondition = io_aKeyConditions[i_sTableName]; - if ( rKeyCondition.getLength() ) + if ( !rKeyCondition.isEmpty() ) rKeyCondition.append(" AND "); rKeyCondition.append(i_sQuotedColumnName); if ( i_aValue.isNull() ) @@ -216,7 +216,7 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow (_rInsertRow->get())[aJoinIter->second] = (_rInsertRow->get())[aIter->second.nPosition]; } ::rtl::OUStringBuffer& rPart = aSql[aIter->second.sTableName]; - if ( rPart.getLength() ) + if ( !rPart.isEmpty() ) rPart.append(", "); rPart.append(sQuotedColumnName + s_sPara); } @@ -245,7 +245,7 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow ::rtl::OUStringBuffer sSql(s_sUPDATE + ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ) + s_sSET + aSqlIter->second.toString()); ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first]; - if ( rCondition.getLength() ) + if ( !rCondition.isEmpty() ) sSql.append(" WHERE " + rCondition.toString() ); executeUpdate(_rInsertRow ,_rOrginalRow,sSql.makeStringAndClear(),aSqlIter->first); @@ -284,11 +284,11 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn (_rInsertRow->get())[aJoinIter->second] = (_rInsertRow->get())[aIter->second.nPosition]; } ::rtl::OUStringBuffer& rPart = aSql[aIter->second.sTableName]; - if ( rPart.getLength() ) + if ( !rPart.isEmpty() ) rPart.append(", "); rPart.append(sQuotedColumnName); ::rtl::OUStringBuffer& rParam = aParameter[aIter->second.sTableName]; - if ( rParam.getLength() ) + if ( !rParam.isEmpty() ) rParam.append(", "); rParam.append("?"); } @@ -313,7 +313,7 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn s_sVALUES + aParameter[aSqlIter->first].toString() + " )"); ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first]; - if ( rCondition.getLength() ) + if ( !rCondition.isEmpty() ) { ::rtl::OUString sQuery("SELECT " + aSqlIter->second.toString() + " FROM " + sComposedTableName + " WHERE " + rCondition.toString()); @@ -376,7 +376,7 @@ void SAL_CALL OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const conne for(;aSqlIter != aSqlEnd ; ++aSqlIter) { ::rtl::OUStringBuffer& rCondition = aSqlIter->second; - if ( rCondition.getLength() ) + if ( !rCondition.isEmpty() ) { ::rtl::OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(xMetaData,aSqlIter->first,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); @@ -621,7 +621,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const lcl_fillKeyCondition(aColIter->second.sTableName,sQuotedColumnName,io_aRow[aColIter->second.nPosition],aKeyConditions); } ::rtl::OUStringBuffer& rPart = aSql[aColIter->second.sTableName]; - if ( rPart.getLength() ) + if ( !rPart.isEmpty() ) rPart.append(", "); rPart.append(sQuotedColumnName); } @@ -633,7 +633,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const if ( aSqlIter->second.getLength() ) { ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first]; - if ( rCondition.getLength() ) + if ( !rCondition.isEmpty() ) { ::rtl::OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(xMetaData,aSqlIter->first,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 42cc6409bc91..866e9073ebf4 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -669,7 +669,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString Sequence< PropertyValue > aUserPwd(nAdditionalArgs); sal_Int32 nArgPos = 0; - if (sUser.getLength()) + if (!sUser.isEmpty()) { aUserPwd[ nArgPos ].Name = "user"; aUserPwd[ nArgPos ].Value <<= sUser; diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index ef62c6ad5165..0880194a6c62 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -924,12 +924,12 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber ); - if ( !sDatabaseName.getLength() ) + if ( sDatabaseName.isEmpty() ) sDatabaseName = m_aTypeCollection.cutPrefix( sURL ); if ( m_aTypeCollection.isFileSystemBased(sURL) ) { sDatabaseName = SvtPathOptions().SubstituteVariable( sDatabaseName ); - if ( sDatabaseName.getLength() ) + if ( !sDatabaseName.isEmpty() ) { ::svt::OFileNotation aFileNotation(sDatabaseName); // set this decoded URL as text @@ -937,7 +937,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const } } - if ( sDatabaseName.getLength() == 0 ) + if ( sDatabaseName.isEmpty() ) sDatabaseName = m_aTypeCollection.getTypeDisplayName( sURL ); aReturn.sTitle = sDatabaseName; @@ -1729,7 +1729,7 @@ sal_Bool OApplicationController::onContainerSelect(ElementType _eType) xLayoutManager->lock(); xLayoutManager->destroyElement( sDestroyToolbar ); - if ( sToolbar.getLength() ) + if ( !sToolbar.isEmpty() ) { xLayoutManager->createElement( sToolbar ); xLayoutManager->requestElement( sToolbar ); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 2437f74a6c75..8b982d92ef4a 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -240,7 +240,7 @@ namespace dbaui if ( !pJdbcDrvItem->GetValue().getLength() ) { OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); - if ( sDefaultJdbcDriverName.getLength() ) + if ( !sDefaultJdbcDriverName.isEmpty() ) { m_aJavaDriver.SetText(sDefaultJdbcDriverName); m_aJavaDriver.SetModifyFlag(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 60fa166809eb..06584cfff7de 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -638,7 +638,7 @@ DBG_NAME(OMySQLIntroPageSetup) if ( !pDrvItem->GetValue().getLength() ) { OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); - if ( sDefaultJdbcDriverName.getLength() ) + if ( !sDefaultJdbcDriverName.isEmpty() ) { m_aETDriverClass.SetText(sDefaultJdbcDriverName); m_aETDriverClass.SetModifyFlag(); diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index e1896c37e33e..405ec96bee38 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -258,7 +258,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert OUString sLoginRequest(ModuleRes(STR_ENTER_CONNECTION_PASSWORD)); OUString sTemp = sName; sName = ::dbaui::getStrippedDatabaseName(NULL,sTemp); - if ( sName.getLength() ) + if ( !sName.isEmpty() ) sLoginRequest = sLoginRequest.replaceAll("$name$", sName); else { @@ -313,7 +313,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert m_pItemSetHelper->getWriteOutputSet()->Put(SfxStringItem(DSID_PASSWORD, sPassword)); } - if (sPassword.getLength()) + if (!sPassword.isEmpty()) aReturn.push_back( PropertyValue( OUString("password"), 0, makeAny(OUString(sPassword)), PropertyState_DIRECT_VALUE)); @@ -514,7 +514,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const // Huh? Anybody there? // OJ: It is needed when the connection properties are changed. There the URL is used for every type. - if ( sDatabaseName.getLength() ) + if ( !sDatabaseName.isEmpty() ) { sNewUrl += OUString::createFromAscii("/") + sDatabaseName; } @@ -529,9 +529,9 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const { sNewUrl = "@" + lcl_createHostWithPort(pHostName,pPortNumber); OUString sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : OUString(); - if ( !sDatabaseName.getLength() && pUrlItem ) + if ( sDatabaseName.isEmpty() && pUrlItem ) sDatabaseName = pCollection->cutPrefix( pUrlItem->GetValue() ); - if ( sDatabaseName.getLength() ) + if ( !sDatabaseName.isEmpty() ) { sNewUrl += OUString::createFromAscii(":") + sDatabaseName; } @@ -1080,7 +1080,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) break; } - if ( sUrlPart.getLength() ) + if ( !sUrlPart.isEmpty() ) { if ( eTy == ::dbaccess::DST_MYSQL_NATIVE ) { @@ -1094,7 +1094,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) } } - if ( sNewHostName.getLength() ) + if ( !sNewHostName.isEmpty() ) _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName)); if ( nPortNumber != -1 && nPortNumberId != 0 ) diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx index f56b2cdbb201..dcbd89c38dc7 100644 --- a/dbaccess/source/ui/dlg/adodatalinks.cxx +++ b/dbaccess/source/ui/dlg/adodatalinks.cxx @@ -51,7 +51,7 @@ BSTR PromptNew(long hWnd); ::rtl::OUString getAdoDatalink(long hWnd,::rtl::OUString& oldLink) { ::rtl::OUString dataLink; - if (oldLink.getLength()) + if (!oldLink.isEmpty()) { dataLink=reinterpret_cast<sal_Unicode *>(PromptEdit(hWnd,(BSTR)oldLink.getStr())); } |