diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-01-30 11:44:23 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-30 12:54:40 +0000 |
commit | 97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch) | |
tree | a1a95b8249052d846a997ad1729758168d6a3b24 /cli_ure/source | |
parent | f8569cd9a28a3a8856dba4ad53218aa6cc073521 (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 'cli_ure/source')
-rw-r--r-- | cli_ure/source/climaker/climaker_app.cxx | 60 | ||||
-rw-r--r-- | cli_ure/source/climaker/climaker_emit.cxx | 18 | ||||
-rwxr-xr-x | cli_ure/source/climaker/climaker_share.h | 2 | ||||
-rw-r--r-- | cli_ure/source/native/native_share.h | 10 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_base.h | 6 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_bridge.cxx | 6 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_data.cxx | 6 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_proxy.cxx | 6 |
8 files changed, 54 insertions, 60 deletions
diff --git a/cli_ure/source/climaker/climaker_app.cxx b/cli_ure/source/climaker/climaker_app.cxx index 5294d93a97bf..151c7ab81889 100644 --- a/cli_ure/source/climaker/climaker_app.cxx +++ b/cli_ure/source/climaker/climaker_app.cxx @@ -238,14 +238,14 @@ static OUString path_make_absolute_file_url( OUString const & path ) else { throw RuntimeException( - OUSTR("cannot make absolute: ") + file_url, + "cannot make absolute: " + file_url, Reference< XInterface >() ); } } else { throw RuntimeException( - OUSTR("cannot get file url from system path: ") + path, + "cannot get file url from system path: " + path, Reference< XInterface >() ); } } @@ -258,7 +258,7 @@ Reference< registry::XSimpleRegistry > open_registries( if (registries.empty()) { throw RuntimeException( - OUSTR("no registries given!"), + "no registries given!", Reference< XInterface >() ); } @@ -267,13 +267,13 @@ Reference< registry::XSimpleRegistry > open_registries( { Reference< registry::XSimpleRegistry > xReg( xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.registry.SimpleRegistry"), xContext ), + "com.sun.star.registry.SimpleRegistry", xContext ), UNO_QUERY_THROW ); xReg->open( registries[ nPos ], sal_True, sal_False ); if (! xReg->isValid()) { throw RuntimeException( - OUSTR("invalid registry: ") + registries[ nPos ], + "invalid registry: " + registries[ nPos ], Reference< XInterface >() ); } @@ -281,7 +281,7 @@ Reference< registry::XSimpleRegistry > open_registries( { Reference< registry::XSimpleRegistry > xNested( xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.registry.NestedRegistry"), xContext ), + "com.sun.star.registry.NestedRegistry", xContext ), UNO_QUERY_THROW ); Reference< lang::XInitialization > xInit( xNested, UNO_QUERY_THROW ); @@ -320,33 +320,33 @@ SAL_IMPLEMENT_MAIN() try { OptionInfo const * info_help = - get_option_info( OUSTR("help") ); + get_option_info( "help" ); OptionInfo const * info_verbose = - get_option_info( OUSTR("verbose") ); + get_option_info( "verbose" ); OptionInfo const * info_out = - get_option_info( OUSTR("out") ); + get_option_info( "out" ); OptionInfo const * info_types = - get_option_info( OUSTR("types") ); + get_option_info( "types" ); OptionInfo const * info_reference = - get_option_info( OUSTR("reference") ); + get_option_info( "reference" ); OptionInfo const * info_extra = - get_option_info( OUSTR("extra") ); + get_option_info( "extra" ); OptionInfo const * info_keyfile = - get_option_info( OUSTR("keyfile") ); + get_option_info( "keyfile" ); OptionInfo const * info_delaySign = - get_option_info( OUSTR("delaySign") ); + get_option_info( "delaySign" ); OptionInfo const * info_version = - get_option_info( OUSTR("assembly-version") ); + get_option_info( "assembly-version" ); OptionInfo const * info_product = - get_option_info( OUSTR("assembly-product") ); + get_option_info( "assembly-product" ); OptionInfo const * info_description = - get_option_info( OUSTR("assembly-description") ); + get_option_info( "assembly-description" ); OptionInfo const * info_company = - get_option_info( OUSTR("assembly-company") ); + get_option_info( "assembly-company" ); OptionInfo const * info_copyright = - get_option_info( OUSTR("assembly-copyright") ); + get_option_info( "assembly-copyright" ); OptionInfo const * info_trademark = - get_option_info( OUSTR("assembly-trademark") ); + get_option_info( "assembly-trademark" ); OUString output; vector< OUString > mandatory_registries; @@ -455,23 +455,23 @@ SAL_IMPLEMENT_MAIN() xContext = ::cppu::defaultBootstrap_InitialComponentContext(); Reference< container::XHierarchicalNameAccess > xTDmgr( xContext->getValueByName( - OUSTR("/singletons/com.sun.star.reflection." - "theTypeDescriptionManager") ), + "/singletons/com.sun.star.reflection." + "theTypeDescriptionManager" ), UNO_QUERY_THROW ); // get rdb tdprovider factory Reference< lang::XSingleComponentFactory > xTDprov_factory( ::cppu::loadSharedLibComponentFactory( - OUSTR("bootstrap.uno" SAL_DLLEXTENSION), OUString(), - OUSTR("com.sun.star.comp.stoc.RegistryTypeDescriptionProvider"), + "bootstrap.uno" SAL_DLLEXTENSION, OUString(), + "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider", Reference< lang::XMultiServiceFactory >( xContext->getServiceManager(), UNO_QUERY ), Reference< registry::XRegistryKey >() ), UNO_QUERY ); if (! xTDprov_factory.is()) { throw RuntimeException( - OUSTR("cannot get registry typedescription provider: " - "bootstrap.uno" SAL_DLLEXTENSION "!"), + "cannot get registry typedescription provider: " + "bootstrap.uno" SAL_DLLEXTENSION "!", Reference< XInterface >() ); } @@ -508,7 +508,7 @@ SAL_IMPLEMENT_MAIN() } else { - output = OUSTR("cli_unotypes"); + output = "cli_unotypes"; } } output = path_make_absolute_file_url( output ); @@ -518,7 +518,7 @@ SAL_IMPLEMENT_MAIN() output.copy( 0, slash ), sys_output_dir )) { throw RuntimeException( - OUSTR("cannot get system path from file url ") + + "cannot get system path from file url " + output.copy( 0, slash ), Reference< XInterface >() ); } @@ -526,7 +526,7 @@ SAL_IMPLEMENT_MAIN() sal_Int32 dot = filename.lastIndexOf( '.' ); OUString name( filename ); if (dot < 0) // has no extension - filename += OUSTR(".dll"); + filename += ".dll"; else name = name.copy( 0, dot ); ::System::String ^ output_dir = ustring_to_String( sys_output_dir ); @@ -545,7 +545,7 @@ SAL_IMPLEMENT_MAIN() } catch (System::IO::FileNotFoundException ^ ) { - throw Exception(OUSTR("Could not find the keyfile. Verify the --keyfile argument!"), 0); + throw Exception("Could not find the keyfile. Verify the --keyfile argument!", 0); } } else diff --git a/cli_ure/source/climaker/climaker_emit.cxx b/cli_ure/source/climaker/climaker_emit.cxx index 1eb1f9f1e1eb..cb4e427d7904 100644 --- a/cli_ure/source/climaker/climaker_emit.cxx +++ b/cli_ure/source/climaker/climaker_emit.cxx @@ -89,7 +89,7 @@ static inline ::System::Object ^ to_cli_constant( Any const & value ) value.getValue() )); default: throw RuntimeException( - OUSTR("unexpected constant type ") + + "unexpected constant type " + value.getValueType().getTypeName(), Reference< XInterface >() ); } @@ -1030,7 +1030,7 @@ Assembly ^ TypeEmitter::type_resolve( // getter Emit::MethodBuilder ^ method_builder = type_builder->DefineMethod( - ustring_to_String( OUSTR("get_") + + ustring_to_String( "get_" + xAttribute->getMemberName() ), c_property_method_attr, attribute_type, parameters ); @@ -1049,7 +1049,7 @@ Assembly ^ TypeEmitter::type_resolve( parameters[ 0 ] = attribute_type; method_builder = type_builder->DefineMethod( - ustring_to_String( OUSTR("set_") + + ustring_to_String( "set_" + xAttribute->getMemberName() ), c_property_method_attr, nullptr, parameters ); // define parameter info @@ -1140,9 +1140,9 @@ Assembly ^ TypeEmitter::type_resolve( const OUString sType(entry->m_xType->getName()); const OUString sMemberName(pseq_member_names[i]); if ( ! pseq_members[i].is()) - throw RuntimeException(OUSTR("Missing type description . Check if you need to " \ - "specify additional RDBs with the --extra option. Type missing for: ") + sType + - OUSTR("::") + sMemberName,0); + throw RuntimeException("Missing type description . Check if you need to " + + "specify additional RDBs with the --extra option. Type missing for: " + sType + + "::" + sMemberName,0); } sal_Int32 all_members_length = 0; @@ -1265,7 +1265,7 @@ Assembly ^ TypeEmitter::type_resolve( else { throw RuntimeException( - OUSTR("unexpected member type in ") + entry->m_xType->getName(), + "unexpected member type in " + entry->m_xType->getName(), Reference< XInterface >() ); } } @@ -2153,7 +2153,7 @@ Emit::CustomAttributeBuilder^ TypeEmitter::get_exception_attribute( return nullptr; default: throw RuntimeException( - OUSTR("unexpected type ") + xType->getName(), + "unexpected type " + xType->getName(), Reference< XInterface >() ); } } @@ -2287,7 +2287,7 @@ resolveInterfaceTypedef( type, UNO_QUERY); if (xIndTd.is() == sal_False) throw css::uno::Exception( - OUSTR("resolveInterfaceTypedef was called with an invalid argument"), 0); + "resolveInterfaceTypedef was called with an invalid argument", 0); return resolveInterfaceTypedef(xIndTd->getReferencedType()); } diff --git a/cli_ure/source/climaker/climaker_share.h b/cli_ure/source/climaker/climaker_share.h index f6e987f45777..b1d1b09c5dac 100755 --- a/cli_ure/source/climaker/climaker_share.h +++ b/cli_ure/source/climaker/climaker_share.h @@ -31,8 +31,6 @@ #include "com/sun/star/reflection/XSingletonTypeDescription2.hpp" #include "com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp" -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) - namespace climaker { diff --git a/cli_ure/source/native/native_share.h b/cli_ure/source/native/native_share.h index 23977dfb0f00..e4aa0cf6babf 100644 --- a/cli_ure/source/native/native_share.h +++ b/cli_ure/source/native/native_share.h @@ -25,8 +25,6 @@ #include <vcclr.h> -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) - namespace uno { @@ -51,12 +49,12 @@ inline ::System::Object ^ to_cli( ::com::sun::star::uno::Reference< T > const & x ) { ::com::sun::star::uno::Mapping mapping( - OUSTR(CPPU_CURRENT_LANGUAGE_BINDING_NAME), OUSTR(UNO_LB_CLI) ); + CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_CLI ); OSL_ASSERT( mapping.is() ); if (! mapping.is()) { throw ::com::sun::star::uno::RuntimeException( - OUSTR("cannot get mapping from C++ to CLI!"), + "cannot get mapping from C++ to CLI!", ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); } @@ -75,12 +73,12 @@ inline void to_uno( ::com::sun::star::uno::Reference< T > * pRet, ::System::Object ^ x ) { ::com::sun::star::uno::Mapping mapping( - OUSTR(UNO_LB_CLI), OUSTR(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); + UNO_LB_CLI, CPPU_CURRENT_LANGUAGE_BINDING_NAME ); OSL_ASSERT( mapping.is() ); if (! mapping.is()) { throw ::com::sun::star::uno::RuntimeException( - OUSTR("cannot get mapping from CLI to C++!"), + "cannot get mapping from CLI to C++!", ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); } diff --git a/cli_ure/source/uno_bridge/cli_base.h b/cli_ure/source/uno_bridge/cli_base.h index 505790b132b6..b03504fcc90c 100644 --- a/cli_ure/source/uno_bridge/cli_base.h +++ b/cli_ure/source/uno_bridge/cli_base.h @@ -34,8 +34,6 @@ struct _oslMutexImpl #using <system.dll> -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) - namespace cli_uno { System::Type^ loadCliType(System::String ^ typeName); @@ -133,7 +131,7 @@ inline ::std::auto_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes ) { void * p = rtl_allocateMemory( bytes ); if (0 == p) - throw BridgeRuntimeError(OUSTR("out of memory!") ); + throw BridgeRuntimeError("out of memory!" ); return ::std::auto_ptr< rtl_mem >( (rtl_mem *)p ); } @@ -161,7 +159,7 @@ inline TypeDescr::TypeDescr( typelib_TypeDescriptionReference * td_ref ) if (0 == m_td) { throw BridgeRuntimeError( - OUSTR("cannot get comprehensive type description for ") + + "cannot get comprehensive type description for " + *reinterpret_cast< ::rtl::OUString const * >( &td_ref->pTypeName ) ); } } diff --git a/cli_ure/source/uno_bridge/cli_bridge.cxx b/cli_ure/source/uno_bridge/cli_bridge.cxx index 4d6a4e3a2ddb..ef9fd01b732c 100644 --- a/cli_ure/source/uno_bridge/cli_bridge.cxx +++ b/cli_ure/source/uno_bridge/cli_bridge.cxx @@ -90,7 +90,7 @@ void SAL_CALL Mapping_cli2uno( #if OSL_DEBUG_LEVEL >= 1 OString cstr_msg( OUStringToOString( - OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); + "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); OSL_FAIL( cstr_msg.getStr() ); #else (void) err; // unused @@ -149,7 +149,7 @@ void SAL_CALL Mapping_uno2cli( #if OSL_DEBUG_LEVEL >= 1 rtl::OString cstr_msg( rtl::OUStringToOString( - OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); + "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); OSL_FAIL( cstr_msg.getStr() ); #else (void) err; // unused @@ -329,7 +329,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping( #if OSL_DEBUG_LEVEL >= 1 OString cstr_msg( OUStringToOString( - OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); + "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) ); OSL_FAIL( cstr_msg.getStr() ); #else (void) err; // unused diff --git a/cli_ure/source/uno_bridge/cli_data.cxx b/cli_ure/source/uno_bridge/cli_data.cxx index 373e4bf10a5f..48ad72c7a1a6 100644 --- a/cli_ure/source/uno_bridge/cli_data.cxx +++ b/cli_ure/source/uno_bridge/cli_data.cxx @@ -647,7 +647,7 @@ OUString mapCliTypeName(System::String^ typeName) { if (!bRightBracket) throw BridgeRuntimeError( - OUSTR("Typename is wrong. No matching brackets for sequence. Name is: ") + + "Typename is wrong. No matching brackets for sequence. Name is: " + mapCliString(typeName)); bRightBracket = false; dims ++; @@ -656,7 +656,7 @@ OUString mapCliTypeName(System::String^ typeName) { if (bRightBracket) throw BridgeRuntimeError( - OUSTR("Typename is wrong. No matching brackets for sequence. Name is: ") + + "Typename is wrong. No matching brackets for sequence. Name is: " + mapCliString(typeName)); break; } @@ -665,7 +665,7 @@ OUString mapCliTypeName(System::String^ typeName) if (bRightBracket || cur < 0) throw BridgeRuntimeError( - OUSTR("Typename is wrong. ") + + "Typename is wrong. " + mapCliString(typeName)); typeName = typeName->Substring(0, cur + 1); diff --git a/cli_ure/source/uno_bridge/cli_proxy.cxx b/cli_ure/source/uno_bridge/cli_proxy.cxx index 61c3036ee14d..0aa031161daa 100644 --- a/cli_ure/source/uno_bridge/cli_proxy.cxx +++ b/cli_ure/source/uno_bridge/cli_proxy.cxx @@ -1061,7 +1061,7 @@ void SAL_CALL cli_proxy_dispatch( != demanded_td.get()->eTypeClass) { throw BridgeRuntimeError( - OUSTR("queryInterface() call demands an INTERFACE type!")); + "queryInterface() call demands an INTERFACE type!"); } uno_Interface * pInterface = 0; @@ -1139,7 +1139,7 @@ void SAL_CALL cli_proxy_dispatch( default: { throw BridgeRuntimeError( - OUSTR("illegal member type description!") ); + "illegal member type description!" ); } } } @@ -1147,7 +1147,7 @@ void SAL_CALL cli_proxy_dispatch( { // binary identical struct ::com::sun::star::uno::RuntimeException exc( - OUSTR("[cli_uno bridge error] ") + err.m_message, + "[cli_uno bridge error] " + err.m_message, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); ::com::sun::star::uno::Type const & exc_type = ::getCppuType( & exc); |