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 --- .../Addons/ProtocolHandlerAddon_cpp/addon.cxx | 14 +++++++------- .../Components/CppComponent/TestCppComponent.cxx | 4 ++-- .../Components/CppComponent/service1_impl.cxx | 10 +++++----- .../Components/CppComponent/service2_impl.cxx | 18 +++++++++--------- .../FlatXmlFilterDetection/filterdetect.cxx | 2 +- .../SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx | 4 ++-- .../cpp/complextoolbarcontrols/MyProtocolHandler.cxx | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx index 8fac61698cca..ce483459483e 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx @@ -66,7 +66,7 @@ static void ShowMessageBox( const Reference< XToolkit >& rToolkit, const Referen // describe window properties. WindowDescriptor aDescriptor; aDescriptor.Type = WindowClass_MODALTOP; - aDescriptor.WindowServiceName = OUString( RTL_CONSTASCII_USTRINGPARAM( "infobox" )); + aDescriptor.WindowServiceName = OUString( "infobox" ); aDescriptor.ParentIndex = -1; aDescriptor.Parent = Reference< XWindowPeer >( rFrame->getContainerWindow(), UNO_QUERY ); aDescriptor.Bounds = Rectangle(0,0,300,200); @@ -139,21 +139,21 @@ void SAL_CALL Addon::dispatch( const URL& aURL, const Sequence < PropertyValue > if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) { ShowMessageBox( mxToolkit, mxFrame, - OUString( RTL_CONSTASCII_USTRINGPARAM( "SDK Add-On example" )), - OUString( RTL_CONSTASCII_USTRINGPARAM( "Function 1 activated" )) ); + OUString( "SDK Add-On example" ), + OUString( "Function 1 activated" ) ); } else if ( aURL.Path.compareToAscii( "Function2" ) == 0 ) { ShowMessageBox( mxToolkit, mxFrame, - OUString( RTL_CONSTASCII_USTRINGPARAM( "SDK Add-On example" )), - OUString( RTL_CONSTASCII_USTRINGPARAM( "Function 2 activated" )) ); + OUString( "SDK Add-On example" ), + OUString( "Function 2 activated" ) ); } else if ( aURL.Path.compareToAscii( "Help" ) == 0 ) { // Show info box ShowMessageBox( mxToolkit, mxFrame, - OUString( RTL_CONSTASCII_USTRINGPARAM( "About SDK Add-On example" )), - OUString( RTL_CONSTASCII_USTRINGPARAM( "This is the SDK Add-On example" )) ); + OUString( "About SDK Add-On example" ), + OUString( "This is the SDK Add-On example" ) ); } } } diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx index 849667b74964..0dd690995dcd 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx +++ b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx @@ -61,11 +61,11 @@ SAL_IMPLEMENT_MAIN() my_module::MyService1::create(xContext); // call methodOne and print the return value on stdout - OUString s = xSomething->methodOne(OUString(RTL_CONSTASCII_USTRINGPARAM("Hello World!"))); + OUString s = xSomething->methodOne(OUString("Hello World!")); fprintf(stdout,"\nCreate new instance of MyService1\nCall of XSomething.methOne at MyService1 = %s", OUStringToOString( s, RTL_TEXTENCODING_ASCII_US ).getStr()); // create a new instance of MyService2 with the specified string argument - xSomething = my_module::MyService2::create(xContext, OUString(RTL_CONSTASCII_USTRINGPARAM("Hello My World!"))); + xSomething = my_module::MyService2::create(xContext, OUString("Hello My World!")); // call methodTwo and print the return value of methodTwo s = xSomething->methodTwo(); diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx index 606c8385f7c0..4eb89c3cd72d 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx +++ b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx @@ -54,14 +54,14 @@ namespace my_sc_impl Sequence< OUString > SAL_CALL getSupportedServiceNames_MyService1Impl() { Sequence< OUString > names(1); - names[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("my_module.MyService1")); + names[0] = OUString("my_module.MyService1"); return names; } OUString SAL_CALL getImplementationName_MyService1Impl() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService1") ); + return OUString( + "my_module.my_sc_implementation.MyService1"); } @@ -224,8 +224,8 @@ OUString MyService1Impl::getImplementationName() throw (RuntimeException) { // unique implementation name - return OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService1") ); + return OUString( + "my_module.my_sc_implementation.MyService1"); } sal_Bool MyService1Impl::supportsService( OUString const & serviceName ) throw (RuntimeException) diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx index af999111d893..ba6bf5d29410 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx +++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx @@ -60,14 +60,14 @@ extern Reference< XInterface > SAL_CALL create_MyService1Impl( static Sequence< OUString > getSupportedServiceNames_MyService2Impl() { Sequence names(1); - names[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("my_module.MyService2")); + names[0] = OUString("my_module.MyService2"); return names; } static OUString getImplementationName_MyService2Impl() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService2") ); + return OUString( + "my_module.my_sc_implementation.MyService2"); } class MyService2Impl : public ::cppu::WeakImplHelper3< @@ -112,8 +112,8 @@ void MyService2Impl::initialize( Sequence< Any > const & args ) if (args.getLength() != 1) { throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "give a string instanciating this component!") ), + OUString( + "give a string instanciating this component!"), // resolve to XInterface reference: static_cast< ::cppu::OWeakObject * >(this), 0 ); // argument pos @@ -121,8 +121,8 @@ void MyService2Impl::initialize( Sequence< Any > const & args ) if (! (args[ 0 ] >>= m_sData)) { throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "no string given as argument!") ), + OUString( + "no string given as argument!"), // resolve to XInterface reference: static_cast< ::cppu::OWeakObject * >(this), 0 ); // argument pos @@ -150,8 +150,8 @@ OUString MyService2Impl::getImplementationName() throw (RuntimeException) { // unique implementation name - return OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService2") ); + return OUString( + "my_module.my_sc_implementation.MyService2"); } sal_Bool MyService2Impl::supportsService( OUString const & serviceName ) diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx index 71ccd97c0597..66432c73bcd4 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx @@ -208,7 +208,7 @@ void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments ) OUString FilterDetect_getImplementationName () throw (RuntimeException) { - return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "devguide.officedev.samples.filter.FlatXmlDetect" ) ); + return OUString( "devguide.officedev.samples.filter.FlatXmlDetect" ); } #define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection" diff --git a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx index 780c18ebcd5b..fe7354d48443 100644 --- a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx +++ b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx @@ -76,8 +76,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) // open a spreadsheet document Reference< XComponent > xComponent( xComponentLoader->loadComponentFromURL( - OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/scalc" ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" ) ), 0, + OUString( "private:factory/scalc" ), + OUString( "_blank" ), 0, Sequence < ::com::sun::star::beans::PropertyValue >() ) ); if ( !xComponent.is() ) { diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx index efa527c89027..057fe46ef372 100644 --- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx +++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx @@ -54,7 +54,7 @@ void BaseDispatch::ShowMessageBox( const Reference< XFrame >& rFrame, const ::rt Reference< XMessageBox > xMsgBox = xMsgBoxFactory->createMessageBox( Reference< XWindowPeer >( rFrame->getContainerWindow(), UNO_QUERY ), Rectangle(0,0,300,200), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "infobox" ) ), + rtl::OUString( "infobox" ), MessageBoxButtons::BUTTONS_OK, aTitle, aMsgText ); -- cgit