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 /dbaccess/source/ext | |
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 'dbaccess/source/ext')
-rw-r--r-- | dbaccess/source/ext/macromigration/migrationengine.cxx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index 5dea02bb9f7b..91d17b2adfd4 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -168,32 +168,22 @@ namespace dbmm namespace { - static const OUString& lcl_getScriptsStorageName() - { - static const OUString s_sScriptsStorageName( "Scripts" ); - return s_sScriptsStorageName; - } + static const char sScriptsStorageName[] = "Scripts"; - static const OUString& lcl_getScriptsSubStorageName( const ScriptType _eType ) + static OUString lcl_getScriptsSubStorageName( const ScriptType _eType ) { - static const OUString s_sBeanShell ( "beanshell" ); - static const OUString s_sJavaScript( "javascript" ); - static const OUString s_sPython ( "python" ); // TODO: is this correct? - static const OUString s_sJava ( "java" ); - switch ( _eType ) { - case eBeanShell: return s_sBeanShell; - case eJavaScript: return s_sJavaScript; - case ePython: return s_sPython; - case eJava: return s_sJava; + case eBeanShell: return OUString("beanshell"); + case eJavaScript: return OUString("javascript"); + case ePython: return OUString("python"); // TODO: is this correct? + case eJava: return OUString("java"); default: break; } OSL_FAIL( "lcl_getScriptsSubStorageName: illegal type!" ); - static OUString s_sEmpty; - return s_sEmpty; + return OUString(); } static bool lcl_getScriptTypeFromLanguage( const OUString& _rLanguage, ScriptType& _out_rScriptType ) @@ -650,15 +640,15 @@ namespace dbmm // the "Scripts" storage exist, or if it does not (yet) exist and we are in write mode // => open the storage - if ( ( xDocStorage->hasByName( lcl_getScriptsStorageName() ) - && xDocStorage->isStorageElement( lcl_getScriptsStorageName() ) + if ( ( xDocStorage->hasByName( sScriptsStorageName ) + && xDocStorage->isStorageElement( sScriptsStorageName ) ) - || !xDocStorage->hasByName( lcl_getScriptsStorageName() ) + || !xDocStorage->hasByName( sScriptsStorageName ) ) { m_xScriptsStorage.set( xDocStorage->openStorageElement( - lcl_getScriptsStorageName(), ElementModes::READWRITE + sScriptsStorageName, ElementModes::READWRITE ), UNO_QUERY_THROW ); @@ -725,7 +715,7 @@ namespace dbmm { Reference< XStorageBasedDocument > xStorageDoc( _rxDocument, UNO_QUERY_THROW ); Reference< XStorage > xDocStorage( xStorageDoc->getDocumentStorage(), UNO_QUERY_THROW ); - xDocStorage->removeElement( lcl_getScriptsStorageName() ); + xDocStorage->removeElement( sScriptsStorageName ); } catch( const Exception& ) { |