summaryrefslogtreecommitdiff
path: root/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/source/runtimemgr/ScriptNameResolverImpl.cxx')
-rw-r--r--scripting/source/runtimemgr/ScriptNameResolverImpl.cxx35
1 files changed, 19 insertions, 16 deletions
diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
index ffb2a52d88..f76b9aff3c 100644
--- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
+++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,10 +54,10 @@ namespace scripting_runtimemgr
{
const sal_Char* const LANGUAGE_TO_RESOLVE_ON[] = { "All" }; // should be configurable
-OUString nrs_implName = OUString::createFromAscii(
- "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" );
-OUString nrs_serviceName = OUString::createFromAscii(
- "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" );
+OUString nrs_implName(RTL_CONSTASCII_USTRINGPARAM(
+ "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ));
+OUString nrs_serviceName(RTL_CONSTASCII_USTRINGPARAM(
+ "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ));
Sequence< OUString > nrs_serviceNames = Sequence< OUString >( &nrs_serviceName, 1 );
const char* const SCRIPTSTORAGEMANAGER_SERVICE =
@@ -172,10 +173,10 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
OSL_TRACE( "ScriptNameResolverImpl::resolve Starting..." );
- OUString docString = OUString::createFromAscii( "location=document" );
- OUString userString = OUString::createFromAscii( "location=user" );
- OUString shareString = OUString::createFromAscii( "location=share" );
- OUString filesysString = OUString::createFromAscii( "location=filesystem" );
+ OUString docString(RTL_CONSTASCII_USTRINGPARAM("location=document"));
+ OUString userString(RTL_CONSTASCII_USTRINGPARAM("location=user"));
+ OUString shareString(RTL_CONSTASCII_USTRINGPARAM("location=share"));
+ OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem"));
// initialise vector with doc, user and share
@@ -221,8 +222,8 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
Reference< XInterface > xInterface = m_xMultiComFac->createInstanceWithContext(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.ucb.SimpleFileAccess" ), m_xContext );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.SimpleFileAccess" )), m_xContext );
validateXRef( xInterface,
"ScriptProvider::initialise: cannot get SimpleFileAccess Service\n" );
Reference < ucb::XSimpleFileAccess > xSimpleFileAccess = Reference <
@@ -269,7 +270,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
// b) an illegal location
// detect illegal location
- if ( scriptURI.indexOf( OUString::createFromAscii( "location=" ) ) != -1 )
+ if ( scriptURI.indexOf( OUString(RTL_CONSTASCII_USTRINGPARAM("location=")) ) != -1 )
{
OSL_TRACE(
"ScriptNameResolver::resolve, throwing IllegalArgException" );
@@ -431,7 +432,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept
try
{
OUString permissionURI = docURI;
- OUString filesysString = OUString::createFromAscii( "location=filesystem" );
+ OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem"));
if ( scriptURI.indexOf( filesysString ) != -1 )
{
// in the case of filesys scripts we're checking whether the
@@ -519,7 +520,7 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
Reference< XInterface > xInterface;
Any a = m_xContext->getValueByName(
- OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) );
if ( sal_False == ( a >>= xInterface ) )
{
throw RuntimeException(
@@ -540,7 +541,7 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
( sid != scriptingConstantsPool.SHARED_STORAGE_ID ) )
{
xScriptSecurity->checkPermission( permissionURI,
- OUString::createFromAscii( "execute" ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("execute")) );
// if we get here, the checkPermission hasn't thrown an
// AccessControlException, ie. permission has been granted
OSL_TRACE( "ScriptNameResolverImpl::getStorageInstance: got execute permission for ID=%d", sid );
@@ -585,7 +586,7 @@ throw( lang::IllegalArgumentException )
{
OUString filePath;
OUString fileName;
- OUString filesysString = OUString::createFromAscii( "location=filesystem" );
+ OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem"));
sal_Int32 locationPos = scriptURI.indexOf( filesysString );
// expect location=filesys:file:///foo/bar/myscript.bsh etc
// except the file url at this point is encoded
@@ -602,7 +603,7 @@ throw( lang::IllegalArgumentException )
endOfLocn - locationPos - filesysStrLen );
}
//file name shoul also be encoded so again ok to search for '&'
- OUString functionKey = OUString::createFromAscii( "function=" );
+ OUString functionKey(RTL_CONSTASCII_USTRINGPARAM("function="));
sal_Int32 functionKeyLength = functionKey.getLength();
sal_Int32 functionNamePos = scriptURI.indexOf( functionKey );
if ( functionNamePos > 0 )
@@ -658,3 +659,5 @@ OUString scriptnri_getImplementationName() SAL_THROW( () )
return nrs_implName;
}
} // namespace scripting_runtimemgr
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */