summaryrefslogtreecommitdiff
path: root/cppuhelper
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 /cppuhelper
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 'cppuhelper')
-rw-r--r--cppuhelper/source/access_control.cxx10
-rw-r--r--cppuhelper/source/bootstrap.cxx43
-rw-r--r--cppuhelper/source/component_context.cxx21
-rw-r--r--cppuhelper/source/exc_thrower.cxx22
-rw-r--r--cppuhelper/source/factory.cxx8
-rw-r--r--cppuhelper/source/macro_expander.cxx7
-rw-r--r--cppuhelper/source/shlib.cxx60
-rw-r--r--cppuhelper/test/cfg_test.cxx32
8 files changed, 95 insertions, 108 deletions
diff --git a/cppuhelper/source/access_control.cxx b/cppuhelper/source/access_control.cxx
index 8a08ccbb0124..5c39d73c99d7 100644
--- a/cppuhelper/source/access_control.cxx
+++ b/cppuhelper/source/access_control.cxx
@@ -25,8 +25,6 @@
#include <com/sun/star/io/FilePermission.hpp>
#include <com/sun/star/connection/SocketPermission.hpp>
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
using namespace ::rtl;
using namespace ::osl;
@@ -37,7 +35,7 @@ namespace
{
inline OUString str_ac_singleton()
{
- return OUSTR("/singletons/com.sun.star.security.theAccessController");
+ return OUString("/singletons/com.sun.star.security.theAccessController");
}
}
@@ -50,7 +48,7 @@ AccessControl::AccessControl( Reference< XComponentContext > const & xContext )
if (! (xContext->getValueByName( str_ac_singleton() ) >>= m_xController))
{
throw SecurityException(
- OUSTR("no access controller!"), Reference< XInterface >() );
+ "no access controller!", Reference< XInterface >() );
}
}
//__________________________________________________________________________________________________
@@ -62,7 +60,7 @@ AccessControl::AccessControl(
if (! m_xController.is())
{
throw SecurityException(
- OUSTR("no access controller!"), Reference< XInterface >() );
+ "no access controller!", Reference< XInterface >() );
}
}
//__________________________________________________________________________________________________
@@ -73,7 +71,7 @@ AccessControl::AccessControl( AccessControl const & ac )
if (! m_xController.is())
{
throw SecurityException(
- OUSTR("no access controller!"), Reference< XInterface >() );
+ "no access controller!", Reference< XInterface >() );
}
}
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 802fe1142d19..b984de0b82fa 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -42,7 +42,6 @@
#include "macro_expander.hxx"
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
#define ARLEN(x) sizeof (x) / sizeof *(x)
@@ -92,7 +91,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
char const * p1 = cppuhelper_detail_findSofficePath();
if (p1 == NULL) {
throw BootstrapException(
- OUSTR("no soffice installation found!"));
+ "no soffice installation found!");
}
rtl::OUString p2;
if (!rtl_convertStringToUString(
@@ -102,40 +101,40 @@ Reference< XComponentContext > SAL_CALL bootstrap()
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
{
throw BootstrapException(
- OUSTR("bad characters in soffice installation path!"));
+ "bad characters in soffice installation path!");
}
OUString path;
if (osl::FileBase::getFileURLFromSystemPath(p2, path) !=
osl::FileBase::E_None)
{
throw BootstrapException(
- OUSTR("cannot convert soffice installation path to URL!"));
+ "cannot convert soffice installation path to URL!");
}
if (!path.isEmpty() && path[path.getLength() - 1] != '/') {
- path += OUSTR("/");
+ path += "/";
}
OUString uri;
- if (!Bootstrap::get(OUSTR("URE_BOOTSTRAP"), uri)) {
+ if (!Bootstrap::get("URE_BOOTSTRAP", uri)) {
Bootstrap::set(
- OUSTR("URE_BOOTSTRAP"),
- Bootstrap::encode(path + OUSTR(SAL_CONFIGFILE("fundamental"))));
+ "URE_BOOTSTRAP",
+ Bootstrap::encode(path + SAL_CONFIGFILE("fundamental")));
}
// create default local component context
Reference< XComponentContext > xLocalContext(
defaultBootstrap_InitialComponentContext() );
if ( !xLocalContext.is() )
- throw BootstrapException( OUSTR( "no local component context!" ) );
+ throw BootstrapException( "no local component context!" );
// create a random pipe name
rtlRandomPool hPool = rtl_random_createPool();
if ( hPool == 0 )
- throw BootstrapException( OUSTR( "cannot create random pool!" ) );
+ throw BootstrapException( "cannot create random pool!" );
sal_uInt8 bytes[ 16 ];
if ( rtl_random_getBytes( hPool, bytes, ARLEN( bytes ) )
!= rtl_Random_E_None )
- throw BootstrapException( OUSTR( "random pool error!" ) );
+ throw BootstrapException( "random pool error!" );
rtl_random_destroyPool( hPool );
::rtl::OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno" ) );
@@ -151,11 +150,11 @@ Reference< XComponentContext > SAL_CALL bootstrap()
// arguments
OUString args [] = {
- OUSTR( "--nologo" ),
- OUSTR( "--nodefault" ),
- OUSTR( "--norestore" ),
- OUSTR( "--nocrashreport" ),
- OUSTR( "--nolockcheck" ),
+ OUString("--nologo"),
+ OUString("--nodefault"),
+ OUString("--norestore"),
+ OUString("--nocrashreport"),
+ OUString("--nolockcheck"),
buf.makeStringAndClear()
};
rtl_uString * ar_args [] = {
@@ -183,16 +182,16 @@ Reference< XComponentContext > SAL_CALL bootstrap()
osl_freeProcessHandle( hProcess );
break;
case osl_Process_E_NotFound:
- throw BootstrapException( OUSTR( "image not found!" ) );
+ throw BootstrapException( "image not found!" );
case osl_Process_E_TimedOut:
- throw BootstrapException( OUSTR( "timout occurred!" ) );
+ throw BootstrapException( "timout occurred!" );
case osl_Process_E_NoPermission:
- throw BootstrapException( OUSTR( "permission denied!" ) );
+ throw BootstrapException( "permission denied!" );
case osl_Process_E_Unknown:
- throw BootstrapException( OUSTR( "unknown error!" ) );
+ throw BootstrapException( "unknown error!" );
case osl_Process_E_InvalidError:
default:
- throw BootstrapException( OUSTR( "unmapped error!" ) );
+ throw BootstrapException( "unmapped error!" );
}
// create a URL resolver
@@ -228,7 +227,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
catch ( Exception & e )
{
throw BootstrapException(
- OUSTR( "unexpected UNO exception caught: " ) + e.Message );
+ "unexpected UNO exception caught: " + e.Message );
}
return xRemoteContext;
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 18e150c528ca..b95d50e1f304 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -59,7 +59,6 @@
#define SMGR_SINGLETON "/singletons/com.sun.star.lang.theServiceManager"
#define TDMGR_SINGLETON "/singletons/com.sun.star.reflection.theTypeDescriptionManager"
#define AC_SINGLETON "/singletons/com.sun.star.security.theAccessController"
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
using namespace ::osl;
@@ -76,7 +75,7 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
{
OSL_ASSERT( pVal );
if (pTypeRef->eTypeClass == typelib_TypeClass_VOID)
- return OUSTR("void");
+ return "void";
OUStringBuffer buf( 64 );
buf.append( (sal_Unicode)'(' );
@@ -420,7 +419,7 @@ void ComponentContext::insertByName(
t_map::value_type( name, entry ) ) );
if (! insertion.second)
throw container::ElementExistException(
- OUSTR("element already exists: ") + name,
+ "element already exists: " + name,
static_cast<OWeakObject *>(this) );
}
@@ -433,7 +432,7 @@ void ComponentContext::removeByName( OUString const & name )
t_map::iterator iFind( m_map.find( name ) );
if (iFind == m_map.end())
throw container::NoSuchElementException(
- OUSTR("no such element: ") + name,
+ "no such element: " + name,
static_cast<OWeakObject *>(this) );
delete iFind->second;
@@ -451,7 +450,7 @@ void ComponentContext::replaceByName(
t_map::const_iterator const iFind( m_map.find( name ) );
if (iFind == m_map.end())
throw container::NoSuchElementException(
- OUSTR("no such element: ") + name,
+ "no such element: " + name,
static_cast<OWeakObject *>(this) );
if (name.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("/singletons/") ) &&
!element.hasValue())
@@ -551,8 +550,8 @@ Any ComponentContext::lookupMap( OUString const & rName )
try
{
- Any usesService( getValueByName( rName + OUSTR("/service") ) );
- Any args_( getValueByName( rName + OUSTR("/arguments") ) );
+ Any usesService( getValueByName( rName + "/service" ) );
+ Any args_( getValueByName( rName + "/arguments" ) );
Sequence<Any> args;
if (args_.hasValue() && !(args_ >>= args))
{
@@ -617,7 +616,7 @@ Any ComponentContext::lookupMap( OUString const & rName )
if (! xInstance.is())
{
throw RuntimeException(
- OUSTR("no service object raising singleton ") + rName,
+ "no service object raising singleton " + rName,
static_cast<OWeakObject *>(this) );
}
@@ -773,7 +772,7 @@ ComponentContext::ComponentContext(
// singleton entry
m_map[ rEntry.name ] = new ContextEntry( Any(), true );
// /service
- m_map[ rEntry.name + OUSTR("/service") ] = new ContextEntry( rEntry.value, false );
+ m_map[ rEntry.name + "/service" ] = new ContextEntry( rEntry.value, false );
// /initial-arguments are provided as optional context entry
}
else
@@ -795,7 +794,7 @@ ComponentContext::ComponentContext(
// create new smgr based on delegate's one
m_xSMgr.set(
xMgr->createInstanceWithContext(
- OUSTR("com.sun.star.comp.stoc.OServiceManagerWrapper"), xDelegate ),
+ "com.sun.star.comp.stoc.OServiceManagerWrapper", xDelegate ),
UNO_QUERY );
// patch DefaultContext property of new one
Reference< beans::XPropertySet > xProps( m_xSMgr, UNO_QUERY );
@@ -803,7 +802,7 @@ ComponentContext::ComponentContext(
if (xProps.is())
{
Reference< XComponentContext > xThis( this );
- xProps->setPropertyValue( OUSTR("DefaultContext"), makeAny( xThis ) );
+ xProps->setPropertyValue( "DefaultContext", makeAny( xThis ) );
}
}
catch (...)
diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx
index 87e94677597d..d63b9bed8c38 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -29,8 +29,6 @@
#include "cppuhelper/exc_hlp.hxx"
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
using namespace ::rtl;
using namespace ::osl;
@@ -124,7 +122,7 @@ static void SAL_CALL ExceptionThrower_dispatch(
{
OSL_ASSERT( 0 );
RuntimeException exc(
- OUSTR("not implemented!"), Reference< XInterface >() );
+ "not implemented!", Reference< XInterface >() );
uno_type_any_construct(
*ppException, &exc, ::getCppuType( &exc ).getTypeLibType(), 0 );
break;
@@ -192,16 +190,16 @@ void SAL_CALL throwException( Any const & exc ) SAL_THROW( (Exception) )
if (exc.getValueTypeClass() != TypeClass_EXCEPTION)
{
throw RuntimeException(
- OUSTR("no UNO exception given "
- "(must be derived from com::sun::star::uno::Exception)!"),
+ "no UNO exception given "
+ "(must be derived from com::sun::star::uno::Exception)!",
Reference< XInterface >() );
}
- Mapping uno2cpp(Environment(OUSTR(UNO_LB_UNO)), Environment::getCurrent());
+ Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
if (! uno2cpp.is())
{
throw RuntimeException(
- OUSTR("cannot get binary UNO to C++ mapping!"),
+ "cannot get binary UNO to C++ mapping!",
Reference< XInterface >() );
}
@@ -217,18 +215,18 @@ void SAL_CALL throwException( Any const & exc ) SAL_THROW( (Exception) )
//==============================================================================
Any SAL_CALL getCaughtException()
{
- Mapping cpp2uno(Environment::getCurrent(), Environment(OUSTR(UNO_LB_UNO)));
+ Mapping cpp2uno(Environment::getCurrent(), Environment(UNO_LB_UNO));
if (! cpp2uno.is())
{
throw RuntimeException(
- OUSTR("cannot get C++ to binary UNO mapping!"),
+ "cannot get C++ to binary UNO mapping!",
Reference< XInterface >() );
}
- Mapping uno2cpp(Environment(OUSTR(UNO_LB_UNO)), Environment::getCurrent());
+ Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
if (! uno2cpp.is())
{
throw RuntimeException(
- OUSTR("cannot get binary UNO to C++ mapping!"),
+ "cannot get binary UNO to C++ mapping!",
Reference< XInterface >() );
}
@@ -258,7 +256,7 @@ Any SAL_CALL getCaughtException()
if (exc == 0)
{
throw RuntimeException(
- OUSTR("rethrowing C++ exception failed!"),
+ "rethrowing C++ exception failed!",
Reference< XInterface >() );
}
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index b23204f5adee..853d77e825d3 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -44,8 +44,6 @@
#include <memory>
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
using namespace osl;
using namespace com::sun::star;
@@ -666,7 +664,7 @@ IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper()
if (m_property_array_helper.get() == 0)
{
beans::Property prop(
- OUSTR("ImplementationKey") /* name */,
+ "ImplementationKey" /* name */,
0 /* handle */,
::getCppuType( &xImplementationKey ),
beans::PropertyAttribute::READONLY |
@@ -692,7 +690,7 @@ void ORegistryFactoryHelper::setFastPropertyValue_NoBroadcast(
throw (Exception)
{
throw beans::PropertyVetoException(
- OUSTR("unexpected: only readonly properties!"),
+ "unexpected: only readonly properties!",
static_cast< OWeakObject * >(this) );
}
@@ -708,7 +706,7 @@ void ORegistryFactoryHelper::getFastPropertyValue(
{
rValue.clear();
throw beans::UnknownPropertyException(
- OUSTR("unknown property!"), static_cast< OWeakObject * >(
+ "unknown property!", static_cast< OWeakObject * >(
const_cast< ORegistryFactoryHelper * >(this) ) );
}
}
diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx
index 5627b681eff6..3553d182b70c 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -34,7 +34,6 @@
#include "macro_expander.hxx"
#include "paths.hxx"
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
#define SERVICE_NAME_A "com.sun.star.lang.MacroExpander"
#define SERVICE_NAME_B "com.sun.star.lang.BootstrapMacroExpander"
#define IMPL_NAME "com.sun.star.lang.comp.cppuhelper.BootstrapMacroExpander"
@@ -93,8 +92,8 @@ private:
public:
ImplNames() : m_aNames(2)
{
- m_aNames[0] = OUSTR(SERVICE_NAME_A);
- m_aNames[1] = OUSTR(SERVICE_NAME_B);
+ m_aNames[0] = SERVICE_NAME_A;
+ m_aNames[1] = SERVICE_NAME_B;
}
const Sequence<OUString>& getNames() const { return m_aNames; }
};
@@ -103,7 +102,7 @@ class theImplNames : public rtl::Static<ImplNames, theImplNames> {};
inline OUString s_impl_name()
{
- return OUSTR(IMPL_NAME);
+ return OUString(IMPL_NAME);
}
inline Sequence< OUString > const & s_get_service_names()
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index acc4253a426b..9fe86e4bfa29 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -43,8 +43,6 @@
#include <osl/detail/ios-bootstrap.h>
#endif
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
using namespace ::rtl;
using namespace ::osl;
@@ -227,10 +225,10 @@ static OUString makeComponentPath(
if (rPath[ rPath.getLength() -1 ] != '/')
buf.append( (sal_Unicode) '/' );
}
- if (! rLibName.endsWithIgnoreAsciiCase( OUSTR(SAL_DLLEXTENSION) ))
+ if (! rLibName.endsWithIgnoreAsciiCase( SAL_DLLEXTENSION ))
{
#if defined SAL_DLLPREFIX
- if (! rLibName.endsWithIgnoreAsciiCase( OUSTR(".uno") ))
+ if (! rLibName.endsWithIgnoreAsciiCase( ".uno" ))
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(SAL_DLLPREFIX) );
}
@@ -262,7 +260,7 @@ static void getLibEnv(oslModule lib,
{
sal_Char const * pEnvTypeName = NULL;
- OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT);
+ OUString aGetEnvNameExt = rPrefix + COMPONENT_GETENVEXT;
component_getImplementationEnvironmentExtFunc pGetImplEnvExt =
(component_getImplementationEnvironmentExtFunc)osl_getFunctionSymbol(lib, aGetEnvNameExt.pData);
@@ -273,7 +271,7 @@ static void getLibEnv(oslModule lib,
}
else
{
- OUString aGetEnvName = rPrefix + OUSTR(COMPONENT_GETENV);
+ OUString aGetEnvName = rPrefix + COMPONENT_GETENV;
component_getImplementationEnvironmentFunc pGetImplEnv =
(component_getImplementationEnvironmentFunc)osl_getFunctionSymbol(
lib, aGetEnvName.pData );
@@ -417,22 +415,22 @@ Reference< XInterface > invokeComponentFactory(
}
else
{
- rExcMsg = rModulePath;
- rExcMsg += OUSTR(": cannot get factory of "
- "demanded implementation: ");
- rExcMsg += OStringToOUString(
+ rExcMsg = rModulePath +
+ ": cannot get factory of " +
+ "demanded implementation: " +
+ OStringToOUString(
aImplName, RTL_TEXTENCODING_ASCII_US );
}
}
else
{
rExcMsg =
- OUSTR("cannot get uno mappings: C++ <=> UNO!");
+ "cannot get uno mappings: C++ <=> UNO!";
}
}
else
{
- rExcMsg = OUSTR("cannot get uno environments!");
+ rExcMsg = "cannot get uno environments!";
}
return xRet;
@@ -479,15 +477,15 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
OUString sLibName(rLibName);
#ifdef ANDROID
- if ( rLibName.equals( OUSTR("bootstrap.uno" SAL_DLLEXTENSION) ) )
- sLibName = OUSTR("libbootstrap.uno" SAL_DLLEXTENSION);
+ if ( rLibName.equals( "bootstrap.uno" SAL_DLLEXTENSION ) )
+ sLibName = "libbootstrap.uno" SAL_DLLEXTENSION;
#endif
OUString aModulePath( makeComponentPath( sLibName, rPath ) );
if (! checkAccessPath( &aModulePath ))
{
throw loader::CannotActivateFactoryException(
- OUSTR("permission denied to load component library: ") +
+ "permission denied to load component library: " +
aModulePath,
Reference< XInterface >() );
}
@@ -497,17 +495,17 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
if (! lib)
{
throw loader::CannotActivateFactoryException(
- OUSTR("loading component library failed: ") + aModulePath,
+ "loading component library failed: " + aModulePath,
Reference< XInterface >() );
}
#else
(void) rPath;
oslModule lib;
- OUString aModulePath(OUSTR("MAIN"));
+ OUString aModulePath("MAIN");
if (! osl_getModuleHandle( NULL, &lib))
{
throw loader::CannotActivateFactoryException(
- OUSTR("osl_getModuleHandle of the executable: "),
+ "osl_getModuleHandle of the executable: ",
Reference< XInterface >() );
}
#endif
@@ -516,7 +514,7 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
OUString aExcMsg;
- OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY);
+ OUString aGetFactoryName = rPrefix + COMPONENT_GETFACTORY;
oslGenericFunction pSym = NULL;
@@ -600,7 +598,7 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
else
{
aExcMsg = aModulePath;
- aExcMsg += OUSTR(": cannot get symbol: ");
+ aExcMsg += ": cannot get symbol: ";
aExcMsg += aGetFactoryName;
}
@@ -633,7 +631,7 @@ Reference< XInterface > SAL_CALL invokeStaticComponentFactory(
{
Reference< XInterface > xRet;
oslModule pExe;
- OUString aExePath(OUSTR("MAIN"));
+ OUString aExePath("MAIN");
osl_getModuleHandle( NULL, &pExe );
OUString aExcMsg;
@@ -679,7 +677,7 @@ void SAL_CALL writeSharedLibComponentInfo(
if (! checkAccessPath( &aModulePath ))
{
throw registry::CannotRegisterImplementationException(
- OUSTR("permission denied to load component library: ") +
+ "permission denied to load component library: " +
aModulePath,
Reference< XInterface >() );
}
@@ -689,7 +687,7 @@ void SAL_CALL writeSharedLibComponentInfo(
if (! lib)
{
throw registry::CannotRegisterImplementationException(
- OUSTR("loading component library failed: ") + aModulePath,
+ "loading component library failed: " + aModulePath,
Reference< XInterface >() );
}
@@ -703,7 +701,7 @@ void SAL_CALL writeSharedLibComponentInfo(
getLibEnv(lib, &env, &aEnvTypeName, currentEnv);
- OUString aWriteInfoName = OUSTR(COMPONENT_WRITEINFO);
+ OUString aWriteInfoName = COMPONENT_WRITEINFO;
oslGenericFunction pSym = osl_getFunctionSymbol( lib, aWriteInfoName.pData );
if (pSym != 0)
{
@@ -729,16 +727,16 @@ void SAL_CALL writeSharedLibComponentInfo(
if (! bRet)
{
aExcMsg = aModulePath;
- aExcMsg += OUSTR(": component_writeInfo() "
- "returned false!");
+ aExcMsg += ": component_writeInfo() "
+ "returned false!";
}
}
else
{
// key is mandatory
aExcMsg = aModulePath;
- aExcMsg += OUSTR(": registry is mandatory to invoke"
- " component_writeInfo()!");
+ aExcMsg += ": registry is mandatory to invoke"
+ " component_writeInfo()!";
}
if (pSMgr)
@@ -749,18 +747,18 @@ void SAL_CALL writeSharedLibComponentInfo(
}
else
{
- aExcMsg = OUSTR("cannot get uno mapping: C++ <=> UNO!");
+ aExcMsg = "cannot get uno mapping: C++ <=> UNO!";
}
}
else
{
- aExcMsg = OUSTR("cannot get uno environments!");
+ aExcMsg = "cannot get uno environments!";
}
}
else
{
aExcMsg = aModulePath;
- aExcMsg += OUSTR(": cannot get symbol: ");
+ aExcMsg += ": cannot get symbol: ";
aExcMsg += aWriteInfoName;
}
diff --git a/cppuhelper/test/cfg_test.cxx b/cppuhelper/test/cfg_test.cxx
index 7649a37eb7b9..6dfece4a873f 100644
--- a/cppuhelper/test/cfg_test.cxx
+++ b/cppuhelper/test/cfg_test.cxx
@@ -40,8 +40,6 @@
#include <com/sun/star/registry/XImplementationRegistration.hpp>
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-
using namespace ::cppu;
using namespace ::rtl;
@@ -101,17 +99,17 @@ ServiceImpl0::ServiceImpl0( Reference< XComponentContext > const & xContext ) SA
// service properties
OSL_VERIFY( m_xContext->getValueByName(
- OUSTR("/services/com.sun.star.bootstrap.TestComponent0/context-properties/serviceprop0") ) >>= n );
+ "/services/com.sun.star.bootstrap.TestComponent0/context-properties/serviceprop0" ) >>= n );
OSL_VERIFY( n == 13 );
OSL_VERIFY( m_xContext->getValueByName(
- OUSTR("/services/com.sun.star.bootstrap.TestComponent0/context-properties/serviceprop1") ) >>= val );
+ "/services/com.sun.star.bootstrap.TestComponent0/context-properties/serviceprop1" ) >>= val );
OSL_VERIFY( val == "value of serviceprop1" );
// impl properties
OSL_VERIFY( m_xContext->getValueByName(
- OUSTR("/implementations/com.sun.star.comp.bootstrap.TestComponent0/context-properties/implprop0") ) >>= n );
+ "/implementations/com.sun.star.comp.bootstrap.TestComponent0/context-properties/implprop0" ) >>= n );
OSL_VERIFY( n == 15 );
OSL_VERIFY( m_xContext->getValueByName(
- OUSTR("/implementations/com.sun.star.comp.bootstrap.TestComponent0/context-properties/implprop1") ) >>= val );
+ "/implementations/com.sun.star.comp.bootstrap.TestComponent0/context-properties/implprop1" ) >>= val );
OSL_VERIFY( val == "value of implprop1" );
}
// XInitialization
@@ -238,32 +236,32 @@ SAL_IMPLEMENT_MAIN()
Reference< lang::XMultiComponentFactory > xMgr( xContext->getServiceManager() );
// show what is in context
- xContext->getValueByName( OUSTR("dump_maps") );
+ xContext->getValueByName( "dump_maps" );
sal_Int32 n(0);
- OSL_VERIFY( xContext->getValueByName( OUSTR("/global-context-properties/TestValue") ) >>= n );
+ OSL_VERIFY( xContext->getValueByName( "/global-context-properties/TestValue" ) >>= n );
::fprintf( stderr, "> n=%d\n", n );
Reference< XInterface > x;
- OSL_VERIFY( !(xContext->getValueByName( OUSTR("/singletons/my_converter") ) >>= x) );
- OSL_VERIFY( xContext->getValueByName( OUSTR("/singletons/com.sun.star.script.theConverter") ) >>= x );
- OSL_VERIFY( xContext->getValueByName( OUSTR("/singletons/com.sun.star.bootstrap.theTestComponent0") ) >>= x );
+ OSL_VERIFY( !(xContext->getValueByName( "/singletons/my_converter" ) >>= x) );
+ OSL_VERIFY( xContext->getValueByName( "/singletons/com.sun.star.script.theConverter" ) >>= x );
+ OSL_VERIFY( xContext->getValueByName( "/singletons/com.sun.star.bootstrap.theTestComponent0" ) >>= x );
::fprintf( stderr, "> registering service...\n");
#if defined(SAL_W32)
- OUString libName( OUSTR("cfg_test.dll") );
+ OUString libName( "cfg_test.dll" );
#elif defined(SAL_UNX)
- OUString libName( OUSTR("libcfg_test.so") );
+ OUString libName( "libcfg_test.so" );
#endif
Reference< registry::XImplementationRegistration > xImplReg( xMgr->createInstanceWithContext(
- OUSTR("com.sun.star.registry.ImplementationRegistration"), xContext ), UNO_QUERY );
+ "com.sun.star.registry.ImplementationRegistration", xContext ), UNO_QUERY );
OSL_ENSURE( xImplReg.is(), "### no impl reg!" );
xImplReg->registerImplementation(
- OUSTR("com.sun.star.loader.SharedLibrary"), libName,
+ "com.sun.star.loader.SharedLibrary", libName,
Reference< registry::XSimpleRegistry >() );
- OSL_VERIFY( (x = xMgr->createInstanceWithContext( OUSTR("com.sun.star.bootstrap.TestComponent0"), xContext )).is() );
- OSL_VERIFY( (x = xMgr->createInstanceWithContext( OUSTR("com.sun.star.bootstrap.TestComponent1"), xContext )).is() );
+ OSL_VERIFY( (x = xMgr->createInstanceWithContext( "com.sun.star.bootstrap.TestComponent0", xContext )).is() );
+ OSL_VERIFY( (x = xMgr->createInstanceWithContext( "com.sun.star.bootstrap.TestComponent1", xContext )).is() );
Reference< lang::XComponent > xComp( xContext, UNO_QUERY );
if (xComp.is())