diff options
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/AutoRetrievingBase.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/commontools/DateConversion.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/commontools/DriversConfig.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/commontools/TTableHelper.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/commontools/conncleanup.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools2.cxx | 30 | ||||
-rw-r--r-- | connectivity/source/commontools/predicateinput.cxx | 8 |
7 files changed, 32 insertions, 48 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; |