summaryrefslogtreecommitdiff
path: root/scripting/source
diff options
context:
space:
mode:
authorJean-Noël Rouvignac <jn.rouvignac@gmail.com>2013-01-30 11:44:23 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-01-30 12:54:40 +0000
commit97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch)
treea1a95b8249052d846a997ad1729758168d6a3b24 /scripting/source
parentf8569cd9a28a3a8856dba4ad53218aa6cc073521 (diff)
Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING
Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd Reviewed-on: https://gerrit.libreoffice.org/1924 Tested-by: Luboš Luňák <l.lunak@suse.cz> Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'scripting/source')
-rw-r--r--scripting/source/basprov/basprov.cxx6
-rw-r--r--scripting/source/inc/util/MiscUtils.hxx4
-rw-r--r--scripting/source/inc/util/util.hxx2
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx6
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx4
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx78
-rw-r--r--scripting/source/provider/ProviderCache.cxx6
-rw-r--r--scripting/source/provider/ScriptImpl.cxx10
8 files changed, 57 insertions, 59 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 750394524161..30743ec0fb7a 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -258,7 +258,7 @@ namespace basprov
);
}
- ::rtl::OUString sDoc = OUSTR("vnd.sun.star.tdoc");
+ ::rtl::OUString sDoc = "vnd.sun.star.tdoc";
if ( m_sScriptingContext.indexOf( sDoc ) == 0 )
{
xModel = MiscUtils::tDocUrlToModel( m_sScriptingContext );
@@ -330,7 +330,7 @@ namespace basprov
errorMsg = errorMsg.concat( scriptURI );
throw provider::ScriptFrameworkErrorException(
errorMsg, Reference< XInterface >(),
- scriptURI, OUSTR("Basic"),
+ scriptURI, "Basic",
provider::ScriptFrameworkErrorType::MALFORMED_URL );
}
@@ -422,7 +422,7 @@ namespace basprov
throw provider::ScriptFrameworkErrorException(
aMessage.makeStringAndClear(),
Reference< XInterface >(),
- scriptURI, OUSTR("Basic"),
+ scriptURI, "Basic",
provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT );
}
diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx
index 657355c9aaf5..e78071c18eee 100644
--- a/scripting/source/inc/util/MiscUtils.hxx
+++ b/scripting/source/inc/util/MiscUtils.hxx
@@ -55,7 +55,7 @@ public:
return result;
}
css::uno::Reference < css::ucb::XSimpleFileAccess3 > xSFA( css::ucb::SimpleFileAccess::create(xCtx) );
- result = xSFA->getFolderContents( OUSTR("vnd.sun.star.tdoc:/"), true );
+ result = xSFA->getFolderContents( "vnd.sun.star.tdoc:/", true );
}
catch ( css::uno::Exception& )
{
@@ -111,7 +111,7 @@ public:
try
{
::ucbhelper::Content root( url, NULL, comphelper::getProcessComponentContext() );
- ::rtl::OUString propName = OUSTR("DocumentModel");
+ ::rtl::OUString propName = "DocumentModel";
result = getUCBProperty( root, propName );
}
catch ( css::ucb::ContentCreationException& )
diff --git a/scripting/source/inc/util/util.hxx b/scripting/source/inc/util/util.hxx
index a6afecca8b02..5dd38b86c85c 100644
--- a/scripting/source/inc/util/util.hxx
+++ b/scripting/source/inc/util/util.hxx
@@ -21,8 +21,6 @@
#ifndef _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
#define _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
-#define OUSTR(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x) )
-
#endif //_COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 36ca322e932e..91565ac23975 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -84,7 +84,7 @@ void SAL_CALL ScriptProtocolHandler::initialize(
if ( aArguments.getLength() &&
sal_False == ( aArguments[ 0 ] >>= m_xFrame ) )
{
- ::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::initialize: could not extract reference to the frame" );
+ ::rtl::OUString temp = "ScriptProtocolHandler::initialize: could not extract reference to the frame";
throw RuntimeException( temp, Reference< XInterface >() );
}
@@ -396,12 +396,12 @@ void ScriptProtocolHandler::createScriptProvider()
}
catch ( const RuntimeException & e )
{
- ::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider(), " );
+ ::rtl::OUString temp = "ScriptProtocolHandler::createScriptProvider(), ";
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
catch ( const Exception & e )
{
- ::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider: " );
+ ::rtl::OUString temp = "ScriptProtocolHandler::createScriptProvider: ";
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
}
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 978a44c64138..5b3191625d4f 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -312,7 +312,7 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference<
{
xFac.set(
xCtx->getValueByName(
- OUSTR("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory") ), UNO_QUERY_THROW );
+ "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString("user") ) ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString("share") ) ), UNO_QUERY_THROW );
@@ -687,7 +687,7 @@ BrowseNodeFactoryImpl::createView( sal_Int16 viewType )
case browse::BrowseNodeFactoryViewTypes::MACROORGANIZER:
return getOrganizerHierarchy();
default:
- throw RuntimeException( OUSTR("Unknown view type" ), Reference< XInterface >() );
+ throw RuntimeException( "Unknown view type", Reference< XInterface >() );
}
}
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 4362330c7b6b..ff7a13844e31 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -116,7 +116,7 @@ throw ( Exception, RuntimeException )
if ( len > 1 )
{
throw RuntimeException(
- OUSTR( "MasterScriptProvider::initialize: invalid number of arguments" ),
+ "MasterScriptProvider::initialize: invalid number of arguments",
Reference< XInterface >() );
}
@@ -185,7 +185,7 @@ throw ( Exception, RuntimeException )
invokeArgs[ 0 ] <<= m_sCtxString;
}
- ::rtl::OUString pkgSpec = OUSTR("uno_packages");
+ ::rtl::OUString pkgSpec = "uno_packages";
sal_Int32 indexOfPkgSpec = m_sCtxString.lastIndexOf( pkgSpec );
// if contex string ends with "uno_packages"
@@ -221,12 +221,12 @@ void MasterScriptProvider::createPkgProvider()
try
{
Any location;
- ::rtl::OUString sPkgCtx = m_sCtxString.concat( OUSTR(":uno_packages") );
+ ::rtl::OUString sPkgCtx = m_sCtxString.concat( ":uno_packages" );
location <<= sPkgCtx;
Reference< provider::XScriptProviderFactory > xFac(
m_xContext->getValueByName(
- OUSTR( "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory") ), UNO_QUERY_THROW );
+ "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
m_xMSPPkg.set(
xFac->createScriptProvider( location ), UNO_QUERY_THROW );
@@ -252,8 +252,8 @@ throw ( provider::ScriptFrameworkErrorException,
if ( !isValid() )
{
throw provider::ScriptFrameworkErrorException(
- OUSTR( "MasterScriptProvider not initialised" ), Reference< XInterface >(),
- scriptURI, OUSTR(""),
+ "MasterScriptProvider not initialised", Reference< XInterface >(),
+ scriptURI, "",
provider::ScriptFrameworkErrorType::UNKNOWN );
}
@@ -268,11 +268,11 @@ throw ( provider::ScriptFrameworkErrorException,
if ( !uriRef.is() || !sfUri.is() )
{
- ::rtl::OUString errorMsg = OUSTR( "Incorrect format for Script URI: " );
+ ::rtl::OUString errorMsg = "Incorrect format for Script URI: ";
errorMsg = errorMsg.concat( scriptURI );
throw provider::ScriptFrameworkErrorException(
errorMsg, Reference< XInterface >(),
- scriptURI, OUSTR(""),
+ scriptURI, "",
provider::ScriptFrameworkErrorType::UNKNOWN );
}
@@ -283,11 +283,11 @@ throw ( provider::ScriptFrameworkErrorException,
sfUri->hasParameter( locKey ) == sal_False ||
( sfUri->getName().isEmpty() ) )
{
- ::rtl::OUString errorMsg = OUSTR( "Incorrect format for Script URI: " );
+ ::rtl::OUString errorMsg = "Incorrect format for Script URI: ";
errorMsg = errorMsg.concat( scriptURI );
throw provider::ScriptFrameworkErrorException(
errorMsg, Reference< XInterface >(),
- scriptURI, OUSTR(""),
+ scriptURI, "",
provider::ScriptFrameworkErrorType::UNKNOWN );
}
@@ -322,11 +322,11 @@ throw ( provider::ScriptFrameworkErrorException,
// ** Special case is BASIC, all calls to getScript will be handled
// by the language script provider in the current location context
// even if its different
- if ( ( location.equals( OUSTR( "document" ) )
+ if ( ( location.equals( "document" )
&& m_xModel.is()
)
|| ( endsWith( m_sCtxString, location ) )
- || ( language.equals( OUSTR( "Basic" ) ) )
+ || ( language.equals( "Basic" ) )
)
{
Reference< provider::XScriptProvider > xScriptProvider;
@@ -353,7 +353,7 @@ throw ( provider::ScriptFrameworkErrorException,
else
{
throw provider::ScriptFrameworkErrorException(
- OUSTR( "No LanguageProviders detected" ),
+ "No LanguageProviders detected",
Reference< XInterface >(),
sfUri->getName(), language,
provider::ScriptFrameworkErrorType::NOTSUPPORTED );
@@ -364,7 +364,7 @@ throw ( provider::ScriptFrameworkErrorException,
{
Reference< provider::XScriptProviderFactory > xFac_(
m_xContext->getValueByName(
- OUSTR( "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory") ), UNO_QUERY_THROW );
+ "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory" ), UNO_QUERY_THROW );
Reference< provider::XScriptProvider > xSP(
xFac_->createScriptProvider( makeAny( location ) ), UNO_QUERY_THROW );
@@ -389,7 +389,7 @@ MasterScriptProvider::providerCache()
::osl::MutexGuard aGuard( m_mutex );
if ( !m_pPCache )
{
- ::rtl::OUString serviceName1 = OUSTR("com.sun.star.script.provider.ScriptProviderForBasic");
+ ::rtl::OUString serviceName1 = "com.sun.star.script.provider.ScriptProviderForBasic";
Sequence< ::rtl::OUString > blacklist(1);
blacklist[ 0 ] = serviceName1;
@@ -415,7 +415,7 @@ MasterScriptProvider::getName()
if ( !isPkgProvider() )
{
::rtl::OUString sCtx = getContextString();
- if ( sCtx.indexOf( OUSTR( "vnd.sun.star.tdoc" ) ) == 0 )
+ if ( sCtx.indexOf( "vnd.sun.star.tdoc" ) == 0 )
{
Reference< frame::XModel > xModel = m_xModel;
if ( !xModel.is() )
@@ -432,7 +432,7 @@ MasterScriptProvider::getName()
}
else
{
- m_sNodeName = OUSTR("uno_packages");
+ m_sNodeName = "uno_packages";
}
return m_sNodeName;
}
@@ -510,14 +510,14 @@ MasterScriptProvider::insertByName( const ::rtl::OUString& aName, const Any& aEl
if ( !xCont.is() )
{
throw RuntimeException(
- OUSTR("PackageMasterScriptProvider doesn't implement XNameContainer"),
+ "PackageMasterScriptProvider doesn't implement XNameContainer",
Reference< XInterface >() );
}
xCont->insertByName( aName, aElement );
}
else
{
- throw RuntimeException( OUSTR("PackageMasterScriptProvider is unitialised"),
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised",
Reference< XInterface >() );
}
@@ -527,12 +527,12 @@ MasterScriptProvider::insertByName( const ::rtl::OUString& aName, const Any& aEl
Reference< deployment::XPackage > xPkg( aElement, UNO_QUERY );
if ( !xPkg.is() )
{
- throw lang::IllegalArgumentException( OUSTR("Couldn't convert to XPackage"),
+ throw lang::IllegalArgumentException( "Couldn't convert to XPackage",
Reference < XInterface > (), 2 );
}
if ( aName.isEmpty() )
{
- throw lang::IllegalArgumentException( OUSTR("Name not set!!"),
+ throw lang::IllegalArgumentException( "Name not set!!",
Reference < XInterface > (), 1 );
}
// TODO for library pacakge parse the language, for the moment will try
@@ -541,8 +541,8 @@ MasterScriptProvider::insertByName( const ::rtl::OUString& aName, const Any& aEl
if ( !providerCache() )
{
throw RuntimeException(
- OUSTR("insertByName cannot instantiate "
- "child script providers."),
+ "insertByName cannot instantiate "
+ "child script providers.",
Reference< XInterface >() );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
@@ -569,7 +569,7 @@ MasterScriptProvider::insertByName( const ::rtl::OUString& aName, const Any& aEl
if ( index == xSProviders.getLength() )
{
// No script providers could process the package
- ::rtl::OUString message = OUSTR("Failed to register package for ");
+ ::rtl::OUString message = "Failed to register package for ";
message = message.concat( aName );
throw lang::IllegalArgumentException( message,
Reference < XInterface > (), 2 );
@@ -590,14 +590,14 @@ MasterScriptProvider::removeByName( const ::rtl::OUString& Name ) throw ( contai
if ( !xCont.is() )
{
throw RuntimeException(
- OUSTR("PackageMasterScriptProvider doesn't implement XNameContainer"),
+ "PackageMasterScriptProvider doesn't implement XNameContainer",
Reference< XInterface >() );
}
xCont->removeByName( Name );
}
else
{
- throw RuntimeException( OUSTR("PackageMasterScriptProvider is unitialised"),
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised",
Reference< XInterface >() );
}
@@ -606,7 +606,7 @@ MasterScriptProvider::removeByName( const ::rtl::OUString& Name ) throw ( contai
{
if ( Name.isEmpty() )
{
- throw lang::IllegalArgumentException( OUSTR("Name not set!!"),
+ throw lang::IllegalArgumentException( "Name not set!!",
Reference < XInterface > (), 1 );
}
// TODO for Script library pacakge url parse the language,
@@ -616,8 +616,8 @@ MasterScriptProvider::removeByName( const ::rtl::OUString& Name ) throw ( contai
if ( !providerCache() )
{
throw RuntimeException(
- OUSTR("removeByName() cannot instantiate "
- "child script providers."),
+ "removeByName() cannot instantiate "
+ "child script providers.",
Reference< XInterface >() );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
@@ -643,7 +643,7 @@ MasterScriptProvider::removeByName( const ::rtl::OUString& Name ) throw ( contai
if ( index == xSProviders.getLength() )
{
// No script providers could process the package
- ::rtl::OUString message = OUSTR("Failed to revoke package for ");
+ ::rtl::OUString message = "Failed to revoke package for ";
message = message.concat( Name );
throw lang::IllegalArgumentException( message,
Reference < XInterface > (), 1 );
@@ -662,7 +662,7 @@ MasterScriptProvider::replaceByName( const ::rtl::OUString& aName, const Any& aE
// TODO needs implementing
if ( true )
{
- throw RuntimeException( OUSTR("replaceByName not implemented!!!!") ,
+ throw RuntimeException( "replaceByName not implemented!!!!" ,
Reference< XInterface >() );
}
}
@@ -676,7 +676,7 @@ MasterScriptProvider::getByName( const ::rtl::OUString& aName ) throw ( containe
Any result;
if ( true )
{
- throw RuntimeException( OUSTR("getByName not implemented!!!!") ,
+ throw RuntimeException( "getByName not implemented!!!!" ,
Reference< XInterface >() );
}
return result;
@@ -694,7 +694,7 @@ MasterScriptProvider::hasByName( const ::rtl::OUString& aName ) throw (RuntimeEx
if ( !xCont.is() )
{
throw RuntimeException(
- OUSTR("PackageMasterScriptProvider doesn't implement XNameContainer"),
+ "PackageMasterScriptProvider doesn't implement XNameContainer",
Reference< XInterface >() );
}
@@ -702,7 +702,7 @@ MasterScriptProvider::hasByName( const ::rtl::OUString& aName ) throw (RuntimeEx
}
else
{
- throw RuntimeException( OUSTR("PackageMasterScriptProvider is unitialised"),
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised",
Reference< XInterface >() );
}
@@ -711,7 +711,7 @@ MasterScriptProvider::hasByName( const ::rtl::OUString& aName ) throw (RuntimeEx
{
if ( aName.isEmpty() )
{
- throw lang::IllegalArgumentException( OUSTR("Name not set!!"),
+ throw lang::IllegalArgumentException( "Name not set!!",
Reference < XInterface > (), 1 );
}
// TODO for Script library pacakge url parse the language,
@@ -722,8 +722,8 @@ MasterScriptProvider::hasByName( const ::rtl::OUString& aName ) throw (RuntimeEx
if ( !providerCache() )
{
throw RuntimeException(
- OUSTR("removeByName() cannot instantiate "
- "child script providers."),
+ "removeByName() cannot instantiate "
+ "child script providers.",
Reference< XInterface >() );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
@@ -760,7 +760,7 @@ MasterScriptProvider::getElementNames( ) throw ( RuntimeException)
Sequence< ::rtl::OUString > names;
if ( true )
{
- throw RuntimeException( OUSTR("getElementNames not implemented!!!!") ,
+ throw RuntimeException( "getElementNames not implemented!!!!" ,
Reference< XInterface >() );
}
return names;
@@ -779,7 +779,7 @@ sal_Bool SAL_CALL MasterScriptProvider::hasElements( ) throw ( RuntimeException
// TODO needs implementing
if ( true )
{
- throw RuntimeException( OUSTR("hasElements not implemented!!!!") ,
+ throw RuntimeException( "hasElements not implemented!!!!" ,
Reference< XInterface >() );
}
return false;
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 09e760e0e9bd..510597adeaf5 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -174,9 +174,9 @@ ProviderCache::populateCache() throw ( RuntimeException )
}
catch ( const Exception &e )
{
- ::rtl::OUString temp = OUSTR(
- "ProviderCache::populateCache: couldn't obtain XSingleComponentFactory for " );
- temp = temp.concat( serviceName );
+ OUString temp =
+ "ProviderCache::populateCache: couldn't obtain XSingleComponentFactory for "
+ + serviceName;
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
}
diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx
index b6cd9c15b038..d1c70c5e914d 100644
--- a/scripting/source/provider/ScriptImpl.cxx
+++ b/scripting/source/provider/ScriptImpl.cxx
@@ -68,14 +68,14 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException,
}
catch ( const lang::IllegalArgumentException & iae )
{
- ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke IllegalArgumentException : " );
+ ::rtl::OUString temp = "ScriptImpl::invoke IllegalArgumentException : ";
throw lang::IllegalArgumentException( temp.concat( iae.Message ),
Reference< XInterface > (),
iae.ArgumentPosition );
}
catch ( const script::CannotConvertException & cce )
{
- ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke CannotConvertException : " );
+ ::rtl::OUString temp = "ScriptImpl::invoke CannotConvertException : ";
throw script::CannotConvertException( temp.concat( cce.Message ),
Reference< XInterface > (),
cce.DestinationTypeClass,
@@ -84,14 +84,14 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException,
}
catch ( const reflection::InvocationTargetException & ite )
{
- ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke InvocationTargetException : " );
+ ::rtl::OUString temp = "ScriptImpl::invoke InvocationTargetException : ";
throw reflection::InvocationTargetException( temp.concat( ite.Message ),
Reference< XInterface > (),
ite.TargetException );
}
catch ( const RuntimeException & re )
{
- ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke RuntimeException : " );
+ ::rtl::OUString temp = "ScriptImpl::invoke RuntimeException : ";
throw RuntimeException( temp.concat( re.Message ),
Reference< XInterface > () );
}
@@ -99,7 +99,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException,
catch ( ... )
{
throw RuntimeException(
- OUSTR( "ScriptImpl::invoke Unknown Exception caught - RuntimeException rethrown" ),
+ "ScriptImpl::invoke Unknown Exception caught - RuntimeException rethrown",
Reference< XInterface > () );
}
#endif