diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2011-12-14 23:13:36 -0200 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-12-17 16:36:00 +0400 |
commit | 1777c09a0781710c309e500f680e6f95c080ca86 (patch) | |
tree | 30b82b768f01de93895daadc1bec8731b082d98c /connectivity/source/commontools | |
parent | 3744cd818383fd954125a6567856e92198792cf1 (diff) |
Fix for fdo43460 Part IX getLength() to isEmpty()
Part IX
Module
connectivity
Diffstat (limited to 'connectivity/source/commontools')
17 files changed, 63 insertions, 63 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 366962e52979..63a31e1a1f78 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -321,7 +321,7 @@ sal_Bool isValidSQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSp if(!isCharOk(*pStr,_rSpecials)) return sal_False; - if ( rName.getLength() + if ( !rName.isEmpty() && ( (rName.toChar() == '_') || ( (rName.toChar() >= '0') && (rName.toChar() <= '9') @@ -362,7 +362,7 @@ sal_Bool isValidSQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSp ::rtl::OUString quoteName(const ::rtl::OUString& _rQuote, const ::rtl::OUString& _rName) { ::rtl::OUString sName = _rName; - if(_rQuote.getLength() && _rQuote.toChar() != ' ') + if( !_rQuote.isEmpty() && _rQuote.toChar() != ' ') sName = _rQuote + _rName + _rQuote; return sName; } diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx index 91fb718a3382..d9a61f622b86 100644 --- a/connectivity/source/commontools/ConnectionWrapper.cxx +++ b/connectivity/source/commontools/ConnectionWrapper.cxx @@ -214,9 +214,9 @@ void OConnectionWrapper::createUniqueId( const ::rtl::OUString& _rURL // first we create the digest we want to have rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 ); rtl_digest_update(aDigest,_rURL.getStr(),_rURL.getLength()*sizeof(sal_Unicode)); - if ( _rUserName.getLength() ) + if ( !_rUserName.isEmpty() ) rtl_digest_update(aDigest,_rUserName.getStr(),_rUserName.getLength()*sizeof(sal_Unicode)); - if ( _rPassword.getLength() ) + if ( !_rPassword.isEmpty() ) rtl_digest_update(aDigest,_rPassword.getStr(),_rPassword.getLength()*sizeof(sal_Unicode)); // now we need to sort the properties PropertyValue* pBegin = _rInfo.getArray(); @@ -248,7 +248,7 @@ void OConnectionWrapper::createUniqueId( const ::rtl::OUString& _rURL } } } - if ( sValue.getLength() > 0 ) + if ( !sValue.isEmpty() ) { // we don't have to convert this into UTF8 because we don't store on a file system rtl_digest_update(aDigest,sValue.getStr(),sValue.getLength()*sizeof(sal_Unicode)); diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index e4172aa64a72..90b5f07510b7 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -251,7 +251,7 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant, sal_Int16 nFieldType, sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException) { - if (rString.getLength()) + if (!rString.isEmpty()) { // Does the String need to be formatted? sal_Int16 nTypeClass = nKeyType & ~NumberFormat::DEFINED; diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx index cc19bce60abb..29d1de1d0d16 100644 --- a/connectivity/source/commontools/DriversConfig.cxx +++ b/connectivity/source/commontools/DriversConfig.cxx @@ -80,18 +80,18 @@ namespace static const ::rtl::OUString s_sMetaData(RTL_CONSTASCII_USTRINGPARAM("MetaData")); ::rtl::OUString sParentURLPattern; aURLPatternNode.getNodeValue(s_sParentURLPattern) >>= sParentURLPattern; - if ( sParentURLPattern.getLength() ) + if ( !sParentURLPattern.isEmpty() ) lcl_readURLPatternNode(_aInstalled,sParentURLPattern,_rInstalledDriver); ::rtl::OUString sDriverFactory; aURLPatternNode.getNodeValue(s_sDriver) >>= sDriverFactory; - if ( sDriverFactory.getLength() ) + if ( !sDriverFactory.isEmpty() ) _rInstalledDriver.sDriverFactory = sDriverFactory; ::rtl::OUString sDriverTypeDisplayName; aURLPatternNode.getNodeValue(s_sDriverTypeDisplayName) >>= sDriverTypeDisplayName; - OSL_ENSURE(sDriverTypeDisplayName.getLength(),"No valid DriverTypeDisplayName property!"); - if ( sDriverTypeDisplayName.getLength() ) + OSL_ENSURE(!sDriverTypeDisplayName.isEmpty(),"No valid DriverTypeDisplayName property!"); + if ( !sDriverTypeDisplayName.isEmpty() ) _rInstalledDriver.sDriverTypeDisplayName = sDriverTypeDisplayName; lcl_fillValues(aURLPatternNode,s_sProperties,_rInstalledDriver.aProperties); @@ -124,7 +124,7 @@ void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& { TInstalledDriver aInstalledDriver; lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver); - if ( aInstalledDriver.sDriverFactory.getLength() ) + if ( !aInstalledDriver.sDriverFactory.isEmpty() ) m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver)); } } // if ( m_aInstalled.isValid() ) diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 26904c56b714..246cad29e434 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -89,7 +89,7 @@ sdbcx::ObjectType OIndexesHelper::createObject(const ::rtl::OUString& _rName) while( xResult->next() ) { sal_Bool bUnique = !xRow->getBoolean(4); - if((!aQualifier.getLength() || xRow->getString(5) == aQualifier ) && xRow->getString(6) == aName) + if((aQualifier.isEmpty() || xRow->getString(5) == aQualifier ) && xRow->getString(6) == aName) { sal_Int32 nClustered = xRow->getShort(7); sal_Bool bPrimarKeyIndex = sal_False; @@ -160,7 +160,7 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName ::rtl::OUString aComposedName; aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions); - if ( _rForName.getLength() ) + if (!_rForName.isEmpty() ) { aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); aSql.appendAscii(" ON "); diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx index f02438d9a6d0..606a8bfec1a3 100644 --- a/connectivity/source/commontools/TKey.cxx +++ b/connectivity/source/commontools/TKey.cxx @@ -74,7 +74,7 @@ void OTableKeyHelper::refreshColumns() m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema; m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable; - if ( m_Name.getLength() ) // foreign key + if ( !m_Name.isEmpty() ) // foreign key { Reference< XResultSet > xResult = m_pTable->getMetaData()->getImportedKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)), diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 75f717030d26..7e6734c6fc4a 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -64,7 +64,7 @@ sdbcx::ObjectType OKeysHelper::createObject(const ::rtl::OUString& _rName) { sdbcx::ObjectType xRet = NULL; - if(_rName.getLength()) + if(!_rName.isEmpty()) { OTableKeyHelper* pRet = new OTableKeyHelper(m_pTable,_rName,m_pTable->getKeyProperties(_rName)); xRet = pRet; diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 03b9c889d27d..0890dd9b08d8 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -272,7 +272,7 @@ void OTableHelper::refreshColumns() if(!isNew()) { Any aCatalog; - if ( m_CatalogName.getLength() ) + if ( !m_CatalogName.isEmpty() ) aCatalog <<= m_CatalogName; ::utl::SharedUNOComponent< XResultSet > xResult( getMetaData()->getColumns( @@ -330,7 +330,7 @@ const ColumnDesc* OTableHelper::getColumnDescription(const ::rtl::OUString& _sNa void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames) { Any aCatalog; - if ( m_CatalogName.getLength() ) + if ( !m_CatalogName.isEmpty() ) aCatalog <<= m_CatalogName; Reference< XResultSet > xResult = getMetaData()->getPrimaryKeys(aCatalog,m_SchemaName,m_Name); @@ -359,7 +359,7 @@ void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames) void OTableHelper::refreshForeignKeys(TStringVector& _rNames) { Any aCatalog; - if ( m_CatalogName.getLength() ) + if ( !m_CatalogName.isEmpty() ) aCatalog <<= m_CatalogName; Reference< XResultSet > xResult = getMetaData()->getImportedKeys(aCatalog,m_SchemaName,m_Name); Reference< XRow > xRow(xResult,UNO_QUERY); @@ -387,7 +387,7 @@ void OTableHelper::refreshForeignKeys(TStringVector& _rNames) } - if ( sFkName.getLength() && !xRow->wasNull() ) + if ( !sFkName.isEmpty() && !xRow->wasNull() ) { if ( sOldFKName != sFkName ) { @@ -446,7 +446,7 @@ void OTableHelper::refreshIndexes() { // fill indexes Any aCatalog; - if ( m_CatalogName.getLength() ) + if ( !m_CatalogName.isEmpty() ) aCatalog <<= m_CatalogName; Reference< XResultSet > xResult = getMetaData()->getIndexInfo(aCatalog,m_SchemaName,m_Name,sal_False,sal_False); @@ -459,10 +459,10 @@ void OTableHelper::refreshIndexes() while( xResult->next() ) { aName = xRow->getString(5); - if(aName.getLength()) + if(!aName.isEmpty()) aName += sCatalogSep; aName += xRow->getString(6); - if ( aName.getLength() ) + if ( !aName.isEmpty() ) { // don't insert the name if the last one we inserted was the same if (sPreviousRoundName != aName) diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index a88031c7f60b..87b78c408ff9 100644 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx @@ -113,7 +113,7 @@ namespace dbtools ensureConstructed( ); rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW; - if ( _rIanaName.getLength() ) + if ( !_rIanaName.isEmpty() ) { // byte string conversion ::rtl::OString sMimeByteString( _rIanaName.getStr(), _rIanaName.getLength(), RTL_TEXTENCODING_ASCII_US ); diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index f3c2320f66b0..7c6f10de28b8 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -469,7 +469,7 @@ namespace dbtools nSecond = (sal_uInt16)_sSQLString.getToken(0,sTimeSep,nIndex).toInt32(); nIndex = 0; ::rtl::OUString sNano(_sSQLString.getToken(1,'.',nIndex)); - if ( sNano.getLength() ) + if ( !sNano.isEmpty() ) { // our time struct only supports hundredth seconds sNano = sNano.copy(0,::std::min<sal_Int32>(sNano.getLength(),2)); diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 35482a200009..a4aeb5649ada 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -258,7 +258,7 @@ Reference< XDataSource> getDataSource_allowException( const ::rtl::OUString& _rsTitleOrPath, const Reference< XMultiServiceFactory >& _rxFactory ) { - ENSURE_OR_RETURN( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !", NULL ); + ENSURE_OR_RETURN( !_rsTitleOrPath.isEmpty(), "getDataSource_allowException: invalid arg !", NULL ); Reference< XNameAccess> xDatabaseContext( _rxFactory->createInstance( @@ -298,7 +298,7 @@ Reference< XConnection > getConnection_allowException( if (xDataSource.is()) { // do it with interaction handler - if(!_rsUser.getLength() || !_rsPwd.getLength()) + if(_rsUser.isEmpty() || _rsPwd.isEmpty()) { Reference<XPropertySet> xProp(xDataSource,UNO_QUERY); ::rtl::OUString sPwd, sUser; @@ -313,7 +313,7 @@ Reference< XConnection > getConnection_allowException( { OSL_FAIL("dbtools::getConnection: error while retrieving data source properties!"); } - if(bPwdReq && !sPwd.getLength()) + if(bPwdReq && sPwd.isEmpty()) { // password required, but empty -> connect using an interaction handler Reference<XCompletedConnection> xConnectionCompletion(xProp, UNO_QUERY); if (xConnectionCompletion.is()) @@ -436,7 +436,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R xRowSetProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))) >>= sURL; Reference< XConnection > xPureConnection; - if (sDataSourceName.getLength()) + if (!sDataSourceName.isEmpty()) { // the row set's data source property is set // -> try to connect, get user and pwd setting for that ::rtl::OUString sUser, sPwd; @@ -448,7 +448,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R xPureConnection = getConnection_allowException( sDataSourceName, sUser, sPwd, _rxFactory ); } - else if (sURL.getLength()) + else if (!sURL.isEmpty()) { // the row set has no data source, but a connection url set // -> try to connection with that url Reference< XDriverManager > xDriverManager( @@ -460,7 +460,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R xRowSetProps->getPropertyValue(sUserProp) >>= sUser; if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), xRowSetProps)) xRowSetProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPwd; - if (sUser.getLength()) + if (!sUser.isEmpty()) { // use user and pwd together with the url Sequence< PropertyValue> aInfo(2); aInfo.getArray()[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")); @@ -586,7 +586,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect OSL_PRECOND( _rxConnection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection!" ); OSL_PRECOND( ( CommandType::TABLE == _nCommandType ) || ( CommandType::QUERY == _nCommandType ) || ( CommandType::COMMAND == _nCommandType ), "::dbtools::getFieldsByCommandDescriptor: invalid command type!" ); - OSL_PRECOND( _rCommand.getLength(), "::dbtools::getFieldsByCommandDescriptor: invalid command (empty)!" ); + OSL_PRECOND( !_rCommand.isEmpty(), "::dbtools::getFieldsByCommandDescriptor: invalid command (empty)!" ); Reference< XNameAccess > xFields; @@ -878,7 +878,7 @@ static ::rtl::OUString impl_doComposeTableName( const Reference< XDatabaseMetaDa OSL_ENSURE(_rxMetaData.is(), "impl_doComposeTableName : invalid meta data !"); if ( !_rxMetaData.is() ) return ::rtl::OUString(); - OSL_ENSURE(_rName.getLength(), "impl_doComposeTableName : at least the name should be non-empty !"); + OSL_ENSURE(!_rName.isEmpty(), "impl_doComposeTableName : at least the name should be non-empty !"); const ::rtl::OUString sQuoteString = _rxMetaData->getIdentifierQuoteString(); const NameComponentSupport aNameComps( lcl_getNameComponentSupport( _rxMetaData, _eComposeRule ) ); @@ -887,19 +887,19 @@ static ::rtl::OUString impl_doComposeTableName( const Reference< XDatabaseMetaDa ::rtl::OUString sCatalogSep; sal_Bool bCatlogAtStart = sal_True; - if ( _rCatalog.getLength() && aNameComps.bCatalogs ) + if ( !_rCatalog.isEmpty() && aNameComps.bCatalogs ) { sCatalogSep = _rxMetaData->getCatalogSeparator(); bCatlogAtStart = _rxMetaData->isCatalogAtStart(); - if ( bCatlogAtStart && sCatalogSep.getLength()) + if ( bCatlogAtStart && !sCatalogSep.isEmpty()) { aComposedName.append( _bQuote ? quoteName( sQuoteString, _rCatalog ) : _rCatalog ); aComposedName.append( sCatalogSep ); } } - if ( _rSchema.getLength() && aNameComps.bSchemas ) + if ( !_rSchema.isEmpty() && aNameComps.bSchemas ) { aComposedName.append( _bQuote ? quoteName( sQuoteString, _rSchema ) : _rSchema ); aComposedName.appendAscii( "." ); @@ -907,9 +907,9 @@ static ::rtl::OUString impl_doComposeTableName( const Reference< XDatabaseMetaDa aComposedName.append( _bQuote ? quoteName( sQuoteString, _rName ) : _rName ); - if ( _rCatalog.getLength() + if ( !_rCatalog.isEmpty() && !bCatlogAtStart - && sCatalogSep.getLength() + && !sCatalogSep.isEmpty() && aNameComps.bCatalogs ) { diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 63492b42383c..7ea7bc9cac3f 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -115,10 +115,10 @@ namespace dbtools sPostFix = xRow->getString (5); sCreateParams = xRow->getString(6); // first identical type will be used if typename is empty - if ( !sTypeName.getLength() && nType == nDataType ) + if ( sTypeName.isEmpty() && nType == nDataType ) sTypeName = sTypeName2Cmp; - if( sTypeName.equalsIgnoreAsciiCase(sTypeName2Cmp) && nType == nDataType && sCreateParams.getLength() && !xRow->wasNull()) + if( sTypeName.equalsIgnoreAsciiCase(sTypeName2Cmp) && nType == nDataType && !sCreateParams.isEmpty() && !xRow->wasNull()) { bUseLiteral = sal_True; break; @@ -128,7 +128,7 @@ namespace dbtools } sal_Int32 nIndex = 0; - if ( sAutoIncrementValue.getLength() && (nIndex = sTypeName.indexOf(sAutoIncrementValue)) != -1 ) + if ( !sAutoIncrementValue.isEmpty() && (nIndex = sTypeName.indexOf(sAutoIncrementValue)) != -1 ) { sTypeName = sTypeName.replaceAt(nIndex,sTypeName.getLength() - nIndex,::rtl::OUString()); } @@ -149,10 +149,10 @@ namespace dbtools if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP ) { aSql.append(nPrecision); - if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1) ) + if ( (nScale > 0) || (!_sCreatePattern.isEmpty() && sCreateParams.indexOf(_sCreatePattern) != -1) ) aSql.appendAscii(","); } - if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1 ) || nDataType == DataType::TIMESTAMP ) + if ( (nScale > 0) || ( !_sCreatePattern.isEmpty() && sCreateParams.indexOf(_sCreatePattern) != -1 ) || nDataType == DataType::TIMESTAMP ) aSql.append(nScale); if ( nParenPos == -1 ) @@ -167,7 +167,7 @@ namespace dbtools aSql.append(sTypeName); // simply add the type name ::rtl::OUString aDefault = ::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DEFAULTVALUE))); - if ( aDefault.getLength() ) + if ( !aDefault.isEmpty() ) { aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DEFAULT "))); aSql.append(sPreFix); @@ -178,7 +178,7 @@ namespace dbtools if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS) aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" NOT NULL"))); - if ( bIsAutoIncrement && sAutoIncrementValue.getLength()) + if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) { aSql.appendAscii(" "); aSql.append(sAutoIncrementValue); @@ -204,7 +204,7 @@ namespace dbtools descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= sTable; sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions ); - if ( !sComposedName.getLength() ) + if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(_xConnection); aSql.append(sComposedName); @@ -324,7 +324,7 @@ namespace sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions ); - if ( !sComposedName.getLength() ) + if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(_xConnection); aSql.append(generateColumnNames(xColumns,xMetaData)); @@ -370,7 +370,7 @@ namespace { ::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_pHelper,_sCreatePattern); const ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection); - if ( sKeyStmt.getLength() ) + if ( !sKeyStmt.isEmpty() ) aSql += sKeyStmt; else { @@ -670,7 +670,7 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData, try { Any aVal; - if(_sCatalog.getLength()) + if(!_sCatalog.isEmpty()) aVal <<= _sCatalog; Reference< XResultSet > xPrivileges = _xMetaData->getTablePrivileges(aVal, _sSchema, _sTable); Reference< XRow > xCurrentRow(xPrivileges, UNO_QUERY); @@ -943,7 +943,7 @@ sal_Int32 DBTypeConversion::convertUnicodeStringToLength( const ::rtl::OUString& { ::rtl::OUString sDefaultReportEngineName; aReportEngines.getNodeValue(lcl_getDefaultReportEngine()) >>= sDefaultReportEngineName; - if ( sDefaultReportEngineName.getLength() ) + if ( !sDefaultReportEngineName.isEmpty() ) { ::utl::OConfigurationNode aReportEngineNames = aReportEngines.openNode(lcl_getReportEngineNames()); if ( aReportEngineNames.isValid() ) diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx index 620362f9222c..08a8bc38f594 100644 --- a/connectivity/source/commontools/filtermanager.cxx +++ b/connectivity/source/commontools/filtermanager.cxx @@ -107,7 +107,7 @@ namespace dbtools try { - if ( m_xComponentAggregate.is() && getFilterComponent( fcPublicFilter ).getLength() ) + if ( m_xComponentAggregate.is() && !getFilterComponent( fcPublicFilter ).isEmpty() ) { // only if there changed something m_xComponentAggregate->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FILTER), makeAny( getComposedFilter() ) ); } @@ -140,7 +140,7 @@ namespace dbtools sal_Int32 i; for ( i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i ) { - if ( m_aFilterComponents[ i ].getLength() ) + if ( !m_aFilterComponents[ i ].isEmpty() ) { if ( nOnlyNonEmpty != -1 ) // it's the second non-empty component diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index ed4650717a83..92dcb34c990e 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -276,7 +276,7 @@ namespace dbtools const ::rtl::OUString* pDetailFieldsEnd = pDetailFields + m_aDetailFields.getLength(); for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, ++pMasterFields ) { - if ( !pMasterFields->getLength() || !pDetailFields->getLength() ) + if ( pMasterFields->isEmpty() || pDetailFields->isEmpty() ) continue; // if not even the master part of the relationship exists in the parent , the @@ -305,7 +305,7 @@ namespace dbtools { ::rtl::OUString sNewParamName; const ::rtl::OUString sFilterCondition = createFilterConditionFromColumnLink( *pMasterFields, *pDetailFields, sNewParamName ); - OSL_PRECOND( sNewParamName.getLength(), "ParameterManager::classifyLinks: createFilterConditionFromColumnLink returned nonsense!" ); + OSL_PRECOND( !sNewParamName.isEmpty(), "ParameterManager::classifyLinks: createFilterConditionFromColumnLink returned nonsense!" ); // remember meta information about this new parameter ::std::pair< ParameterInformation::iterator, bool > aInsertionPos = diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index d94621e214de..2b7df486a28a 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -67,10 +67,10 @@ namespace dbtools //--------------------------------------------------------------------- static sal_Unicode lcl_getSeparatorChar( const ::rtl::OUString& _rSeparator, sal_Unicode _nFallback ) { - OSL_ENSURE( 0 < _rSeparator.getLength(), "::lcl_getSeparatorChar: invalid separator string!" ); + OSL_ENSURE( !_rSeparator.isEmpty(), "::lcl_getSeparatorChar: invalid separator string!" ); sal_Unicode nReturn( _nFallback ); - if ( _rSeparator.getLength() ) + if ( !_rSeparator.isEmpty() ) nReturn = static_cast< sal_Char >( _rSeparator.getStr()[0] ); return nReturn; } @@ -156,7 +156,7 @@ namespace dbtools ) { // yes -> force a quoted text and try again ::rtl::OUString sQuoted( _rStatement ); - if ( sQuoted.getLength() + if ( !sQuoted.isEmpty() && ( (sQuoted.getStr()[0] != '\'') || (sQuoted.getStr()[ sQuoted.getLength() - 1 ] != '\'' ) ) @@ -220,7 +220,7 @@ namespace dbtools ) >>= aFormatLocale; // valid locale - if ( aFormatLocale.Language.getLength() ) + if ( !aFormatLocale.Language.isEmpty() ) { getSeparatorChars( aFormatLocale, nFmtDecSep, nCtxThdSep ); } @@ -349,7 +349,7 @@ namespace dbtools if(nIndex == -1) sField = _sField; sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sField,&m_aParser.getContext()); - if ( nType == DataType::OTHER || !sField.getLength() ) + if ( nType == DataType::OTHER || sField.isEmpty() ) { // first try the international version ::rtl::OUString sSql; diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx index 558437d63087..3072af21c6f1 100644 --- a/connectivity/source/commontools/sqlerror.cxx +++ b/connectivity/source/commontools/sqlerror.cxx @@ -253,7 +253,7 @@ namespace connectivity if ( impl_initResources() ) { ::rtl::OUString sResMessage( m_pResources->loadString( lcl_getResourceID( _eCondition, false ) ) ); - OSL_ENSURE( sResMessage.getLength(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" ); + OSL_ENSURE( !sResMessage.isEmpty(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" ); aMessage.append( getMessagePrefix() ).appendAscii( " " ).append( sResMessage ); } @@ -272,7 +272,7 @@ namespace connectivity sState = m_pResources->loadString( nResourceId ); } - if ( !sState.getLength() ) + if ( sState.isEmpty() ) sState = ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) ); return sState; diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx index d83a83ff0ff4..7b4ab77a50a3 100644 --- a/connectivity/source/commontools/statementcomposer.cxx +++ b/connectivity/source/commontools/statementcomposer.cxx @@ -135,7 +135,7 @@ namespace dbtools case CommandType::TABLE: { - if ( !_rData.sCommand.getLength() ) + if ( _rData.sCommand.isEmpty() ) break; sStatement = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SELECT * FROM " ) ); @@ -166,7 +166,7 @@ namespace dbtools // the command used by the query xQuery->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) ) ) >>= sStatement; - if ( !sStatement.getLength() ) + if ( sStatement.isEmpty() ) break; // use a composer to build a statement from the query filter/order props @@ -214,7 +214,7 @@ namespace dbtools break; } - if ( sStatement.getLength() ) + if ( !sStatement.isEmpty() ) { // create an composer Reference< XMultiServiceFactory > xFactory( _rData.xConnection, UNO_QUERY_THROW ); |