summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-03 14:03:54 +0200
committerNoel Grandin <noel@peralex.com>2014-11-05 08:44:19 +0200
commit705c48d32eec0aa5180e60ca157daca4b154e4a3 (patch)
tree97f43496f4b429a2b8d03b1e71cb2a1c33142a15 /scripting
parentb7d8a58ff2698ffc6e22943f64aa97c5ea253bd9 (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 'scripting')
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx4
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx37
-rw-r--r--scripting/source/stringresource/stringresource.cxx8
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx28
4 files changed, 19 insertions, 58 deletions
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index cc7bd099874e..30ac109cf683 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -546,9 +546,9 @@ namespace dlgprov
void DialogUnoScriptListenerImpl::firing_impl( const ScriptEvent& aScriptEvent, Any* pRet )
{
- static OUString sUnoURLScheme("vnd.sun.star.UNO:");
+ static const char sUnoURLScheme[] = "vnd.sun.star.UNO:";
- OUString aMethodName = aScriptEvent.ScriptCode.copy( sUnoURLScheme.getLength() );
+ OUString aMethodName = aScriptEvent.ScriptCode.copy( strlen(sUnoURLScheme) );
const Any* pArguments = aScriptEvent.Arguments.getConstArray();
Any aEventObject = pArguments[0];
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index cc821c675e47..38294297cc75 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -88,7 +88,7 @@ namespace dlgprov
{
-static OUString aResourceResolverPropName("ResourceResolver");
+static const char aResourceResolverPropName[] = "ResourceResolver";
Reference< resource::XStringResourceManager > lcl_getStringResourceManager(const Reference< XComponentContext >& i_xContext,const OUString& i_sURL)
{
@@ -166,37 +166,18 @@ static OUString aResourceResolverPropName("ResourceResolver");
static OUString getImplementationName_DialogProviderImpl()
{
- static OUString* pImplName = 0;
- if ( !pImplName )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pImplName )
- {
- static OUString aImplName( "com.sun.star.comp.scripting.DialogProvider" );
- pImplName = &aImplName;
- }
- }
- return *pImplName;
+ return OUString( "com.sun.star.comp.scripting.DialogProvider" );
}
static Sequence< OUString > getSupportedServiceNames_DialogProviderImpl()
{
- static Sequence< OUString >* pNames = 0;
- if ( !pNames )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pNames )
- {
- static Sequence< OUString > aNames(3);
- aNames[0] = "com.sun.star.awt.DialogProvider";
- aNames[1] = "com.sun.star.awt.DialogProvider2";
- aNames[2] = "com.sun.star.awt.ContainerWindowProvider";
- pNames = &aNames;
- }
- }
- return *pNames;
+ Sequence< OUString > aNames(3);
+ aNames[0] = "com.sun.star.awt.DialogProvider";
+ aNames[1] = "com.sun.star.awt.DialogProvider2";
+ aNames[2] = "com.sun.star.awt.ContainerWindowProvider";
+ return aNames;
}
@@ -645,8 +626,8 @@ static OUString aResourceResolverPropName("ResourceResolver");
// XDialogProvider
- static OUString aDecorationPropName("Decoration");
- static OUString aTitlePropName("Title");
+ static const char aDecorationPropName[] = "Decoration";
+ static const char aTitlePropName[] = "Title";
Reference < XControl > DialogProviderImpl::createDialogImpl(
const OUString& URL, const Reference< XInterface >& xHandler,
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 0e3bfce52416..cde4e730a24d 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -798,7 +798,7 @@ Sequence< OUString > StringResourcePersistenceImpl::getSupportedServiceNames( )
// XInitialization base functionality for derived classes
-static OUString aNameBaseDefaultStr("strings");
+static const char aNameBaseDefaultStr[] = "strings";
void StringResourcePersistenceImpl::implInitializeCommonParameters
( const Sequence< Any >& aArguments )
@@ -1809,7 +1809,7 @@ OUString implGetNameScemeForLocaleItem( const LocaleItem* pLocaleItem )
* also appends Variant, which can't be blindly changed as it would
* violate the naming scheme in use. */
- static OUString aUnder("_");
+ static const char aUnder[] = "_";
OSL_ENSURE( pLocaleItem,
"StringResourcePersistenceImpl::implGetNameScemeForLocaleItem(): pLocaleItem == NULL" );
@@ -2183,8 +2183,8 @@ void implWriteStringWithEncoding( const OUString& aStr,
bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocaleItem,
const Reference< io::XOutputStream >& xOutputStream, const OUString& aComment )
{
- static OUString aAssignmentStr("=");
- static OUString aLineFeedStr("\n");
+ static const char aAssignmentStr[] = "=";
+ static const char aLineFeedStr[] = "\n";
if( !xOutputStream.is() || pLocaleItem == NULL )
return false;
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index c5fe35169a6f..d0b97dbf0330 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -95,8 +95,8 @@ using namespace ::com::sun::star::uno;
using namespace ::ooo::vba;
// Some constants
-const static OUString DELIM("::");
-const static sal_Int32 DELIMLEN = DELIM.getLength();
+static const char DELIM[] = "::";
+static const sal_Int32 DELIMLEN = strlen(DELIM);
bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params )
{
@@ -1058,17 +1058,7 @@ namespace evtlstner
{
OUString SAL_CALL getImplementationName()
{
- static OUString* pImplName = 0;
- if ( !pImplName )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pImplName )
- {
- static OUString aImplName( "ooo.vba.EventListener" );
- pImplName = &aImplName;
- }
- }
- return *pImplName;
+ return OUString( "ooo.vba.EventListener" );
}
uno::Reference< XInterface > SAL_CALL create(
@@ -1087,17 +1077,7 @@ namespace ooevtdescgen
{
OUString SAL_CALL getImplementationName()
{
- static OUString* pImplName = 0;
- if ( !pImplName )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pImplName )
- {
- static OUString aImplName( "ooo.vba.VBAToOOEventDesc" );
- pImplName = &aImplName;
- }
- }
- return *pImplName;
+ return OUString( "ooo.vba.VBAToOOEventDesc" );
}
uno::Reference< XInterface > SAL_CALL create(