diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-03 14:03:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-05 08:44:19 +0200 |
commit | 705c48d32eec0aa5180e60ca157daca4b154e4a3 (patch) | |
tree | 97f43496f4b429a2b8d03b1e71cb2a1c33142a15 /connectivity/source | |
parent | b7d8a58ff2698ffc6e22943f64aa97c5ea253bd9 (diff) |
fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.
Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
Diffstat (limited to 'connectivity/source')
32 files changed, 118 insertions, 176 deletions
diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx index 189e7569b7bd..9157e3302680 100644 --- a/connectivity/source/commontools/AutoRetrievingBase.cxx +++ b/connectivity/source/commontools/AutoRetrievingBase.cxx @@ -29,8 +29,8 @@ namespace connectivity if ( sStmt.startsWith("INSERT") ) { sStatement = m_sGeneratedValueStatement; - static const OUString sColumn("$column"); - static const OUString sTable("$table"); + static const char sColumn[] = "$column"; + static const char sTable[] = "$table"; sal_Int32 nIndex = 0; nIndex = sStatement.indexOf(sColumn,nIndex); if ( -1 != nIndex ) @@ -49,7 +49,7 @@ namespace connectivity nIntoIndex = 0; OUString sTableName = sStmt.getToken(0,' ',nIntoIndex); - sStatement = sStatement.replaceAt(nIndex,sTable.getLength(),sTableName); + sStatement = sStatement.replaceAt(nIndex, strlen(sTable), sTableName); } } return sStatement; diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index f762c645730f..ffcc94112d17 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -288,10 +288,7 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant, // and again a special treatment, this time for percent formats if ((NumberFormat::NUMBER == nRealUsedTypeClass) && (NumberFormat::PERCENT == nTypeClass)) { // formatting should be "percent", but the String provides just a simple number -> adjust - OUString sExpanded(rString); - static OUString s_sPercentSymbol( "%" ); - // need a method to add a sal_Unicode to a string, 'til then we use a static string - sExpanded += s_sPercentSymbol; + OUString sExpanded = rString + "%"; fValue = xFormatter->convertStringToNumber(nKeyToUse, sExpanded); } diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx index 7804ad9f6fab..391f6ee4f677 100644 --- a/connectivity/source/commontools/DriversConfig.cxx +++ b/connectivity/source/commontools/DriversConfig.cxx @@ -44,7 +44,7 @@ namespace if ( aPropertiesNode.isValid() ) { uno::Sequence< OUString > aStringSeq; - static const OUString s_sValue("/Value"); + static const char s_sValue[] = "/Value"; const uno::Sequence< OUString > aProperties = aPropertiesNode.getNodeNames(); const OUString* pPropertiesIter = aProperties.getConstArray(); const OUString* pPropertiesEnd = pPropertiesIter + aProperties.getLength(); @@ -97,7 +97,7 @@ void DriversConfigImpl::Load(const uno::Reference< uno::XComponentContext >& _rx { if ( !m_aInstalled.isValid() ) { - static const OUString s_sNodeName("org.openoffice.Office.DataAccess.Drivers/Installed"); ///Installed + static const char s_sNodeName[] = "org.openoffice.Office.DataAccess.Drivers/Installed"; ///Installed m_aInstalled = ::utl::OConfigurationTreeRoot::createWithComponentContext(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); } diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 4bf877afffbd..1312e7e54c9a 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -122,14 +122,10 @@ namespace connectivity Reference<XMultiServiceFactory> xFac(_xConnection,UNO_QUERY); if ( xFac.is() ) { - static const OUString s_sTableRename("TableRenameServiceName"); - m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableRename)),UNO_QUERY); - static const OUString s_sTableAlteration("TableAlterationServiceName"); - m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableAlteration)),UNO_QUERY); - static const OUString s_sKeyAlteration("KeyAlterationServiceName"); - m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sKeyAlteration)),UNO_QUERY); - static const OUString s_sIndexAlteration("IndexAlterationServiceName"); - m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sIndexAlteration)),UNO_QUERY); + m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,"TableRenameServiceName")),UNO_QUERY); + m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,"TableAlterationServiceName")),UNO_QUERY); + m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,"KeyAlterationServiceName")),UNO_QUERY); + m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,"IndexAlterationServiceName")),UNO_QUERY); } } catch(const Exception&) diff --git a/connectivity/source/commontools/conncleanup.cxx b/connectivity/source/commontools/conncleanup.cxx index 7a722235b196..b5882d01475a 100644 --- a/connectivity/source/commontools/conncleanup.cxx +++ b/connectivity/source/commontools/conncleanup.cxx @@ -32,12 +32,7 @@ namespace dbtools using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::lang; - - static const OUString& getActiveConnectionPropertyName() - { - static const OUString s_sActiveConnectionPropertyName( "ActiveConnection" ); - return s_sActiveConnectionPropertyName; - } + static const char ACTIVE_CONNECTION_PROPERTY_NAME[] = "ActiveConnection"; //= OAutoConnectionDisposer @@ -56,7 +51,7 @@ namespace dbtools try { - xProps->setPropertyValue( getActiveConnectionPropertyName(), makeAny( _rxConnection ) ); + xProps->setPropertyValue( ACTIVE_CONNECTION_PROPERTY_NAME, makeAny( _rxConnection ) ); m_xOriginalConnection = _rxConnection; startPropertyListening( xProps ); } @@ -71,7 +66,7 @@ namespace dbtools { try { - _rxRowSet->addPropertyChangeListener( getActiveConnectionPropertyName(), this ); + _rxRowSet->addPropertyChangeListener( ACTIVE_CONNECTION_PROPERTY_NAME, this ); m_bPropertyListening = true; } catch( const Exception& ) @@ -91,7 +86,7 @@ namespace dbtools OSL_ENSURE( _rxEventSource.is(), "OAutoConnectionDisposer::stopPropertyListening: invalid event source (no XPropertySet)!" ); if ( _rxEventSource.is() ) { - _rxEventSource->removePropertyChangeListener( getActiveConnectionPropertyName(), this ); + _rxEventSource->removePropertyChangeListener( ACTIVE_CONNECTION_PROPERTY_NAME, this ); m_bPropertyListening = false; } } @@ -135,7 +130,7 @@ namespace dbtools void SAL_CALL OAutoConnectionDisposer::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException, std::exception) { - if ( _rEvent.PropertyName.equals( getActiveConnectionPropertyName() ) ) + if ( _rEvent.PropertyName == ACTIVE_CONNECTION_PROPERTY_NAME ) { // somebody set a new ActiveConnection Reference< XConnection > xNewConnection; diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index a5faf6fc6268..7791385dbba4 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -694,15 +694,15 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData, Reference< XRow > xCurrentRow(xPrivileges, UNO_QUERY); const OUString sUserWorkingFor = _xMetaData->getUserName(); - static const OUString sSELECT( "SELECT" ); - static const OUString sINSERT( "INSERT" ); - static const OUString sUPDATE( "UPDATE" ); - static const OUString sDELETE( "DELETE" ); - static const OUString sREAD( "READ" ); - static const OUString sCREATE( "CREATE" ); - static const OUString sALTER( "ALTER" ); - static const OUString sREFERENCE( "REFERENCE" ); - static const OUString sDROP( "DROP" ); + static const char sSELECT[] = "SELECT"; + static const char sINSERT[] = "INSERT"; + static const char sUPDATE[] = "UPDATE"; + static const char sDELETE[] = "DELETE"; + static const char sREAD[] = "READ"; + static const char sCREATE[] = "CREATE"; + static const char sALTER[] = "ALTER"; + static const char sREFERENCE[] = "REFERENCE"; + static const char sDROP[] = "DROP"; if ( xCurrentRow.is() ) { @@ -800,9 +800,8 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData, } catch(const SQLException& e) { - static OUString sNotSupportedState( "IM001" ); // some drivers don't support any privileges so we assume that we are allowed to do all we want :-) - if(e.SQLState == sNotSupportedState) + if(e.SQLState == "IM001") nPrivileges |= Privilege::DROP | Privilege::REFERENCE | Privilege::ALTER | @@ -965,20 +964,17 @@ sal_Int32 DBTypeConversion::convertUnicodeStringToLength( const OUString& _rSour } OUString lcl_getReportEngines() { - static OUString s_sNodeName("org.openoffice.Office.DataAccess/ReportEngines"); - return s_sNodeName; + return OUString("org.openoffice.Office.DataAccess/ReportEngines"); } OUString lcl_getDefaultReportEngine() { - static OUString s_sNodeName("DefaultReportEngine"); - return s_sNodeName; + return OUString("DefaultReportEngine"); } OUString lcl_getReportEngineNames() { - static OUString s_sNodeName("ReportEngineNames"); - return s_sNodeName; + return OUString("ReportEngineNames"); } OUString getDefaultReportEngineServiceName(const Reference< XComponentContext >& _rxORB) diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 9f9cbeedd1de..4fbd21764d6c 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -156,8 +156,8 @@ namespace dbtools ) ) { - static const OUString sSingleQuote( "'" ); - static const OUString sDoubleQuote( "''" ); + static const char sSingleQuote[] = "'"; + static const char sDoubleQuote[] = "''"; sal_Int32 nIndex = -1; sal_Int32 nTemp = 0; @@ -304,8 +304,8 @@ namespace dbtools if ( bValidQuotedText ) { sValue = sValue.copy( 1, sValue.getLength() - 2 ); - static const OUString sSingleQuote( "'" ); - static const OUString sDoubleQuote( "''" ); + static const char sSingleQuote[] = "'"; + static const char sDoubleQuote[] = "''"; sal_Int32 nIndex = -1; sal_Int32 nTemp = 0; diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx index e0e1f4c9ba3b..6c4b8ed7ea32 100644 --- a/connectivity/source/cpool/ZConnectionPool.cxx +++ b/connectivity/source/cpool/ZConnectionPool.cxx @@ -48,16 +48,8 @@ void SAL_CALL OPoolTimer::onShot() { m_pPool->invalidatePooledConnections(); } -namespace -{ - static const OUString& getTimeoutNodeName() - { - static OUString s_sNodeName( "Timeout" ); - return s_sNodeName; - } - -} +static const char TIMEOUT_NODENAME[] = "Timeout"; //= OConnectionPool @@ -78,9 +70,9 @@ OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver, Reference<XPropertySet> xProp(m_xDriverNode,UNO_QUERY); if(xProp.is()) - xProp->addPropertyChangeListener(getTimeoutNodeName(),this); + xProp->addPropertyChangeListener(TIMEOUT_NODENAME,this); - OPoolCollection::getNodeValue(getTimeoutNodeName(),m_xDriverNode) >>= m_nALiveCount; + OPoolCollection::getNodeValue(TIMEOUT_NODENAME, m_xDriverNode) >>= m_nALiveCount; calculateTimeOuts(); m_xInvalidator = new OPoolTimer(this,::salhelper::TTimeValue(m_nTimeOut,0)); @@ -161,7 +153,7 @@ void OConnectionPool::clear(bool _bDispose) xComponent->removeEventListener(this); Reference< XPropertySet > xProp(m_xDriverNode, UNO_QUERY); if (xProp.is()) - xProp->removePropertyChangeListener(getTimeoutNodeName(),this); + xProp->removePropertyChangeListener(TIMEOUT_NODENAME, this); m_xDriverNode.clear(); m_xDriver.clear(); @@ -302,7 +294,7 @@ Reference< XConnection> OConnectionPool::getPooledConnection(TConnectionMap::ite void SAL_CALL OConnectionPool::propertyChange( const PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException, std::exception) { - if(getTimeoutNodeName() == evt.PropertyName) + if(TIMEOUT_NODENAME == evt.PropertyName) { evt.NewValue >>= m_nALiveCount; calculateTimeOuts(); diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index 2bc0bd5f79a0..9976b55a64b1 100644 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -42,34 +42,29 @@ using namespace ::osl; using namespace connectivity; -static const OUString& getConnectionPoolNodeName() +static OUString getConnectionPoolNodeName() { - static OUString s_sNodeName( "org.openoffice.Office.DataAccess/ConnectionPool" ); - return s_sNodeName; + return OUString( "org.openoffice.Office.DataAccess/ConnectionPool" ); } -static const OUString& getEnablePoolingNodeName() +static OUString getEnablePoolingNodeName() { - static OUString s_sNodeName( "EnablePooling" ); - return s_sNodeName; + return OUString( "EnablePooling" ); } -static const OUString& getDriverNameNodeName() +static OUString getDriverNameNodeName() { - static OUString s_sNodeName( "DriverName" ); - return s_sNodeName; + return OUString( "DriverName" ); } -static const OUString& getDriverSettingsNodeName() +static OUString getDriverSettingsNodeName() { - static OUString s_sNodeName( "DriverSettings" ); - return s_sNodeName; + return OUString( "DriverSettings" ); } -static const OUString& getEnableNodeName() +static OUString getEnableNodeName() { - static OUString s_sNodeName( "Enable" ); - return s_sNodeName; + return OUString( "Enable" ); } diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 79abed73a185..319bc688769e 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -435,7 +435,7 @@ void OConnection::buildTypeInfo() throw( SQLException) if ( bOk ) { // HACK for access - static const OUString s_sVarChar("VarChar"); + static const char s_sVarChar[] = "VarChar"; do { sal_Int32 nPos = 1; diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index ee201ee3c0b4..3174f7809061 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -142,11 +142,10 @@ static CellContentType lcl_GetContentOrResultType( const Reference<XCell>& xCell CellContentType eCellType = xCell->getType(); if ( eCellType == CellContentType_FORMULA ) { - static const OUString s_sFormulaResultType("FormulaResultType"); Reference<XPropertySet> xProp( xCell, UNO_QUERY ); try { - xProp->getPropertyValue( s_sFormulaResultType ) >>= eCellType; // type of formula result + xProp->getPropertyValue( "FormulaResultType" ) >>= eCellType; // type of formula result } catch (UnknownPropertyException&) { @@ -258,10 +257,9 @@ static void lcl_GetColumnInfo( const Reference<XSpreadsheet>& xSheet, const Refe sal_Int16 nNumType = NumberFormat::NUMBER; try { - static OUString s_NumberFormat("NumberFormat"); sal_Int32 nKey = 0; - if ( xProp->getPropertyValue( s_NumberFormat ) >>= nKey ) + if ( xProp->getPropertyValue( "NumberFormat" ) >>= nKey ) { const Reference<XPropertySet> xFormat = xFormats->getByKey( nKey ); if ( xFormat.is() ) diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx index a75417619cec..d353c360f022 100644 --- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx +++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx @@ -374,9 +374,8 @@ sal_Bool SAL_CALL ODbaseDatabaseMetaData::isReadOnly( ) throw(SQLException, Run ::osl::MutexGuard aGuard( m_aMutex ); bool bReadOnly = false; - static OUString sReadOnly( "IsReadOnly" ); ::ucbhelper::Content aFile(m_pConnection->getContent(),Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext()); - aFile.getPropertyValue(sReadOnly) >>= bReadOnly; + aFile.getPropertyValue("IsReadOnly") >>= bReadOnly; return bReadOnly; } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index eebe107ffbad..47d3472ca7a6 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -622,7 +622,7 @@ OUString ODbaseTable::getEntry(OConnection* _pConnection,const OUString& _sName OUString sName; OUString sExt; INetURLObject aURL; - static const OUString s_sSeparator("/"); + static const char s_sSeparator[] = "/"; xDir->beforeFirst(); while(xDir->next()) { @@ -1149,7 +1149,7 @@ bool ODbaseTable::CreateImpl() return true; } -void ODbaseTable::throwInvalidColumnType(const sal_uInt16 _nErrorId,const OUString& _sColumnName) +void ODbaseTable::throwInvalidColumnType(const sal_uInt16 _nErrorId, const OUString& _sColumnName) { try { diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index 9a114fb75d82..8e6a0746383c 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -42,7 +42,7 @@ OEvoabResultSetMetaData::~OEvoabResultSetMetaData() void OEvoabResultSetMetaData::setEvoabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException) { OSQLColumns::Vector::const_iterator aIter; - static const OUString aName("Name"); + static const char aName[] = "Name"; for (aIter = xColumns->get().begin(); aIter != xColumns->get().end(); ++aIter) { diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 5a766df35675..5ab8b44e5b54 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -167,7 +167,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( // check if any type is given // when no types are given then we have to return all tables e.g. TABLE - static const OUString aTable("TABLE"); + static const char aTable[] = "TABLE"; bool bTableFound = true; sal_Int32 nLength = types.getLength(); @@ -296,7 +296,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( } if(bNewRow) { - aRow.push_back(new ORowSetValueDecorator(aTable)); + aRow.push_back(new ORowSetValueDecorator(OUString(aTable))); aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue()); aRows.push_back(aRow); @@ -499,8 +499,7 @@ OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, Runt OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( ) { - static const OUString sQuote("\""); - return sQuote; + return OUString("\""); } OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException, std::exception) @@ -853,8 +852,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQL OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception) { - static const OUString aValue( "sdbc:file:" ); - return aValue; + return OUString( "sdbc:file:" ); } OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx index 0407c6de1801..5e672fdeb7d4 100644 --- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx @@ -1034,7 +1034,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( uno::Reference< XResultSet > xResultSet = pResultSet; uno::Reference< XStatement > statement = m_pConnection->createStatement(); - static const OUString wld("%"); + static const char wld[] = "%"; OUStringBuffer queryBuf( "SELECT " "priv.RDB$RELATION_NAME, " // 1 Table name @@ -1295,7 +1295,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( uno::Reference< XResultSet > xResultSet = pResultSet; uno::Reference< XStatement > statement = m_pConnection->createStatement(); - static const OUString wld("%"); + static const char wld[] = "%"; OUStringBuffer queryBuf( "SELECT " "RDB$RELATION_NAME, " @@ -1662,7 +1662,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( // TODO: column specific privileges are included, we may need // to have WHERE RDB$FIELD_NAME = NULL or similar. - static const OUString wld("%"); + static const char wld[] = "%"; OUStringBuffer queryBuf( "SELECT " "priv.RDB$RELATION_NAME, " // 1 diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index b9e3efee1ecc..ce30f3b29d0d 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -332,14 +332,12 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine, if(io_nPrecisions) { io_nType = DataType::DECIMAL; - static const OUString s_sDECIMAL("DECIMAL"); - o_sTypeName = s_sDECIMAL; + o_sTypeName = "DECIMAL"; } else { io_nType = DataType::DOUBLE; - static const OUString s_sDOUBLE("DOUBLE"); - o_sTypeName = s_sDOUBLE; + o_sTypeName = "DOUBLE"; } } else @@ -356,33 +354,21 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine, { case NUMBERFORMAT_DATE: io_nType = DataType::DATE; - { - static const OUString s_sDATE("DATE"); - o_sTypeName = s_sDATE; - } + o_sTypeName = "DATE"; break; case NUMBERFORMAT_DATETIME: io_nType = DataType::TIMESTAMP; - { - static const OUString s_sTIMESTAMP("TIMESTAMP"); - o_sTypeName = s_sTIMESTAMP; - } + o_sTypeName = "TIMESTAMP"; break; case NUMBERFORMAT_TIME: io_nType = DataType::TIME; - { - static const OUString s_sTIME("TIME"); - o_sTypeName = s_sTIME; - } + o_sTypeName = "TIME"; break; default: io_nType = DataType::VARCHAR; io_nPrecisions = 0; // nyi: Data can be longer! io_nScales = 0; - { - static const OUString s_sVARCHAR("VARCHAR"); - o_sTypeName = s_sVARCHAR; - } + o_sTypeName = "VARCHAR"; }; nFlags |= ColumnSearch::CHAR; } @@ -477,7 +463,7 @@ OUString OFlatTable::getEntry() INetURLObject aURL; xDir->beforeFirst(); - static const OUString s_sSeparator("/"); + static const char s_sSeparator[] = "/"; while(xDir->next()) { sName = xRow->getString(1); diff --git a/connectivity/source/drivers/hsqldb/HCatalog.cxx b/connectivity/source/drivers/hsqldb/HCatalog.cxx index 9a87f6e0bdae..975192d1406c 100644 --- a/connectivity/source/drivers/hsqldb/HCatalog.cxx +++ b/connectivity/source/drivers/hsqldb/HCatalog.cxx @@ -53,8 +53,8 @@ void OHCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStrin void OHCatalog::refreshTables() { TStringVector aVector; - static const OUString s_sTableTypeView("VIEW"); - static const OUString s_sTableTypeTable("TABLE"); + static const char s_sTableTypeView[] = "VIEW"; + static const char s_sTableTypeTable[] = "TABLE"; Sequence< OUString > sTableTypes(2); sTableTypes[0] = s_sTableTypeView; diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx index 6ee5c545b045..e1850b51859f 100644 --- a/connectivity/source/drivers/hsqldb/HTables.cxx +++ b/connectivity/source/drivers/hsqldb/HTables.cxx @@ -51,9 +51,9 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName) OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); - static const OUString s_sTableTypeView("VIEW"); - static const OUString s_sTableTypeTable("TABLE"); - static const OUString s_sAll("%"); + static const char s_sTableTypeView[] = "VIEW"; + static const char s_sTableTypeTable[] = "TABLE"; + static const char s_sAll[] = "%"; Sequence< OUString > sTableTypes(3); sTableTypes[0] = s_sTableTypeView; diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx index 98a615fedc8a..124ab58ff641 100644 --- a/connectivity/source/drivers/hsqldb/HUser.cxx +++ b/connectivity/source/drivers/hsqldb/HUser.cxx @@ -119,16 +119,16 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In if ( xRes.is() ) { - static const OUString sSELECT( "SELECT" ); - static const OUString sINSERT( "INSERT" ); - static const OUString sUPDATE( "UPDATE" ); - static const OUString sDELETE( "DELETE" ); - static const OUString sREAD( "READ" ); - static const OUString sCREATE( "CREATE" ); - static const OUString sALTER( "ALTER" ); - static const OUString sREFERENCE( "REFERENCE" ); - static const OUString sDROP( "DROP" ); - static const OUString sYes( "YES" ); + static const char sSELECT [] = "SELECT"; + static const char sINSERT [] = "INSERT"; + static const char sUPDATE [] = "UPDATE"; + static const char sDELETE [] = "DELETE"; + static const char sREAD [] = "READ"; + static const char sCREATE [] = "CREATE"; + static const char sALTER [] = "ALTER"; + static const char sREFERENCE[] = "REFERENCE"; + static const char sDROP [] = "DROP"; + static const char sYes [] = "YES"; nRightsWithGrant = nRights = 0; diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 7baccaa0ce2d..1bf1270888b0 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -758,7 +758,7 @@ void java_sql_Connection::loadDriverFromProperties( const OUString& _sDriverClas OUString java_sql_Connection::impl_getJavaDriverClassPath_nothrow(const OUString& _sDriverClass) { - static const OUString s_sNodeName("org.openoffice.Office.DataAccess/JDBC/DriverClassPaths"); + static const char s_sNodeName[] = "org.openoffice.Office.DataAccess/JDBC/DriverClassPaths"; ::utl::OConfigurationTreeRoot aNamesRoot = ::utl::OConfigurationTreeRoot::createWithComponentContext( m_pDriver->getContext(), s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); OUString sURL; diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx index a50529ce700a..c8bda379e966 100644 --- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx +++ b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx @@ -51,9 +51,7 @@ KabDatabaseMetaData::~KabDatabaseMetaData() const OUString & KabDatabaseMetaData::getAddressBookTableName() { - static const OUString aAddressBookTableName - (OUString::createFromAscii( i18n("Address Book") )); - + static const OUString aAddressBookTableName("Address Book"); return aAddressBookTableName; } diff --git a/connectivity/source/drivers/kab/KResultSetMetaData.cxx b/connectivity/source/drivers/kab/KResultSetMetaData.cxx index 70a760c1d901..640298117ad9 100644 --- a/connectivity/source/drivers/kab/KResultSetMetaData.cxx +++ b/connectivity/source/drivers/kab/KResultSetMetaData.cxx @@ -39,7 +39,7 @@ KabResultSetMetaData::~KabResultSetMetaData() void KabResultSetMetaData::setKabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException) { OSQLColumns::Vector::const_iterator aIter; - static const OUString aName("Name"); + static const char aName[] = "Name"; for (aIter = xColumns->get().begin(); aIter != xColumns->get().end(); ++aIter) { diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx index e0586ace407b..5eb0985fe2b0 100644 --- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx @@ -778,7 +778,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTableTypes( ) throw( Reference< XResultSet > xRef = pResult; static ODatabaseMetaDataResultSet::ORows aRows; - static const OUString aTable("TABLE"); + static const char aTable[] = "TABLE"; if (aRows.empty()) { @@ -963,7 +963,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTables( // check whether we have tables in the requested types // for the moment, we answer only the "TABLE" table type // when no types are given at all, we return all the tables - static const OUString aTable("TABLE"); + static const char aTable[] = "TABLE"; bool bTableFound = false; const OUString* p = types.getConstArray(), * pEnd = p + types.getLength(); diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx index 24cd1de03a13..6248ade38d6f 100644 --- a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx @@ -44,7 +44,7 @@ MacabResultSetMetaData::~MacabResultSetMetaData() void MacabResultSetMetaData::setMacabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException) { OSQLColumns::Vector::const_iterator aIter; - static const OUString aName("Name"); + static const char aName[] = "Name"; MacabRecords *aRecords; MacabHeader *aHeader; diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx index 85adabef944c..cb071e05b4f5 100644 --- a/connectivity/source/drivers/mysql/YCatalog.cxx +++ b/connectivity/source/drivers/mysql/YCatalog.cxx @@ -54,9 +54,9 @@ void OMySQLCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TS void OMySQLCatalog::refreshTables() { TStringVector aVector; - static const OUString s_sTableTypeView("VIEW"); - static const OUString s_sTableTypeTable("TABLE"); - static const OUString s_sAll("%"); + static const char s_sTableTypeView[] = "VIEW"; + static const char s_sTableTypeTable[] = "TABLE"; + static const char s_sAll[] = "%"; Sequence< OUString > sTableTypes(3); sTableTypes[0] = s_sTableTypeView; diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx index c76ade75e6ab..aa776a4234c9 100644 --- a/connectivity/source/drivers/mysql/YDriver.cxx +++ b/connectivity/source/drivers/mysql/YDriver.cxx @@ -278,7 +278,7 @@ namespace connectivity OUString sAdd; if ( RTL_TEXTENCODING_UTF8 == (*aLookup).getEncoding() ) { - static const OUString s_sCharSetOp("useUnicode=true&"); + static const char s_sCharSetOp[] = "useUnicode=true&"; if ( !sCuttedUrl.matchIgnoreAsciiCase(s_sCharSetOp) ) { sAdd = s_sCharSetOp; diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx index 37a3ce40ee5c..8fc146324c72 100644 --- a/connectivity/source/drivers/mysql/YTable.cxx +++ b/connectivity/source/drivers/mysql/YTable.cxx @@ -196,7 +196,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref ::dbtools::OPropertyMap& rProp = OMetaConnection::getPropMap(); xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nOldType; descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nNewType; - // and precsions and scale + // and precisions and scale xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION)) >>= nOldPrec; descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION))>>= nNewPrec; xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_SCALE)) >>= nOldScale; @@ -229,7 +229,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref OUString sTypeName; descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName; - static OUString s_sAutoIncrement("auto_increment"); + static const char s_sAutoIncrement[] = "auto_increment"; if ( bAutoIncrement ) { if ( sTypeName.indexOf(s_sAutoIncrement) == -1 ) @@ -308,8 +308,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const OUString& _rColName, OUString OMySQLTable::getTypeCreatePattern() const { - static const OUString s_sCreatePattern("(M,D)"); - return s_sCreatePattern; + return OUString("(M,D)"); } void OMySQLTable::alterDefaultValue(const OUString& _sNewDefault,const OUString& _rColName) diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx index e1773333c623..e1c2fb6e7589 100644 --- a/connectivity/source/drivers/mysql/YTables.cxx +++ b/connectivity/source/drivers/mysql/YTables.cxx @@ -51,9 +51,9 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName) OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); - static const OUString s_sTableTypeView("VIEW"); - static const OUString s_sTableTypeTable("TABLE"); - static const OUString s_sAll("%"); + static const char s_sTableTypeView[] = "VIEW"; + static const char s_sTableTypeTable[] = "TABLE"; + static const char s_sAll[] = "%"; Sequence< OUString > sTableTypes(3); sTableTypes[0] = s_sTableTypeView; @@ -164,15 +164,15 @@ void OTables::dropObject(sal_Int32 _nPos,const OUString& _sElementName) OUString OTables::adjustSQL(const OUString& _sSql) { OUString sSQL = _sSql; - static const OUString s_sUNSIGNED("UNSIGNED"); + static const char s_sUNSIGNED[] = "UNSIGNED"; sal_Int32 nIndex = sSQL.indexOf(s_sUNSIGNED); while(nIndex != -1 ) { sal_Int32 nParen = sSQL.indexOf(')',nIndex); - sal_Int32 nPos = nIndex + s_sUNSIGNED.getLength(); + sal_Int32 nPos = nIndex + strlen(s_sUNSIGNED); OUString sNewUnsigned( sSQL.copy(nPos,nParen - nPos + 1)); - sSQL = sSQL.replaceAt(nIndex,s_sUNSIGNED.getLength()+sNewUnsigned.getLength(),sNewUnsigned + s_sUNSIGNED); - nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + s_sUNSIGNED.getLength()+sNewUnsigned.getLength()); + sSQL = sSQL.replaceAt(nIndex, strlen(s_sUNSIGNED) + sNewUnsigned.getLength(), sNewUnsigned + s_sUNSIGNED); + nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + strlen(s_sUNSIGNED) + sNewUnsigned.getLength()); } return sSQL; } @@ -180,7 +180,7 @@ OUString OTables::adjustSQL(const OUString& _sSql) void OTables::createTable( const Reference< XPropertySet >& descriptor ) { const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection(); - static const OUString s_sCreatePattern("(M,D)"); + static const char s_sCreatePattern[] = "(M,D)"; const OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern)); Reference< XStatement > xStmt = xConnection->createStatement( ); if ( xStmt.is() ) diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx index 2a54977a2824..709e98445c82 100644 --- a/connectivity/source/drivers/mysql/YUser.cxx +++ b/connectivity/source/drivers/mysql/YUser.cxx @@ -119,16 +119,16 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I if ( xRes.is() ) { - static const OUString sSELECT( "SELECT" ); - static const OUString sINSERT( "INSERT" ); - static const OUString sUPDATE( "UPDATE" ); - static const OUString sDELETE( "DELETE" ); - static const OUString sREAD( "READ" ); - static const OUString sCREATE( "CREATE" ); - static const OUString sALTER( "ALTER" ); - static const OUString sREFERENCE( "REFERENCES" ); - static const OUString sDROP( "DROP" ); - static const OUString sYes( "YES" ); + static const char sSELECT [] = "SELECT"; + static const char sINSERT [] = "INSERT"; + static const char sUPDATE [] = "UPDATE"; + static const char sDELETE [] = "DELETE"; + static const char sREAD [] = "READ"; + static const char sCREATE [] = "CREATE"; + static const char sALTER [] = "ALTER"; + static const char sREFERENCE[] = "REFERENCES"; + static const char sDROP [] = "DROP"; + static const char sYes [] = "YES"; nRightsWithGrant = nRights = 0; diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index 9fb7fe05b11c..c020893df624 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -76,14 +76,7 @@ namespace pq_sdbc_driver OUString DriverGetImplementationName() { - static OUString *p; - if (! p ) - { - MutexGuard guard( osl::Mutex::getGlobalMutex() ); - static OUString instance( "org.openoffice.comp.connectivity.pq.Driver.noext" ); - p = &instance; - } - return *p; + return OUString( "org.openoffice.comp.connectivity.pq.Driver.noext" ); } Sequence< OUString > DriverGetSupportedServiceNames() diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 0c8a47a1c2af..1c03e35f3443 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -262,9 +262,9 @@ namespace { OUString sComposedName; - static const OUString s_sTableTypeView("VIEW"); - static const OUString s_sTableTypeTable("TABLE"); - static const OUString s_sWildcard( "%" ); + static const char s_sTableTypeView[] = "VIEW"; + static const char s_sTableTypeTable[] = "TABLE"; + static const char s_sWildcard[] = "%" ; // we want all catalogues, all schemas, all tables Sequence< OUString > sTableTypes(3); |