diff options
author | Brij Mohan Lal Srivastava <contactbrijmohan@gmail.com> | 2014-11-12 14:24:10 +0530 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-14 09:20:38 +0100 |
commit | d32be3ace8c8fd430bbecdf69f88a116b0ee91d1 (patch) | |
tree | b373c084cb124434e0498867b24bc7bb333155dd /connectivity | |
parent | f5e86ebc097f0f8bc5b282511149cb026710ecde (diff) |
fdo#86023 - O[U]String needs a 'clear' method
Added clear() method to OString and OUString class, Updated appropriate call-sites.
Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
10 files changed, 16 insertions, 16 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index d67a794002bc..5aa7dc939bd7 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -233,7 +233,7 @@ OUString convertName2SQLName(const OUString& rName,const OUString& _rSpecials) } if ( !bValid ) - aNewName = OUString(); + aNewName.clear(); return aNewName; } diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 1312e7e54c9a..5f2b28f1eab0 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -369,7 +369,7 @@ void OTableHelper::refreshForeignKeys(TStringVector& _rNames) // this must be outsid the "if" because we have to call in a right order sCatalog = xRow->getString(1); if ( xRow->wasNull() ) - sCatalog = OUString(); + sCatalog.clear(); aSchema = xRow->getString(2); aName = xRow->getString(3); diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index 72757fb8f9b7..4bc8b46bef7c 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -108,7 +108,7 @@ namespace dbtools m_aParameterInformation.swap( aEmptyInfo ); m_aMasterFields.realloc( 0 ); m_aDetailFields.realloc( 0 ); - m_sIdentifierQuoteString = OUString(); + m_sIdentifierQuoteString.clear(); ::std::vector< bool > aEmptyArray; m_aParametersVisited.swap( aEmptyArray ); m_bUpToDate = false; diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 4fbd21764d6c..5d0cc9d531d9 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -267,7 +267,7 @@ namespace dbtools getSeparatorChars( rParseContext.getPreferredLocale(), nDecSeparator, nThousandSeparator ); // translate it back into a string - sTransformedText = OUString(); + sTransformedText.clear(); pParseNode->parseNodeToPredicateStr( sTransformedText, m_xConnection, m_xFormatter, _rxField, OUString(), rParseContext.getPreferredLocale(), (sal_Char)nDecSeparator, &rParseContext diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index 0ce8ae423255..d28fa19c1dff 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -405,7 +405,7 @@ void ODbaseIndex::createINFEntry() aKeyName = aInfFile.GetKeyName(i); if (bCase ? aKeyName.equals(aNewEntry) : aKeyName.equalsIgnoreAsciiCase(aNewEntry)) { - aNewEntry = OString(); + aNewEntry.clear(); break; } } diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 937773d53cef..4e44f5e33b7c 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1574,7 +1574,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow, if (xTableColumn.is()) xTableColumn->getPropertyValue(sName) >>= sTableColumnName; else - sTableColumnName = OUString(); + sTableColumnName.clear(); // look if we have such a select column // TODO: would like to have a O(log n) search here ... diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index dcaa620eaa8f..5a7bbe6dd5e4 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -417,7 +417,7 @@ sal_Bool PreparedStatement::execute( ) m_executedStatement = buf.makeStringAndClear(); m_lastResultset.clear(); - m_lastTableInserted = OUString(); + m_lastTableInserted.clear(); struct CommandData data; data.refMutex = m_refMutex; diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 629d362866b9..5c20b9a989f6 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -464,7 +464,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) ExecStatusType state = PQresultStatus( result ); *(data->pLastOidInserted) = 0; - *(data->pLastTableInserted) = OUString(); + (data->pLastTableInserted)->clear(); *(data->pLastQuery) = cmd; bool ret = false; @@ -858,7 +858,7 @@ sal_Bool Statement::execute( const OUString& sql ) OString cmd = OUStringToOString( sql, m_pSettings ); m_lastResultset.clear(); - m_lastTableInserted = OUString(); + m_lastTableInserted.clear(); struct CommandData data; data.refMutex = m_refMutex; diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 17428fd96fe2..3f8e85fb7c74 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -552,7 +552,7 @@ void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUSt switch (vec.size()) { case 1: - *first = OUString(); + first->clear(); *second = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); break; case 3: @@ -808,7 +808,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) RTL_CONSTASCII_STRINGPARAM( "(" ) ) == 0 ) { // whoops, it is a function - ret = OString(); + ret.clear(); } else { @@ -828,7 +828,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) RTL_CONSTASCII_STRINGPARAM( "," ) ) == 0 ) { // whoops, multiple tables are used - ret = OString(); + ret.clear(); } else { @@ -842,7 +842,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) strlen(forbiddenKeywords[i]) ) ) { // whoops, it is a join - ret = OString(); + ret.clear(); } } } diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx index fe4e13ae87a2..ef3880f632ce 100644 --- a/connectivity/source/sdbcx/VCatalog.cxx +++ b/connectivity/source/sdbcx/VCatalog.cxx @@ -189,13 +189,13 @@ OUString OCatalog::buildName(const Reference< XRow >& _xRow) { OUString sCatalog = _xRow->getString(1); if ( _xRow->wasNull() ) - sCatalog = OUString(); + sCatalog.clear(); OUString sSchema = _xRow->getString(2); if ( _xRow->wasNull() ) - sSchema = OUString(); + sSchema.clear(); OUString sTable = _xRow->getString(3); if ( _xRow->wasNull() ) - sTable = OUString(); + sTable.clear(); OUString sComposedName( ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, false, ::dbtools::eInDataManipulation ) ); |