From 8b27d78b4afaa9c47ca0fda144c8060f2f14046b Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Mar 2013 09:22:44 +0100 Subject: automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings Done with a perl regex: s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec Reviewed-on: https://gerrit.libreoffice.org/2832 Reviewed-by: Thomas Arnhold Tested-by: Thomas Arnhold --- cppuhelper/test/bootstrap/TestEnv.cxx | 4 +- cppuhelper/test/bootstrap/bootstrap.test.cxx | 50 ++++----- cppuhelper/test/cfg_test.cxx | 4 +- cppuhelper/test/loader/loader.test.cxx | 16 +-- cppuhelper/test/testcmp/TestComponent.cxx | 4 +- cppuhelper/test/testhelper.cxx | 12 +- cppuhelper/test/testimplhelper.cxx | 86 +++++++-------- cppuhelper/test/testpropshlp.cxx | 158 +++++++++++++-------------- cppuhelper/test/testproptyphlp.cxx | 2 +- 9 files changed, 168 insertions(+), 168 deletions(-) (limited to 'cppuhelper/test') diff --git a/cppuhelper/test/bootstrap/TestEnv.cxx b/cppuhelper/test/bootstrap/TestEnv.cxx index cf06790caa84..1a0d4065ea2c 100644 --- a/cppuhelper/test/bootstrap/TestEnv.cxx +++ b/cppuhelper/test/bootstrap/TestEnv.cxx @@ -96,10 +96,10 @@ int TestEnv::v_isValid(rtl::OUString * pReason) int result = m_inCount & 1; if (result) - *pReason = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OK")); + *pReason = rtl::OUString("OK"); else - *pReason = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not entered/invoked")); + *pReason = rtl::OUString("not entered/invoked"); return result; } diff --git a/cppuhelper/test/bootstrap/bootstrap.test.cxx b/cppuhelper/test/bootstrap/bootstrap.test.cxx index ebbb5ca24cc6..861491072477 100644 --- a/cppuhelper/test/bootstrap/bootstrap.test.cxx +++ b/cppuhelper/test/bootstrap/bootstrap.test.cxx @@ -53,7 +53,7 @@ static bool s_check_object_is_in(void * pObject) currentEnv.get()->pExtEnv->getObjectIdentifier(currentEnv.get()->pExtEnv, &pOId, pObject); - uno::TypeDescription typeDescription(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface"))); + uno::TypeDescription typeDescription(rtl::OUString("com.sun.star.uno.XInterface")); void * pRegisteredObject = NULL; currentEnv.get()->pExtEnv->getRegisteredInterface(currentEnv.get()->pExtEnv, @@ -92,11 +92,11 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu cppu::loadSharedLibComponentFactory( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION)), #ifdef WIN32 - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + rtl::OUString(""), #else - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file://../lib/")), + rtl::OUString("file://../lib/"), #endif - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("impl.test.TestComponent")) + servicePurpose, + rtl::OUString("impl.test.TestComponent") + servicePurpose, uno::Reference(), uno::Reference() ) @@ -104,7 +104,7 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu if (!xItf.is()) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tgot no object - FAILURE\n")); + s_comment += rtl::OUString("\t\tgot no object - FAILURE\n"); return; } @@ -125,33 +125,33 @@ static void s_test__loadSharedLibComponentFactory(rtl::OUString const & clientPu static void s_test__loadSharedLibComponentFactory__free_free() { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__loadSharedLibComponentFactory__free_free\n")); + s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__free_free\n"); s_test__loadSharedLibComponentFactory(rtl::OUString(), rtl::OUString()); } static void s_test__loadSharedLibComponentFactory__free_purpose() { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__loadSharedLibComponentFactory__free_purpose\n")); + s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__free_purpose\n"); s_test__loadSharedLibComponentFactory(rtl::OUString(), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv"))); + rtl::OUString(":testenv")); } static void s_test__loadSharedLibComponentFactory__purpose_free() { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__loadSharedLibComponentFactory__purpose_free\n")); + s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__purpose_free\n"); - s_test__loadSharedLibComponentFactory(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv")), + s_test__loadSharedLibComponentFactory(rtl::OUString(":testenv"), rtl::OUString()); } static void s_test__loadSharedLibComponentFactory__purpose_purpose() { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__loadSharedLibComponentFactory__purpose_purpose\n")); + s_comment += rtl::OUString("\ts_test__loadSharedLibComponentFactory__purpose_purpose\n"); - s_test__loadSharedLibComponentFactory(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv"))); + s_test__loadSharedLibComponentFactory(rtl::OUString(":testenv"), + rtl::OUString(":testenv")); } static rtl::OUString s_getSDrive(void) @@ -166,10 +166,10 @@ static rtl::OUString s_getSDrive(void) path += rtl::OUString(tmp, rtl_str_getLength(tmp), RTL_TEXTENCODING_ASCII_US); path += rtl::OUString(SAL_PATHDELIMITER); #ifdef WIN32 - path += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bin")); + path += rtl::OUString("bin"); #else - path += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("lib")); + path += rtl::OUString("lib"); #endif tmp = getenv("UPDMINOREXT"); @@ -199,7 +199,7 @@ static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose) if (!registry.is()) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tgot no object - FAILURE\n")); + s_comment += rtl::OUString("\t\tgot no object - FAILURE\n"); return; } @@ -213,16 +213,16 @@ static void s_test__createSimpleRegistry(rtl::OUString const & clientPurpose) static void s_test__createSimpleRegistry__free(void) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__createSimpleRegistry__free\n")); + s_comment += rtl::OUString("\ts_test__createSimpleRegistry__free\n"); s_test__createSimpleRegistry(rtl::OUString()); } static void s_test__createSimpleRegistry__purpose(void) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__createSimpleRegistry__purpose\n")); + s_comment += rtl::OUString("\ts_test__createSimpleRegistry__purpose\n"); - s_test__createSimpleRegistry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv"))); + s_test__createSimpleRegistry(rtl::OUString(":testenv")); } @@ -247,7 +247,7 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie if (!xContext.is()) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\t\tgot no object - FAILURE\n")); + s_comment += rtl::OUString("\t\tgot no object - FAILURE\n"); return; } @@ -264,16 +264,16 @@ static void s_test__bootstrap_InitialComponentContext(rtl::OUString const & clie static void s_test__bootstrap_InitialComponentContext__free(void) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__bootstrap_InitialComponentContext__free\n")); + s_comment += rtl::OUString("\ts_test__bootstrap_InitialComponentContext__free\n"); s_test__bootstrap_InitialComponentContext(rtl::OUString()); } static void s_test__bootstrap_InitialComponentContext__purpose(void) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__bootstrap_InitialComponentContext__purpose\n")); + s_comment += rtl::OUString("\ts_test__bootstrap_InitialComponentContext__purpose\n"); - s_test__bootstrap_InitialComponentContext(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":testenv"))); + s_test__bootstrap_InitialComponentContext(rtl::OUString(":testenv")); } @@ -293,12 +293,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) int ret; if (s_comment.indexOf("FAILURE") == -1) { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); + s_comment += rtl::OUString("TESTS PASSED\n"); ret = 0; } else { - s_comment += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); + s_comment += rtl::OUString("TESTS _NOT_ PASSED\n"); ret = -1; } diff --git a/cppuhelper/test/cfg_test.cxx b/cppuhelper/test/cfg_test.cxx index 6dfece4a873f..4acc23c2e741 100644 --- a/cppuhelper/test/cfg_test.cxx +++ b/cppuhelper/test/cfg_test.cxx @@ -59,7 +59,7 @@ static Sequence< OUString > impl0_getSupportedServiceNames() //-------------------------------------------------------------------------------------------------- static OUString impl0_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.bootstrap.TestComponent0") ); + return OUString("com.sun.star.comp.bootstrap.TestComponent0"); } //-------------------------------------------------------------------------------------------------- static Sequence< OUString > impl1_getSupportedServiceNames() @@ -70,7 +70,7 @@ static Sequence< OUString > impl1_getSupportedServiceNames() //-------------------------------------------------------------------------------------------------- static OUString impl1_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.bootstrap.TestComponent1") ); + return OUString("com.sun.star.comp.bootstrap.TestComponent1"); } //================================================================================================== diff --git a/cppuhelper/test/loader/loader.test.cxx b/cppuhelper/test/loader/loader.test.cxx index 466f243f52dc..cbaf7348d5e9 100644 --- a/cppuhelper/test/loader/loader.test.cxx +++ b/cppuhelper/test/loader/loader.test.cxx @@ -82,7 +82,7 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe rtl_str_getLength(pServicePurpose), RTL_TEXTENCODING_ASCII_US); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__cppu_loadSharedLibComponentFactory ")); + result += rtl::OUString("\ts_test__cppu_loadSharedLibComponentFactory "); result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(\"")); result += servicePurpose; result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\") - ")); @@ -92,14 +92,14 @@ static rtl::OUString s_test__cppu_loadSharedLibComponentFactory(char const * pSe cppu::loadSharedLibComponentFactory( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SAL_DLLPREFIX "TestComponent.uno" SAL_DLLEXTENSION)), rtl::OUString(), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("impl.test.TestComponent")) + servicePurpose, + rtl::OUString("impl.test.TestComponent") + servicePurpose, uno::Reference(), uno::Reference()) ); rtl::OUString envDcp_purpose(cppu::EnvDcp::getPurpose(g_envDcp)); if (envDcp_purpose == servicePurpose) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("passed\n")); + result += rtl::OUString("passed\n"); else { @@ -125,7 +125,7 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ rtl_str_getLength(pServicePurpose), RTL_TEXTENCODING_ASCII_US); - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\ts_test__cppu_writeSharedLibComponentInfo ")); + result += rtl::OUString("\ts_test__cppu_writeSharedLibComponentInfo "); result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(\"")); result += servicePurpose; result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\") - ")); @@ -146,7 +146,7 @@ static rtl::OUString s_test__cppu_writeSharedLibComponentInfo(char const * pServ rtl::OUString envDcp_purpose(cppu::EnvDcp::getPurpose(g_envDcp)); if (envDcp_purpose == servicePurpose) - result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("passed\n")); + result += rtl::OUString("passed\n"); else { @@ -172,7 +172,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) rtl::OUString message; message += rtl::OUString(argv[0], rtl_str_getLength(argv[0]), RTL_TEXTENCODING_ASCII_US); - message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); + message += rtl::OUString("\n"); message += s_test__cppu_loadSharedLibComponentFactory(":unsafe"); message += s_test__cppu_loadSharedLibComponentFactory(":affine"); @@ -183,11 +183,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(/*argc*/, argv) message += s_test__cppu_writeSharedLibComponentInfo(""); if (message.indexOf("FAILED") == -1) - message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS PASSED\n")); + message += rtl::OUString("TESTS PASSED\n"); else { - message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TESTS _NOT_ PASSED\n")); + message += rtl::OUString("TESTS _NOT_ PASSED\n"); result = -1; } diff --git a/cppuhelper/test/testcmp/TestComponent.cxx b/cppuhelper/test/testcmp/TestComponent.cxx index e23069ad047f..a5cd71daea35 100644 --- a/cppuhelper/test/testcmp/TestComponent.cxx +++ b/cppuhelper/test/testcmp/TestComponent.cxx @@ -98,7 +98,7 @@ uno::Reference SAL_CALL TestComponent::create( } catch (std::bad_alloc &) { - throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("std::bad_alloc")), + throw uno::RuntimeException(rtl::OUString("std::bad_alloc"), uno::Reference()); } } @@ -106,7 +106,7 @@ uno::Reference SAL_CALL TestComponent::create( uno::Sequence SAL_CALL TestComponent::getSupportedServiceNames_Static() { uno::Sequence serviceNames(1); - serviceNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.ServiceInfo")); + serviceNames[0] = rtl::OUString("com.sun.star.lang.ServiceInfo"); return serviceNames; } diff --git a/cppuhelper/test/testhelper.cxx b/cppuhelper/test/testhelper.cxx index 371e9aad4be0..30df8637ff43 100644 --- a/cppuhelper/test/testhelper.cxx +++ b/cppuhelper/test/testhelper.cxx @@ -54,21 +54,21 @@ SAL_IMPLEMENT_MAIN() try { Reference< XMultiComponentFactory > xMgr( createRegistryServiceFactory( - OUString( RTL_CONSTASCII_USTRINGPARAM("cpputest.rdb") ) ), UNO_QUERY ); + OUString("cpputest.rdb") ), UNO_QUERY ); Reference< XComponentContext > xInitialContext; OSL_VERIFY( Reference< beans::XPropertySet >( xMgr, UNO_QUERY )->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xInitialContext ); + OUString("DefaultContext") ) >>= xInitialContext ); ContextEntry_Init aEntry; aEntry.bLateInitService = false; - aEntry.name = OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ); + aEntry.name = OUString("bla, bla"); aEntry.value = makeAny( (sal_Int32)5 ); Reference< XComponentContext > xContext( createComponentContext( &aEntry, 1, xInitialContext ) ); OSL_ASSERT( xContext->getServiceManager() != xMgr ); // must be wrapped one OSL_ASSERT( Reference< beans::XPropertySet >( xContext->getServiceManager(), UNO_QUERY )->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) != xInitialContext ); + OUString("DefaultContext") ) != xInitialContext ); Reference< XMultiServiceFactory > x( xMgr, UNO_QUERY ); test_ImplHelper( x ); @@ -78,9 +78,9 @@ SAL_IMPLEMENT_MAIN() test_interfacecontainer(); OSL_VERIFY( xContext->getValueByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ) == (sal_Int32)5 ); + OUString("bla, bla") ) == (sal_Int32)5 ); OSL_VERIFY( ! xInitialContext->getValueByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ).hasValue() ); + OUString("bla, bla") ).hasValue() ); Reference< XComponent >( xInitialContext, UNO_QUERY )->dispose(); xMgr.clear(); xContext.clear(); diff --git a/cppuhelper/test/testimplhelper.cxx b/cppuhelper/test/testimplhelper.cxx index e00043bb36fb..37c6c3f7732b 100644 --- a/cppuhelper/test/testimplhelper.cxx +++ b/cppuhelper/test/testimplhelper.cxx @@ -94,25 +94,25 @@ struct TestImpl : public ImplHelper4< CA, DBA, FE, G > // A virtual OUString SAL_CALL a() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } + { return OUString("a"); } // BA virtual OUString SAL_CALL ba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ba") ); } + { return OUString("ba"); } // CA virtual OUString SAL_CALL ca() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ca") ); } + { return OUString("ca"); } // DBA virtual OUString SAL_CALL dba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("dba") ); } + { return OUString("dba"); } // E virtual OUString SAL_CALL e() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("e") ); } + { return OUString("e"); } // FE virtual OUString SAL_CALL fe() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("fe") ); } + { return OUString("fe"); } // G virtual OUString SAL_CALL g() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("g") ); } + { return OUString("g"); } }; //================================================================================================== @@ -123,25 +123,25 @@ struct TestWeakAggImpl : public WeakAggImplHelper4< CA, DBA, FE, G > // A virtual OUString SAL_CALL a() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } + { return OUString("a"); } // BA virtual OUString SAL_CALL ba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ba") ); } + { return OUString("ba"); } // CA virtual OUString SAL_CALL ca() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ca") ); } + { return OUString("ca"); } // DBA virtual OUString SAL_CALL dba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("dba") ); } + { return OUString("dba"); } // E virtual OUString SAL_CALL e() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("e") ); } + { return OUString("e"); } // FE virtual OUString SAL_CALL fe() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("fe") ); } + { return OUString("fe"); } // G virtual OUString SAL_CALL g() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("g") ); } + { return OUString("g"); } }; //================================================================================================== @@ -154,25 +154,25 @@ struct TestWeakImpl : public WeakImplHelper4< CA, DBA, FE, G > // A virtual OUString SAL_CALL a() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } + { return OUString("a"); } // BA virtual OUString SAL_CALL ba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ba") ); } + { return OUString("ba"); } // CA virtual OUString SAL_CALL ca() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ca") ); } + { return OUString("ca"); } // DBA virtual OUString SAL_CALL dba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("dba") ); } + { return OUString("dba"); } // E virtual OUString SAL_CALL e() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("e") ); } + { return OUString("e"); } // FE virtual OUString SAL_CALL fe() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("fe") ); } + { return OUString("fe"); } // G virtual OUString SAL_CALL g() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("g") ); } + { return OUString("g"); } protected: TestWeakImpl(int) {} @@ -203,25 +203,25 @@ struct TestWeakComponentImpl : public WeakComponentImplHelper4< CA, DBA, FE, G > // A virtual OUString SAL_CALL a() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } + { return OUString("a"); } // BA virtual OUString SAL_CALL ba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ba") ); } + { return OUString("ba"); } // CA virtual OUString SAL_CALL ca() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ca") ); } + { return OUString("ca"); } // DBA virtual OUString SAL_CALL dba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("dba") ); } + { return OUString("dba"); } // E virtual OUString SAL_CALL e() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("e") ); } + { return OUString("e"); } // FE virtual OUString SAL_CALL fe() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("fe") ); } + { return OUString("fe"); } // G virtual OUString SAL_CALL g() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("g") ); } + { return OUString("g"); } }; //================================================================================================== @@ -239,25 +239,25 @@ struct TestWeakAggComponentImpl : public WeakAggComponentImplHelper4< CA, DBA, F // A virtual OUString SAL_CALL a() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } + { return OUString("a"); } // BA virtual OUString SAL_CALL ba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ba") ); } + { return OUString("ba"); } // CA virtual OUString SAL_CALL ca() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("ca") ); } + { return OUString("ca"); } // DBA virtual OUString SAL_CALL dba() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("dba") ); } + { return OUString("dba"); } // E virtual OUString SAL_CALL e() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("e") ); } + { return OUString("e"); } // FE virtual OUString SAL_CALL fe() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("fe") ); } + { return OUString("fe"); } // G virtual OUString SAL_CALL g() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("g") ); } + { return OUString("g"); } }; //================================================================================================== @@ -288,10 +288,10 @@ struct TestImplInh : public ImplInheritanceHelper2< TestWeakImpl, H, I > // H virtual OUString SAL_CALL h() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("h") ); } + { return OUString("h"); } // I virtual OUString SAL_CALL i() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("i") ); } + { return OUString("i"); } }; //================================================================================================== @@ -302,10 +302,10 @@ struct TestAggImplInh : public AggImplInheritanceHelper2< TestWeakAggImpl, H, I // H virtual OUString SAL_CALL h() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("h2") ); } + { return OUString("h2"); } // I virtual OUString SAL_CALL i() throw(RuntimeException) - { return OUString( RTL_CONSTASCII_USTRINGPARAM("i2") ); } + { return OUString("i2"); } }; @@ -485,7 +485,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) bool exc_succ = false; lang::IllegalAccessException exc( - OUString( RTL_CONSTASCII_USTRINGPARAM("testtest") ), + OUString("testtest"), xWeakAggImpl ); // exception helper tests try @@ -532,7 +532,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) try { throwException( makeAny( RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM("runtime exc") ), xImpl ) ) ); + OUString("runtime exc"), xImpl ) ) ); } catch (RuntimeException & rExc) { @@ -540,7 +540,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) try { throwException( makeAny( Exception( - OUString( RTL_CONSTASCII_USTRINGPARAM("exc") ), rExc.Context ) ) ); + OUString("exc"), rExc.Context ) ) ); } catch (lang::IllegalAccessException &) { @@ -552,7 +552,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) try { throwException( makeAny( lang::IllegalAccessException( - OUString( RTL_CONSTASCII_USTRINGPARAM("axxess exc") ), rExc2.Context ) ) ); + OUString("axxess exc"), rExc2.Context ) ) ); } catch (lang::IllegalAccessException & rExc3) { diff --git a/cppuhelper/test/testpropshlp.cxx b/cppuhelper/test/testpropshlp.cxx index c04c4d8187ef..c67c1ecbf43e 100644 --- a/cppuhelper/test/testpropshlp.cxx +++ b/cppuhelper/test/testpropshlp.cxx @@ -52,17 +52,17 @@ static Property * getPropertyTable1() if( ! pTable ) { static Property aTable[] = { - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("a") ), 0, getCppuType( (OUString *)0) , + Property( OUString("a"), 0, getCppuType( (OUString *)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), //OUString - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("b") ), 1, getCppuCharType( ) , + Property( OUString("b"), 1, getCppuCharType( ) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), //Char - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("c") ), 2, getCppuType( (sal_Int32*)0) , + Property( OUString("c"), 2, getCppuType( (sal_Int32*)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), //sal_Int32 - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("d") ), 5, getCppuType( (double*)0) , + Property( OUString("d"), 5, getCppuType( (double*)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), //double - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("e") ), 7, getCppuBooleanType() , + Property( OUString("e"), 7, getCppuBooleanType() , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), //BOOL - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("f") ), 8, getCppuType( (Any*)0) , + Property( OUString("f"), 8, getCppuType( (Any*)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ) //Any }; pTable = aTable; @@ -81,17 +81,17 @@ static Property * getPropertyTable2() if( ! pTable ) { static Property aTable[] = { - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("f") ), 8, getCppuType( (Any *)0) , + Property( OUString("f"), 8, getCppuType( (Any *)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // Any - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("b") ), 1, getCppuCharType( ), + Property( OUString("b"), 1, getCppuCharType( ), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // Char - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("a") ), 0, getCppuType( (OUString*)0), + Property( OUString("a"), 0, getCppuType( (OUString*)0), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // OUString - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("d") ), 5, getCppuType( (double*)0) , + Property( OUString("d"), 5, getCppuType( (double*)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // Double - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("c") ), 2, getCppuType( (sal_Int32*)0), + Property( OUString("c"), 2, getCppuType( (sal_Int32*)0), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // sal_Int32 - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("e") ), 7, getCppuBooleanType() , + Property( OUString("e"), 7, getCppuBooleanType() , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ) // Bool }; pTable = aTable; @@ -109,11 +109,11 @@ static Property * getPropertyTable3() if( ! pTable ) { static Property aTable[] = { - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("b") ), 1, getCppuCharType( ), + Property( OUString("b"), 1, getCppuCharType( ), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // Char - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("f") ), 8, getCppuType( (Any *)0) , + Property( OUString("f"), 8, getCppuType( (Any *)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // any - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("a") ), 0, getCppuType( (OUString*)0), + Property( OUString("a"), 0, getCppuType( (OUString*)0), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ) // OUString }; pTable = aTable; @@ -132,11 +132,11 @@ static Property * getPropertyTable4() if( ! pTable ) { static Property aTable[] = { - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("a") ), 0, getCppuType( (OUString*)0), + Property( OUString("a"), 0, getCppuType( (OUString*)0), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // OUString - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("b") ), 1, getCppuCharType( ), + Property( OUString("b"), 1, getCppuCharType( ), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ), // Char - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("f") ), 2, getCppuType( (Any *)0) , + Property( OUString("f"), 2, getCppuType( (Any *)0) , PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID ) // Any }; pTable = aTable; @@ -220,10 +220,10 @@ void test_PropertyArrayHelper() OSL_ENSURE( aP.Type == getPropertyTable1()[i].Type, "Type not correct" ); } - OSL_ENSURE( !a1.hasPropertyByName( OUString( RTL_CONSTASCII_USTRINGPARAM("never exist") ) ), "hasPropertyByName not correct" ); + OSL_ENSURE( !a1.hasPropertyByName( OUString("never exist") ), "hasPropertyByName not correct" ); try { - a1.getPropertyByName( OUString( RTL_CONSTASCII_USTRINGPARAM("never exist") ) ); + a1.getPropertyByName( OUString("never exist") ); OSL_FAIL( "exeption not thrown" ); } catch( UnknownPropertyException & ) @@ -239,7 +239,7 @@ void test_PropertyArrayHelper() sal_Int32 Handle = a1.getHandleByName( getPropertyTable1()[i].Name ); OSL_ENSURE( Handle == getPropertyTable1()[i].Handle, "Handle not correct" ); } - sal_Int32 Handle = a1.getHandleByName( OUString( RTL_CONSTASCII_USTRINGPARAM("asdaf") ) ); + sal_Int32 Handle = a1.getHandleByName( OUString("asdaf") ); OSL_ENSURE( Handle == -1, "Handle not correct" ); } @@ -277,10 +277,10 @@ void test_PropertyArrayHelper() Sequence< OUString > aS( 4 ); sal_Int32 Handles[4]; // muss sortiert sein - aS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); - aS.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("d") ); - aS.getArray()[2] = OUString( RTL_CONSTASCII_USTRINGPARAM("f") ); - aS.getArray()[3] = OUString( RTL_CONSTASCII_USTRINGPARAM("t") ); + aS.getArray()[0] = OUString("a"); + aS.getArray()[1] = OUString("d"); + aS.getArray()[2] = OUString("f"); + aS.getArray()[3] = OUString("t"); sal_Int32 nHitCount = a1.fillHandles( Handles, aS ); OSL_ENSURE( nHitCount == 3, "wrong number of hits " ); OSL_ENSURE( Handles[0] == getPropertyTable1()[0].Handle, "Handle not correct" ); @@ -408,11 +408,11 @@ Property * getBasicProps() static Property aBasicProps[PROPERTY_COUNT] = { - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ) , PROPERTY_BOOL , getCppuBooleanType(), PropertyAttribute::READONLY ), - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ) , PROPERTY_INT16, + Property( OUString("BOOL") , PROPERTY_BOOL , getCppuBooleanType(), PropertyAttribute::READONLY ), + Property( OUString("INT16") , PROPERTY_INT16, getCppuType( (sal_Int16*)0 ), PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED ), - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ) , PROPERTY_INT32, getCppuType( (sal_Int32*)0 ), PropertyAttribute::BOUND ), - Property( OUString( RTL_CONSTASCII_USTRINGPARAM("TEST") ) , 55 , getCppuType( (sal_Int32*)0), PropertyAttribute::BOUND ) + Property( OUString("INT32") , PROPERTY_INT32, getCppuType( (sal_Int32*)0 ), PropertyAttribute::BOUND ), + Property( OUString("TEST") , 55 , getCppuType( (sal_Int32*)0), PropertyAttribute::BOUND ) }; pTable = aBasicProps; } @@ -468,13 +468,13 @@ public: case PROPERTY_BOOL: { OSL_FAIL( "PropertySetHelper: BOOL cannot change" ); - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("BOOL"), "PropertySetHelper: wrong name" ); } break; case PROPERTY_INT16: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT16"), "PropertySetHelper: wrong name" ); OSL_ENSURE( pExceptedListenerValues[nCurrent].getValueType().getTypeClass() == TypeClass_SHORT , "PropertySetHelper: wrong data type" ); @@ -493,7 +493,7 @@ public: case PROPERTY_INT32: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT32"), "PropertySetHelper: wrong name" ); sal_Int32 nInt32(0),nOldInt32(0); @@ -526,13 +526,13 @@ public: case PROPERTY_BOOL: { OSL_FAIL( "PropertySetHelper: BOOL cannot change" ); - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("BOOL"), "PropertySetHelper: wrong name" ); } break; case PROPERTY_INT16: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT16"), "PropertySetHelper: wrong name" ); sal_Int16 nInt16(0), nOldInt16(0); pExceptedListenerValues[nCurrent] >>= nInt16; @@ -554,7 +554,7 @@ public: case PROPERTY_INT32: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT32"), "PropertySetHelper: wrong name" ); sal_Int32 nInt32(0),nOldInt32(0); pExceptedListenerValues[nCurrent] >>= nInt32; @@ -589,13 +589,13 @@ public: case PROPERTY_BOOL: { OSL_FAIL( "PropertySetHelper: BOOL cannot change" ); - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("BOOL"), "PropertySetHelper: wrong name" ); } break; case PROPERTY_INT16: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT16"), "PropertySetHelper: wrong name" ); sal_Int16 nInt16(0), nOldInt16(0); pExceptedListenerValues[nCurrent] >>= nInt16; @@ -611,7 +611,7 @@ public: case PROPERTY_INT32: { - OSL_ENSURE( evt.PropertyName == OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ), "PropertySetHelper: wrong name" ); + OSL_ENSURE( evt.PropertyName == OUString("INT32"), "PropertySetHelper: wrong name" ); sal_Int32 nInt32(0),nOldInt32(0); @@ -804,26 +804,26 @@ void test_PropertySetHelper() Reference < XPropertiesChangeListener > x1( xPS_L, UNO_QUERY ); Reference < XVetoableChangeListener > x2( xPS_L, UNO_QUERY ); - xPS->addPropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), xPS_L ); + xPS->addPropertyChangeListener( OUString("INT16"), xPS_L ); Sequence szPN( 3 ); - szPN.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ); - szPN.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ); - szPN.getArray()[2] = OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ); // must ne ignored by the addPropertiesChangeListener method + szPN.getArray()[0] = OUString("BOOL"); + szPN.getArray()[1] = OUString("INT32"); + szPN.getArray()[2] = OUString("Does not exist"); // must ne ignored by the addPropertiesChangeListener method pPS->addPropertiesChangeListener( szPN, x1 ); szPN = Sequence(); pPS->addPropertiesChangeListener( szPN, x1 ); - pPS->addVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + pPS->addVetoableChangeListener( OUString("INT16"), x2 ); - xPS->removePropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), xPS_L ); + xPS->removePropertyChangeListener( OUString("INT16"), xPS_L ); pPS->removePropertiesChangeListener( x1 ); pPS->removePropertiesChangeListener( x1 ); - pPS->removeVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + pPS->removeVetoableChangeListener( OUString("INT16"), x2 ); // this exception must thrown try { - xPS->addPropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ), xPS_L ); + xPS->addPropertyChangeListener( OUString("Does not exist"), xPS_L ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( UnknownPropertyException & /*e*/ ) @@ -833,7 +833,7 @@ void test_PropertySetHelper() try { - xPS->addVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ), x2 ); + xPS->addVetoableChangeListener( OUString("Does not exist"), x2 ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( UnknownPropertyException & /*e*/ ) @@ -849,14 +849,14 @@ void test_PropertySetHelper() Reference < XPropertiesChangeListener > x1( xPS_L, UNO_QUERY ); Reference < XVetoableChangeListener > x2( xPS_L, UNO_QUERY ); - xPS->addPropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), xPS_L ); + xPS->addPropertyChangeListener( OUString("INT16"), xPS_L ); Sequence szPN( 2 ); - szPN.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ); - szPN.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ); + szPN.getArray()[0] = OUString("BOOL"); + szPN.getArray()[1] = OUString("INT32"); pPS->addPropertiesChangeListener( szPN, x1 ); szPN = Sequence(); pPS->addPropertiesChangeListener( szPN, x1 ); - pPS->addVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + pPS->addVetoableChangeListener( OUString("INT16"), x2 ); pPS->dispose(); } OSL_ENSURE( pPS_L->nDisposing == 4 , "PropertySetHelper: wrong disposing count" ); @@ -873,7 +873,7 @@ void test_PropertySetHelper() sal_Bool b = sal_True; Any aBool; aBool.setValue( &b , getCppuBooleanType() ); - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ), aBool ); + xPS->setPropertyValue( OUString("BOOL"), aBool ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( PropertyVetoException & /*e*/ ) @@ -900,7 +900,7 @@ void test_PropertySetHelper() sal_Bool b = sal_True; Any aBool; aBool.setValue( &b , getCppuBooleanType() ); - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ), aBool ); + xPS->setPropertyValue( OUString("Does not exist"), aBool ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( UnknownPropertyException & /*e*/ ) @@ -923,7 +923,7 @@ void test_PropertySetHelper() try { Any aBool; - aBool = xPS->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ) ); + aBool = xPS->getPropertyValue( OUString("Does not exist") ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( UnknownPropertyException & /*e*/ ) @@ -944,7 +944,7 @@ void test_PropertySetHelper() try { Any aBool; - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ), aBool ); + xPS->setPropertyValue( OUString("INT32"), aBool ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( IllegalArgumentException & /*e*/ ) @@ -966,7 +966,7 @@ void test_PropertySetHelper() { Any aINT32; aINT32 <<= (sal_Int32 ) 16; - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), aINT32 ); + xPS->setPropertyValue( OUString("INT16"), aINT32 ); OSL_FAIL( "PropertySetHelper: exeption not thrown" ); } catch( IllegalArgumentException & /*e*/ ) @@ -987,7 +987,7 @@ void test_PropertySetHelper() Any aValue; - aValue = xPS->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ) ); + aValue = xPS->getPropertyValue( OUString("BOOL") ); sal_Bool b = *( (sal_Bool*)aValue.getValue()); OSL_ENSURE( ! b, "PropertySetHelper: wrong BOOL value" ); aValue = ((XFastPropertySet *)pPS)->getFastPropertyValue( PROPERTY_BOOL ); @@ -997,8 +997,8 @@ void test_PropertySetHelper() sal_Int16 n16(0); aValue <<=(sal_Int16)22; - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), aValue ); - aValue = xPS->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ) ); + xPS->setPropertyValue( OUString("INT16"), aValue ); + aValue = xPS->getPropertyValue( OUString("INT16") ); aValue >>= n16; OSL_ENSURE( 22 == n16 , "PropertySetHelper: wrong INT16 value" ); aValue <<= (sal_Int16)44; @@ -1010,8 +1010,8 @@ void test_PropertySetHelper() // widening conversion aValue <<= (sal_Int16)55; - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ), aValue ); - aValue = xPS->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ) ); + xPS->setPropertyValue( OUString("INT32"), aValue ); + aValue = xPS->getPropertyValue( OUString("INT32") ); sal_Int32 n32(0); aValue >>= n32; OSL_ENSURE( 55 == n32 , "PropertySetHelper: wrong INT32 value" ); @@ -1022,9 +1022,9 @@ void test_PropertySetHelper() OSL_ENSURE( 66 == n32, "PropertySetHelper: wrong INT32 value" ); Sequence< OUString >valueNames = Sequence( 3 ); - valueNames.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ); - valueNames.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ); - valueNames.getArray()[2] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ); + valueNames.getArray()[0] = OUString("BOOL"); + valueNames.getArray()[1] = OUString("INT16"); + valueNames.getArray()[2] = OUString("INT32"); Sequence< Any > aValues = pPS->getPropertyValues( valueNames ); b = *((sal_Bool*)aValues.getConstArray()[0].getValue()); @@ -1042,8 +1042,8 @@ void test_PropertySetHelper() { Reference < XVetoableChangeListener > x2( xPS_L, UNO_QUERY ); - xPS->addPropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), xPS_L ); - pPS->addVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + xPS->addPropertyChangeListener( OUString("INT16"), xPS_L ); + pPS->addVetoableChangeListener( OUString("INT16"), x2 ); pPS_L->nCount = 10; Sequence< Any > aSeq( pPS_L->nCount ); @@ -1064,7 +1064,7 @@ void test_PropertySetHelper() Any aValue; aValue <<= (sal_Int16)22; - xPS->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), aValue ); + xPS->setPropertyValue( OUString("INT16"), aValue ); aValue <<= (sal_Int16) 44; ((XFastPropertySet *)pPS)->setFastPropertyValue( PROPERTY_INT16, aValue ); aValue <<= (sal_Int16)100;// exception @@ -1084,8 +1084,8 @@ void test_PropertySetHelper() pPS_L->nCount = 0; pPS_L->nCurrent = 0; pPS_L->pExceptedListenerValues = NULL; - xPS->removePropertyChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), xPS_L ); - pPS->removeVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + xPS->removePropertyChangeListener( OUString("INT16"), xPS_L ); + pPS->removeVetoableChangeListener( OUString("INT16"), x2 ); } // Test multi property set listener @@ -1093,12 +1093,12 @@ void test_PropertySetHelper() Reference < XPropertiesChangeListener > x1( xPS_L, UNO_QUERY ); Reference < XVetoableChangeListener > x2( xPS_L, UNO_QUERY ); - pPS->addVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ) , x2 ); + pPS->addVetoableChangeListener( OUString("INT16") , x2 ); Sequence szPN( 4 ); - szPN.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("BOOL") ); - szPN.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ); - szPN.getArray()[2] = OUString( RTL_CONSTASCII_USTRINGPARAM("Does not exist") ); // must ne ignored by the addPropertiesChangeListener method - szPN.getArray()[3] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ); + szPN.getArray()[0] = OUString("BOOL"); + szPN.getArray()[1] = OUString("INT32"); + szPN.getArray()[2] = OUString("Does not exist"); // must ne ignored by the addPropertiesChangeListener method + szPN.getArray()[3] = OUString("INT16"); pPS->addPropertiesChangeListener( szPN, x1 ); pPS_L->nCount = 6; @@ -1114,8 +1114,8 @@ void test_PropertySetHelper() pPS_L->pExceptedListenerValues[5] <<= (sal_Int32) 44; // new value bound szPN = Sequence( 2 ); - szPN.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ); - szPN.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT32") ); + szPN.getArray()[0] = OUString("INT16"); + szPN.getArray()[1] = OUString("INT32"); Sequence< Any > aValues( 2 ); aValues.getArray()[0] <<= (sal_Int16) 22; aValues.getArray()[1] <<= (sal_Int16) 44; @@ -1136,8 +1136,8 @@ void test_PropertySetHelper() //vetoable exception with multible - szPN.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ); - szPN.getArray()[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ); + szPN.getArray()[0] = OUString("INT16"); + szPN.getArray()[1] = OUString("INT16"); pPS->nINT32 = 0; pPS->nINT16 = 0; pPS_L->nCount = 4; @@ -1160,7 +1160,7 @@ void test_PropertySetHelper() OSL_ENSURE( pPS_L->nCount == pPS_L->nCurrent, "not all listeners called" ); pPS->removePropertiesChangeListener( x1 ); - pPS->removeVetoableChangeListener( OUString( RTL_CONSTASCII_USTRINGPARAM("INT16") ), x2 ); + pPS->removeVetoableChangeListener( OUString("INT16"), x2 ); } } } diff --git a/cppuhelper/test/testproptyphlp.cxx b/cppuhelper/test/testproptyphlp.cxx index c4d3dae742a0..d52515bff05e 100644 --- a/cppuhelper/test/testproptyphlp.cxx +++ b/cppuhelper/test/testproptyphlp.cxx @@ -56,7 +56,7 @@ void testPropertyTypeHelper() ::com::sun::star::beans::Property prop; - prop.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Huhu") ); + prop.Name = rtl::OUString("Huhu"); prop.Handle = 5; prop.Attributes = 3; -- cgit v1.2.3