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 /extensions | |
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 'extensions')
-rw-r--r-- | extensions/source/nsplugin/source/so_main.cxx | 10 | ||||
-rw-r--r-- | extensions/source/ole/ole2uno.hxx | 1 | ||||
-rw-r--r-- | extensions/source/ole/oleobjw.cxx | 243 | ||||
-rw-r--r-- | extensions/source/ole/unoconversionutilities.hxx | 204 | ||||
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 48 | ||||
-rw-r--r-- | extensions/test/ole/OleClient/clientTest.cxx | 11 |
6 files changed, 256 insertions, 261 deletions
diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index 4a624fa6417a..5d46e353e3cd 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.cxx @@ -84,8 +84,6 @@ #include "com/sun/star/bridge/UnoUrlResolver.hpp" #include "com/sun/star/bridge/XUnoUrlResolver.hpp" -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) - using namespace ::rtl; using namespace ::osl; using namespace ::cppu; @@ -306,7 +304,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f ::rtl::OUStringBuffer buf; OUString aPath, aPluginPipeName; - if(!Bootstrap::get(OUSTR("BRAND_BASE_DIR"), aPath)) + if(!Bootstrap::get("BRAND_BASE_DIR", aPath)) { debug_fprintf(NSP_LOG_APPEND,"failed to get BRAND_BASE_DIR!\n"); return Reference< lang::XMultiServiceFactory >(NULL); @@ -323,9 +321,9 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f // arguments OUString args [] = { - OUSTR( "--nologo" ), - OUSTR( "--nodefault" ), - OUSTR( "--nolockcheck" ), + "--nologo", + "--nodefault", + "--nolockcheck", sConnectStartString, }; diff --git a/extensions/source/ole/ole2uno.hxx b/extensions/source/ole/ole2uno.hxx index 659a9cbde3a3..c7fc0a0b88e3 100644 --- a/extensions/source/ole/ole2uno.hxx +++ b/extensions/source/ole/ole2uno.hxx @@ -49,7 +49,6 @@ #include <rtl/uuid.h> #define UNO_2_OLE_EXCEPTIONCODE 1001 -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::script; diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 67135accd290..58ed1ab29950 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -181,16 +181,16 @@ Any SAL_CALL IUnknownWrapper_Impl::invokeGetProperty( const OUString& aPropertyN getPropDesc(aPropertyName, & aDescGet, & aDescPut, & aVarDesc); if ( !aDescGet ) { - OUString msg(OUSTR("[automation bridge]Property \"") + aPropertyName + - OUSTR("\" is not supported")); + OUString msg("[automation bridge]Property \"" + aPropertyName + + "\" is not supported"); throw UnknownPropertyException(msg, Reference<XInterface>()); } aResult = invokeWithDispIdComTlb( aDescGet, aPropertyName, aParams, aOutParamIndex, aOutParam ); } catch ( const Exception& e ) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::invokeGetProperty ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::invokeGetProperty ! Message : \n" + e.Message, Reference<XInterface>()); } return aResult; @@ -209,16 +209,16 @@ Any SAL_CALL IUnknownWrapper_Impl::invokePutProperty( const OUString& aPropertyN getPropDesc(aPropertyName, & aDescGet, & aDescPut, & aVarDesc); if ( !aDescPut ) { - OUString msg(OUSTR("[automation bridge]Property \"") + aPropertyName + - OUSTR("\" is not supported")); + OUString msg("[automation bridge]Property \"" + aPropertyName + + "\" is not supported"); throw UnknownPropertyException(msg, Reference<XInterface>()); } aResult = invokeWithDispIdComTlb( aDescPut, aPropertyName, aParams, aOutParamIndex, aOutParam ); } catch ( const Exception& e ) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::invokePutProperty ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::invokePutProperty ! Message : \n" + e.Message, Reference<XInterface>()); } return aResult; @@ -234,7 +234,7 @@ Any SAL_CALL IUnknownWrapper_Impl::invoke( const OUString& aFunctionName, if ( ! m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } @@ -275,16 +275,15 @@ Any SAL_CALL IUnknownWrapper_Impl::invoke( const OUString& aFunctionName, } catch (const Exception & e) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::invoke ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::invoke ! Message : \n" + e.Message, Reference<XInterface>()); } catch(...) { - throw RuntimeException( - OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::Invoke !"), Reference<XInterface>()); + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::Invoke !", Reference<XInterface>()); } return ret; } @@ -297,7 +296,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, if ( ! m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } try @@ -312,8 +311,8 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, //check if there is such a property at all or if it is read only if ( ! aDescPut && ! aDescGet && ! aVarDesc) { - OUString msg(OUSTR("[automation bridge]Property \"") + aPropertyName + - OUSTR("\" is not supported")); + OUString msg("[automation bridge]Property \"" + aPropertyName + + "\" is not supported"); throw UnknownPropertyException(msg, Reference<XInterface>()); } @@ -321,8 +320,8 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, && aVarDesc->wVarFlags == VARFLAG_FREADONLY ) { //read-only - OUString msg(OUSTR("[automation bridge] Property ") + aPropertyName + - OUSTR(" is read-only")); + OUString msg("[automation bridge] Property " + aPropertyName + + " is read-only"); OString sMsg = OUStringToOString(msg, osl_getThreadTextEncoding()); OSL_FAIL(sMsg.getStr()); // ignore silently @@ -450,16 +449,16 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, } catch (const Exception & e) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::setValue ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::setValue ! Message : \n" + e.Message, Reference<XInterface>()); } catch (...) { throw RuntimeException( - OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::setValue !"), Reference<XInterface>()); + "[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::setValue !", Reference<XInterface>()); } } @@ -469,7 +468,7 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) if ( ! m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } Any ret; @@ -524,8 +523,8 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) if ( ! aDescGet && ! aDescPut && ! aVarDesc) { //property not found - OUString msg(OUSTR("[automation bridge]Property \"") + aPropertyName + - OUSTR("\" is not supported")); + OUString msg("[automation bridge]Property \"" + aPropertyName + + "\" is not supported"); throw UnknownPropertyException(msg, Reference<XInterface>()); } // write-only should not be possible @@ -632,15 +631,15 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) } catch (const Exception & e) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::getValue ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::getValue ! Message : \n" + e.Message, Reference<XInterface>()); } catch (...) { throw RuntimeException( - OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::getValue !"), Reference<XInterface>()); + "[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::getValue !", Reference<XInterface>()); } return ret; } @@ -651,7 +650,7 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMethod( const OUString& aName ) if ( ! m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } sal_Bool ret = sal_False; @@ -683,14 +682,14 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMethod( const OUString& aName ) } catch (const Exception & e) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::hasMethod ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::hasMethod ! Message : \n" + e.Message, Reference<XInterface>()); } catch (...) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::hasMethod !"), Reference<XInterface>()); + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::hasMethod !", Reference<XInterface>()); } return ret; } @@ -700,8 +699,8 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasProperty( const OUString& aName ) { if ( ! m_spDispatch ) { - throw RuntimeException(OUSTR("[automation bridge] The object does not have an " - "IDispatch interface"), Reference<XInterface>()); + throw RuntimeException("[automation bridge] The object does not have an " + "IDispatch interface", Reference<XInterface>()); } sal_Bool ret = sal_False; try @@ -733,15 +732,15 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasProperty( const OUString& aName ) } catch (const Exception & e) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::hasProperty ! Message : \n") + + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::hasProperty ! Message : \n" + e.Message, Reference<XInterface>()); } catch (...) { - throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " - "IUnknownWrapper_Impl::hasProperty !"), Reference<XInterface>()); + throw RuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper_Impl::hasProperty !", Reference<XInterface>()); } return ret; } @@ -1031,19 +1030,19 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName, CComDispatchDriver dispDriver( pDisp); if(FAILED( dispDriver.PutPropertyByName( L"0", &varParam))) throw BridgeRuntimeError( - OUSTR("[automation bridge]IUnknownWrapper_Impl::" + "[automation bridge]IUnknownWrapper_Impl::" "invokeWithDispIdUnoTlb\n" "Could not set property \"0\" for the in/out " - "param!")); + "param!"); } } else { throw BridgeRuntimeError( - OUSTR("[automation bridge]IUnknownWrapper_Impl::" + "[automation bridge]IUnknownWrapper_Impl::" "invokeWithDispIdUnoTlb\n" - "Could not create out parameter at index: ") + + "Could not create out parameter at index: " + OUString::valueOf((sal_Int32) i)); } @@ -1163,15 +1162,15 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName, catch (IllegalArgumentException & e) { e.Message = - OUSTR("[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n" - "Could not convert return value! \n Message: \n") + e.Message; + "[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n" + "Could not convert return value! \n Message: \n" + e.Message; throw; } catch (CannotConvertException & e) { e.Message = - OUSTR("[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n" - "Could not convert return value! \n Message: \n") + e.Message; + "[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n" + "Could not convert return value! \n Message: \n" + e.Message; throw; } } @@ -1285,7 +1284,7 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument { getFuncDesc( usName, &aDescGet ); if ( !aDescGet ) - throw BridgeRuntimeError( OUSTR("[automation bridge]IUnknownWrapper_Impl::initialize() Failed to get Function or Property desc. for " ) + usName ); + throw BridgeRuntimeError( "[automation bridge]IUnknownWrapper_Impl::initialize() Failed to get Function or Property desc. for " + usName ); } // now for some funny heuristics to make basic understand what to do // a single aDescGet ( that doesn't take any params ) would be @@ -1310,7 +1309,7 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument catch( const Exception& e ) { throw RuntimeException( - OUSTR("[automation bridge] unexpected exception in IUnknownWrapper_Impl::initialiase() error message: \n") + e.Message, + "[automation bridge] unexpected exception in IUnknownWrapper_Impl::initialiase() error message: \n" + e.Message, Reference<XInterface>() ); } } @@ -1326,7 +1325,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa if ( !m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } @@ -1334,7 +1333,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa DISPID dispid; if ( !getDispid( aName, &dispid ) ) throw IllegalArgumentException( - OUSTR( "[automation bridge] The object does not have a function or property " ) + "[automation bridge] The object does not have a function or property " + aName, Reference<XInterface>(), 0); CComVariant varResult; @@ -1412,13 +1411,13 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa else if (hr == DISP_E_UNKNOWNNAME) { throw IllegalArgumentException( - OUSTR("[automation bridge]One of the named arguments is wrong!"), + "[automation bridge]One of the named arguments is wrong!", Reference<XInterface>(), 0); } else { throw InvocationTargetException( - OUSTR("[automation bridge] ITypeInfo::GetIDsOfNames returned error ") + "[automation bridge] ITypeInfo::GetIDsOfNames returned error " + OUString::valueOf((sal_Int32) hr, 16), Reference<XInterface>(), Any()); } } @@ -1503,30 +1502,30 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa case S_OK: break; case DISP_E_BADPARAMCOUNT: - throw IllegalArgumentException(OUSTR("[automation bridge] Wrong " - "number of arguments. Object returned DISP_E_BADPARAMCOUNT."), + throw IllegalArgumentException("[automation bridge] Wrong " + "number of arguments. Object returned DISP_E_BADPARAMCOUNT.", 0, 0); break; case DISP_E_BADVARTYPE: - throw RuntimeException(OUSTR("[automation bridge] One or more " + throw RuntimeException("[automation bridge] One or more " "arguments have the wrong type. Object returned " - "DISP_E_BADVARTYPE."), 0); + "DISP_E_BADVARTYPE.", 0); break; case DISP_E_EXCEPTION: - message = OUSTR("[automation bridge]: "); + message = "[automation bridge]: "; message += OUString(reinterpret_cast<const sal_Unicode*>(excepinfo.bstrDescription), ::SysStringLen(excepinfo.bstrDescription)); throw InvocationTargetException(message, Reference<XInterface>(), Any()); break; case DISP_E_MEMBERNOTFOUND: - message = OUSTR("[automation bridge]: A function with the name \"") - + aName + OUSTR("\" is not supported. Object returned " - "DISP_E_MEMBERNOTFOUND."); + message = "[automation bridge]: A function with the name \"" + + aName + "\" is not supported. Object returned " + "DISP_E_MEMBERNOTFOUND."; throw IllegalArgumentException(message, 0, 0); break; case DISP_E_NONAMEDARGS: - throw IllegalArgumentException(OUSTR("[automation bridge] Object " - "returned DISP_E_NONAMEDARGS"),0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); + throw IllegalArgumentException("[automation bridge] Object " + "returned DISP_E_NONAMEDARGS",0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); break; case DISP_E_OVERFLOW: throw CannotConvertException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[automation bridge] Call failed.")), @@ -1534,27 +1533,27 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa static_cast<XWeak*>(this)), TypeClass_UNKNOWN, FailReason::OUT_OF_RANGE, uArgErr); break; case DISP_E_PARAMNOTFOUND: - throw IllegalArgumentException(OUSTR("[automation bridge]Call failed." - "Object returned DISP_E_PARAMNOTFOUND."), + throw IllegalArgumentException("[automation bridge]Call failed." + "Object returned DISP_E_PARAMNOTFOUND.", 0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); break; case DISP_E_TYPEMISMATCH: - throw CannotConvertException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_TYPEMISMATCH"), + throw CannotConvertException("[automation bridge] Call failed. " + "Object returned DISP_E_TYPEMISMATCH", static_cast<XInterface*>( static_cast<XWeak*>(this)) , TypeClass_UNKNOWN, FailReason::UNKNOWN, uArgErr); break; case DISP_E_UNKNOWNINTERFACE: - throw RuntimeException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_UNKNOWNINTERFACE."),0); + throw RuntimeException("[automation bridge] Call failed. " + "Object returned DISP_E_UNKNOWNINTERFACE.",0); break; case DISP_E_UNKNOWNLCID: - throw RuntimeException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_UNKNOWNLCID."),0); + throw RuntimeException("[automation bridge] Call failed. " + "Object returned DISP_E_UNKNOWNLCID.",0); break; case DISP_E_PARAMNOTOPTIONAL: - throw CannotConvertException(OUSTR("[automation bridge] Call failed." - "Object returned DISP_E_PARAMNOTOPTIONAL"), + throw CannotConvertException("[automation bridge] Call failed." + "Object returned DISP_E_PARAMNOTOPTIONAL", static_cast<XInterface*>(static_cast<XWeak*>(this)), TypeClass_UNKNOWN, FailReason::NO_DEFAULT_AVAILABLE, uArgErr); break; @@ -1573,7 +1572,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa if ( ! m_spDispatch ) { throw RuntimeException( - OUSTR("[automation bridge] The object does not have an IDispatch interface"), + "[automation bridge] The object does not have an IDispatch interface", Reference<XInterface>()); } @@ -1867,13 +1866,13 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, else if (hr == DISP_E_UNKNOWNNAME) { throw IllegalArgumentException( - OUSTR("[automation bridge]One of the named arguments is wrong!"), + "[automation bridge]One of the named arguments is wrong!", Reference<XInterface>(), 0); } else { throw InvocationTargetException( - OUSTR("[automation bridge] ITypeInfo::GetIDsOfNames returned error ") + "[automation bridge] ITypeInfo::GetIDsOfNames returned error " + OUString::valueOf((sal_Int32) hr, 16), Reference<XInterface>(), Any()); } } @@ -2134,31 +2133,31 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, case S_OK: break; case DISP_E_BADPARAMCOUNT: - throw IllegalArgumentException(OUSTR("[automation bridge] Wrong " - "number of arguments. Object returned DISP_E_BADPARAMCOUNT."), + throw IllegalArgumentException("[automation bridge] Wrong " + "number of arguments. Object returned DISP_E_BADPARAMCOUNT.", 0, 0); break; case DISP_E_BADVARTYPE: - throw RuntimeException(OUSTR("[automation bridge] One or more " + throw RuntimeException("[automation bridge] One or more " "arguments have the wrong type. Object returned " - "DISP_E_BADVARTYPE."), 0); + "DISP_E_BADVARTYPE.", 0); break; case DISP_E_EXCEPTION: - message = OUSTR("[automation bridge]: "); + message = "[automation bridge]: "; message += OUString(reinterpret_cast<const sal_Unicode*>(excepinfo.bstrDescription), ::SysStringLen(excepinfo.bstrDescription)); throw InvocationTargetException(message, Reference<XInterface>(), Any()); break; case DISP_E_MEMBERNOTFOUND: - message = OUSTR("[automation bridge]: A function with the name \"") - + sFuncName + OUSTR("\" is not supported. Object returned " - "DISP_E_MEMBERNOTFOUND."); + message = "[automation bridge]: A function with the name \"" + + sFuncName + "\" is not supported. Object returned " + "DISP_E_MEMBERNOTFOUND."; throw IllegalArgumentException(message, 0, 0); break; case DISP_E_NONAMEDARGS: - throw IllegalArgumentException(OUSTR("[automation bridge] Object " - "returned DISP_E_NONAMEDARGS"),0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); + throw IllegalArgumentException("[automation bridge] Object " + "returned DISP_E_NONAMEDARGS",0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); break; case DISP_E_OVERFLOW: throw CannotConvertException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[automation bridge] Call failed.")), @@ -2166,27 +2165,27 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, static_cast<XWeak*>(this)), TypeClass_UNKNOWN, FailReason::OUT_OF_RANGE, uArgErr); break; case DISP_E_PARAMNOTFOUND: - throw IllegalArgumentException(OUSTR("[automation bridge]Call failed." - "Object returned DISP_E_PARAMNOTFOUND."), + throw IllegalArgumentException("[automation bridge]Call failed." + "Object returned DISP_E_PARAMNOTFOUND.", 0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr )); break; case DISP_E_TYPEMISMATCH: - throw CannotConvertException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_TYPEMISMATCH"), + throw CannotConvertException("[automation bridge] Call failed. " + "Object returned DISP_E_TYPEMISMATCH", static_cast<XInterface*>( static_cast<XWeak*>(this)) , TypeClass_UNKNOWN, FailReason::UNKNOWN, uArgErr); break; case DISP_E_UNKNOWNINTERFACE: - throw RuntimeException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_UNKNOWNINTERFACE."),0); + throw RuntimeException("[automation bridge] Call failed. " + "Object returned DISP_E_UNKNOWNINTERFACE.",0); break; case DISP_E_UNKNOWNLCID: - throw RuntimeException(OUSTR("[automation bridge] Call failed. " - "Object returned DISP_E_UNKNOWNLCID."),0); + throw RuntimeException("[automation bridge] Call failed. " + "Object returned DISP_E_UNKNOWNLCID.",0); break; case DISP_E_PARAMNOTOPTIONAL: - throw CannotConvertException(OUSTR("[automation bridge] Call failed." - "Object returned DISP_E_PARAMNOTOPTIONAL"), + throw CannotConvertException("[automation bridge] Call failed." + "Object returned DISP_E_PARAMNOTOPTIONAL", static_cast<XInterface*>(static_cast<XWeak*>(this)), TypeClass_UNKNOWN, FailReason::NO_DEFAULT_AVAILABLE, uArgErr); break; @@ -2223,7 +2222,7 @@ void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName, if ( ! aDescPut) { throw IllegalArgumentException( - OUSTR("[automation bridge] The object does not have a writeable property: ") + "[automation bridge] The object does not have a writeable property: " + sFuncName, Reference<XInterface>(), 0); } *pFuncDesc = aDescPut.Detach(); @@ -2243,8 +2242,8 @@ void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName, if ( ! aFuncDesc ) { throw IllegalArgumentException( - OUSTR("[automation bridge] The object does not have a function" - "or readable property \"") + "[automation bridge] The object does not have a function" + "or readable property \"" + sFuncName, Reference<XInterface>(), 0); } } @@ -2322,8 +2321,8 @@ void IUnknownWrapper_Impl::getFuncDesc(const OUString & sFuncName, FUNCDESC ** p } else { - throw BridgeRuntimeError(OUSTR("[automation bridge] Could not get " - "FUNCDESC for ") + sFuncName); + throw BridgeRuntimeError("[automation bridge] Could not get " + "FUNCDESC for " + sFuncName); } } //else no entry found for sFuncName, pFuncDesc will not be filled in @@ -2415,7 +2414,7 @@ VARTYPE IUnknownWrapper_Impl::getUserDefinedElementType( ITypeInfo* pTypeInfo, c // We use the type of the first enum value. if ( attr->cVars == 0 ) { - throw BridgeRuntimeError(OUSTR("[automation bridge] Could not obtain type description")); + throw BridgeRuntimeError("[automation bridge] Could not obtain type description"); } VarDesc var( spRefInfo ); spRefInfo->GetVarDesc( 0, &var ); @@ -2436,7 +2435,7 @@ VARTYPE IUnknownWrapper_Impl::getUserDefinedElementType( ITypeInfo* pTypeInfo, c } else { - throw BridgeRuntimeError( OUSTR("[automation bridge] Unhandled user defined type.") ); + throw BridgeRuntimeError( "[automation bridge] Unhandled user defined type." ); } } } @@ -2496,13 +2495,13 @@ void IUnknownWrapper_Impl::buildComTlbIndex() } else { - sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ - "ITypeInfo::GetNames failed."); + sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ + "ITypeInfo::GetNames failed."; } } else - sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ - "ITypeInfo::GetFuncDesc failed."); + sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ + "ITypeInfo::GetFuncDesc failed."; } //If we create an Object in JScript and a a property then it @@ -2525,19 +2524,19 @@ void IUnknownWrapper_Impl::buildComTlbIndex() } else { - sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ - "ITypeInfo::GetNames failed."); + sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ + "ITypeInfo::GetNames failed.; } } else - sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ - "ITypeInfo::GetVarDesc failed."); + sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ + "ITypeInfo::GetVarDesc failed."; } } else - sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ - "ITypeInfo::GetTypeAttr failed."); + sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \ + "ITypeInfo::GetTypeAttr failed."; if (sError.getLength()) { @@ -2554,7 +2553,7 @@ ITypeInfo* IUnknownWrapper_Impl::getTypeInfo() { if( !m_spDispatch) { - throw BridgeRuntimeError(OUSTR("The object has no IDispatch interface!")); + throw BridgeRuntimeError("The object has no IDispatch interface!"); } if( !m_spTypeInfo ) @@ -2586,8 +2585,8 @@ ITypeInfo* IUnknownWrapper_Impl::getTypeInfo() else { throw BridgeRuntimeError( - OUSTR("[automation bridge] Could not obtain type information " - "for dispatch interface." )); + "[automation bridge] Could not obtain type information " + "for dispatch interface." ); } } else if (typeAttr->typekind == TKIND_DISPATCH) @@ -2597,15 +2596,15 @@ ITypeInfo* IUnknownWrapper_Impl::getTypeInfo() else { throw BridgeRuntimeError( - OUSTR("[automation bridge] Automation object does not " - "provide type information.")); + "[automation bridge] Automation object does not " + "provide type information."); } } } else { - throw BridgeRuntimeError(OUSTR("[automation bridge]The dispatch object does not " - "support ITypeInfo!")); + throw BridgeRuntimeError("[automation bridge]The dispatch object does not " + "support ITypeInfo!"); } } } diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 5e3fcf0b5455..e38f4003cf87 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -252,8 +252,8 @@ bool convertSelfToCom( T& unoInterface, VARIANT * pVar) HRESULT hr; if (FAILED(hr = VariantCopy(pVar, pvariant))) throw BridgeRuntimeError( - OUSTR("[automation bridge] convertSelfToCom\n" - "VariantCopy failed! Error: ") + + "[automation bridge] convertSelfToCom\n" + "VariantCopy failed! Error: " + OUString::valueOf(hr)); VariantClear( pvariant); CoTaskMemFree( pvariant); @@ -309,8 +309,8 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, // There is no need to support indirect values, since they're not supported by UNO if( FAILED(hr= VariantCopyInd( &var, const_cast<VARIANTARG*>(pArg)))) // remove VT_BYREF throw BridgeRuntimeError( - OUSTR("[automation bridge] UnoConversionUtilities<T>::variantToAny \n" - "VariantCopyInd failed for reason : ") + OUString::valueOf(hr)); + "[automation bridge] UnoConversionUtilities<T>::variantToAny \n" + "VariantCopyInd failed for reason : " + OUString::valueOf(hr)); bool bHandled = convertValueObject( & var, rAny); if( bHandled) OSL_ENSURE( rAny.getValueType() == ptype, "type in Value Object must match the type parameter"); @@ -386,15 +386,15 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, catch (const IllegalArgumentException& e) { throw BridgeRuntimeError( - OUSTR("[automation bridge]com.sun.star.lang.IllegalArgumentException " - "in UnoConversionUtilities<T>::variantToAny! Message: ") + + "[automation bridge]com.sun.star.lang.IllegalArgumentException " + "in UnoConversionUtilities<T>::variantToAny! Message: " + e.Message); } catch (const CannotConvertException& e) { throw BridgeRuntimeError( - OUSTR("[automation bridge]com.sun.star.script.CannotConvertException " - "in UnoConversionUtilities<T>::variantToAny! Message: ") + + "[automation bridge]com.sun.star.script.CannotConvertException " + "in UnoConversionUtilities<T>::variantToAny! Message: " + e.Message); } } @@ -560,18 +560,18 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, } if (bCannotConvert) throw CannotConvertException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::variantToAny \n" - "Cannot convert the value of vartype :\"") + + "[automation bridge]UnoConversionUtilities<T>::variantToAny \n" + "Cannot convert the value of vartype :\"" + OUString::valueOf((sal_Int32) var.vt) + - OUSTR("\" to the expected UNO type of type class: ") + + "\" to the expected UNO type of type class: " + OUString::valueOf((sal_Int32) ptype.getTypeClass()), 0, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0); if (bFail) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>:variantToAny\n" - "The provided VARIANT of type\" ") + OUString::valueOf((sal_Int32) var.vt) + - OUSTR("\" is unappropriate for conversion!"), Reference<XInterface>(), -1); + "[automation bridge]UnoConversionUtilities<T>:variantToAny\n" + "The provided VARIANT of type\" " + OUString::valueOf((sal_Int32) var.vt) + + "\" is unappropriate for conversion!", Reference<XInterface>(), -1); } catch (const CannotConvertException &) { @@ -587,15 +587,15 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, } catch (const Exception & e) { - throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::variantToAny ! Message : \n") + + throw BridgeRuntimeError("[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::variantToAny ! Message : \n" + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::variantToAny !")); + "[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::variantToAny !"); } } @@ -634,26 +634,26 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny, { if (hr == DISP_E_TYPEMISMATCH) throw CannotConvertException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Cannot convert the value of type :\"") + + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Cannot convert the value of type :\"" + rAny.getValueTypeName() + - OUSTR("\" to the expected Automation type of VARTYPE: ") + + "\" to the expected Automation type of VARTYPE: " + OUString::valueOf((sal_Int32)type), 0, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0); throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Conversion of any with ") + + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Conversion of any with + rAny.getValueType().getTypeName() + - OUSTR(" to VARIANT with type: ") + OUString::valueOf((sal_Int32) type) + - OUSTR(" failed! Error code: ") + OUString::valueOf(hr)); + " to VARIANT with type: " + OUString::valueOf((sal_Int32) type) + + " failed! Error code: " + OUString::valueOf(hr)); } if(FAILED(hr = VariantCopy(pVariant, &var))) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "VariantCopy failed for reason: ") + OUString::valueOf(hr)); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "VariantCopy failed for reason: " + OUString::valueOf(hr)); } } } @@ -672,14 +672,14 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny, catch(const Exception & e) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Unexpected exception occurred. Message: ") + e.Message); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Unexpected exception occurred. Message: " + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Unexpected exception occurred.")); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Unexpected exception occurred."); } } @@ -788,8 +788,8 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) if (FAILED(hr = VariantClear(pVariant))) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" - "VariantClear failed with error:") + OUString::valueOf(hr)); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" + "VariantClear failed with error:" + OUString::valueOf(hr)); } break; } @@ -945,13 +945,13 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) CComVariant var; if (createUnoTypeWrapper(type.getTypeName(), & var) == false) throw BridgeRuntimeError( - OUSTR("[automation bridge] UnoConversionUtilities<T>::anyToVariant \n" - "Error during conversion of UNO type to Automation object!")); + "[automation bridge] UnoConversionUtilities<T>::anyToVariant \n" + "Error during conversion of UNO type to Automation object!"); if (FAILED(VariantCopy(pVariant, &var))) throw BridgeRuntimeError( - OUSTR("[automation bridge] UnoConversionUtilities<T>::anyToVariant \n" - "Unexpected error!")); + "[automation bridge] UnoConversionUtilities<T>::anyToVariant \n" + "Unexpected error!"); break; } default: @@ -970,10 +970,10 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) // TypeClass_UNSIGNED_BYTE: // TypeClass_MODULE: throw CannotConvertException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" + "[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" "There is no conversion for this UNO type to a Automation type." "The destination type class is the type class of the UNO " - "argument which was to be converted."), + "argument which was to be converted.", Reference<XInterface>(), rAny.getValueTypeClass(), FailReason::TYPE_NOT_SUPPORTED, 0); @@ -982,9 +982,9 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) if (bIllegal) { throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" - "The provided any of type\" ") + rAny.getValueType().getTypeName() + - OUSTR("\" is unappropriate for conversion!"), Reference<XInterface>(), -1); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" + "The provided any of type\" " + rAny.getValueType().getTypeName() + + "\" is unappropriate for conversion!", Reference<XInterface>(), -1); } } @@ -1003,14 +1003,14 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) catch(const Exception & e) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Unexpected exception occurred. Message: ") + e.Message); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Unexpected exception occurred. Message: " + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" - "Unexpected exception occurred. ") ); + "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" + "Unexpected exception occurred. " ); } } @@ -1022,12 +1022,12 @@ SAFEARRAY* UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq, { if (rSeq.getValueTypeClass() != TypeClass_SEQUENCE) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper \n" - "The any does not contain a sequence!"), 0, 0); + "[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper \n" + "The any does not contain a sequence!", 0, 0); if (elemtype == VT_NULL || elemtype == VT_EMPTY) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper \n" - "No element type supplied!"),0, -1); + "[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper \n" + "No element type supplied!",0, -1); SAFEARRAY* pArray= NULL; // Get the dimensions. This is done by examining the type name string // The count of brackets determines the dimensions. @@ -1293,8 +1293,8 @@ SAFEARRAY* UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq) if( rSeq.getValueTypeClass() != TypeClass_SEQUENCE ) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper\n" - "The UNO argument is not a sequence"), 0, -1); + "[automation bridge]UnoConversionUtilities<T>::createUnoSequenceWrapper\n" + "The UNO argument is not a sequence", 0, -1); uno_Sequence * punoSeq= *(uno_Sequence**) rSeq.getValue(); @@ -1358,16 +1358,16 @@ void UnoConversionUtilities<T>::createUnoObjectWrapper(const Any & rObj, VARIANT TypeClass tc = rObj.getValueTypeClass(); if (tc != TypeClass_INTERFACE && tc != TypeClass_STRUCT) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createUnoObjectWrapper \n" + "[automation bridge]UnoConversionUtilities<T>::createUnoObjectWrapper \n" "Cannot create an Automation interface for a UNO type which is not " - "a struct or interface!"), 0, -1); + "a struct or interface!", 0, -1); if (rObj.getValueTypeClass() == TypeClass_INTERFACE) { if (! (rObj >>= xInt)) throw IllegalArgumentException( - OUSTR("[automation bridge] UnoConversionUtilities<T>::createUnoObjectWrapper\n " - "Could not create wrapper object for UNO object!"), 0, -1); + "[automation bridge] UnoConversionUtilities<T>::createUnoObjectWrapper\n " + "Could not create wrapper object for UNO object!", 0, -1); //If XInterface is NULL, which is a valid value, then simply return NULL. if ( ! xInt.is()) { @@ -1470,8 +1470,8 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny // There is no need to support indirect values, since they're not supported by UNO if( FAILED(hr= VariantCopyInd( &var, const_cast<VARIANTARG*>(pVariant)))) // remove VT_BYREF throw BridgeRuntimeError( - OUSTR("[automation bridge] UnoConversionUtilities<T>::variantToAny \n" - "VariantCopyInd failed for reason : ") + OUString::valueOf(hr)); + "[automation bridge] UnoConversionUtilities<T>::variantToAny \n" + "VariantCopyInd failed for reason : " + OUString::valueOf(hr)); if ( ! convertValueObject( & var, rAny)) { @@ -1539,15 +1539,15 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny CComBSTR sName; if (FAILED(spType->get_Name(&sName))) throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::variantToAny \n" - "Failed to get the type name from a UnoTypeWrapper!")); + "[automation bridge]UnoConversionUtilities<T>::variantToAny \n" + "Failed to get the type name from a UnoTypeWrapper!"); Type type; if (getType(sName, type) == false) { throw CannotConvertException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::variantToAny \n" - "A UNO type with the name: ") + OUString(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))) + - OUSTR("does not exist!"), + "[automation bridge]UnoConversionUtilities<T>::variantToAny \n" + "A UNO type with the name: " + OUString(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))) + + "does not exist!", 0, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0); } rAny <<= type; @@ -1623,15 +1623,15 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny } catch (const Exception & e) { - throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::variantToAny ! Message : \n") + + throw BridgeRuntimeError("[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::variantToAny ! Message : \n" + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::variantToAny !")); + "[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::variantToAny !"); } } @@ -1668,8 +1668,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& //To allow passing "Nothing" in VS 2008 we need to accept VT_EMPTY if (pVar->vt != VT_UNKNOWN && pVar->vt != VT_DISPATCH && pVar->vt != VT_EMPTY) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" - "The VARIANT does not contain an object type! "), 0, -1); + "[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" + "The VARIANT does not contain an object type! ", 0, -1); MutexGuard guard( getBridgeMutex()); @@ -1794,8 +1794,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& ret = xIntWrapper->queryInterface(desiredType); if ( ! ret.hasValue()) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" - "The COM object is not suitable for the UNO type: ") + + "[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" + "The COM object is not suitable for the UNO type: " + desiredType.getTypeName(), 0, -1); } else @@ -1805,8 +1805,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& ret = xIntAdapter->queryInterface( desiredType); if ( ! ret.hasValue()) throw IllegalArgumentException( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" - "The COM object is not suitable for the UNO type: ") + + "[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" + "The COM object is not suitable for the UNO type: " + desiredType.getTypeName(), 0, -1); } @@ -1825,8 +1825,8 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& Reference<XInterface> xIntNewProxy= createComWrapperInstance(); if ( ! xIntNewProxy.is()) throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" - "Could not create proxy object for COM object!")); + "[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" + "Could not create proxy object for COM object!"); // initialize the COM wrapper Reference<XInitialization> xInit( xIntNewProxy, UNO_QUERY); @@ -1893,8 +1893,8 @@ Reference<XInterface> UnoConversionUtilities<T>::createAdapter(const Sequence<Ty else { throw BridgeRuntimeError( - OUSTR("[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" - "Could not create a proxy for COM object! Creation of adapter failed.")); + "[automation bridge]UnoConversionUtilities<T>::createOleObjectWrapper \n" + "Could not create a proxy for COM object! Creation of adapter failed."); } return xIntAdapted; } @@ -1953,7 +1953,7 @@ bool UnoConversionUtilities<T>::convertValueObject( const VARIANTARG *var, Any& if (bFail) throw BridgeRuntimeError( - OUSTR("[automation bridge] Conversion of ValueObject failed ")); + "[automation bridge] Conversion of ValueObject failed "); } catch (const BridgeRuntimeError &) { @@ -1961,15 +1961,15 @@ bool UnoConversionUtilities<T>::convertValueObject( const VARIANTARG *var, Any& } catch (const Exception & e) { - throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::convertValueObject ! Message : \n") + + throw BridgeRuntimeError("[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::convertValueObject ! Message : \n" + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::convertValueObject !")); + "[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::convertValueObject !"); } return ret; } @@ -1981,14 +1981,14 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva { bool bFail = false; if( pvar->vt != VT_DISPATCH) - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); IDispatchEx* pdispEx; HRESULT hr; if( FAILED( hr= pvar->pdispVal->QueryInterface( IID_IDispatchEx, reinterpret_cast<void**>( &pdispEx)))) - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); DISPID dispid; OUString sindex; @@ -2000,15 +2000,15 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva // Get the length of the array. Can also be obtained throu GetNextDispID. The // method only returns DISPIDs of the array data. Their names are like "0", "1" etc. if( FAILED( hr= pdispEx->GetIDsOfNames(IID_NULL, &sLength , 1, LOCALE_USER_DEFAULT, &dispid))) - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); if( FAILED( hr= pdispEx->InvokeEx(dispid, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, ¶m, &result, NULL, NULL))) - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); if( FAILED( VariantChangeType( &result, &result, 0, VT_I4))) - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); long length= result.lVal; result.Clear(); @@ -2042,14 +2042,14 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva if( FAILED( hr= pdispEx->GetIDsOfNames(IID_NULL, &sindex , 1, LOCALE_USER_DEFAULT, &dispid))) { - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); } if( FAILED( hr= pdispEx->InvokeEx(dispid, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, ¶m, &result, NULL, NULL))) { - throw BridgeRuntimeError(OUSTR("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" - "Conversion of dispatch object to Sequence failed!")); + throw BridgeRuntimeError("[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \n" + "Conversion of dispatch object to Sequence failed!"); } // If the result is VT_DISPATCH than the Sequence's element type could be Sequence @@ -2094,7 +2094,7 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva if (bFail) throw BridgeRuntimeError( - OUSTR("[automation bridge] Conversion of ValueObject failed ")); + "[automation bridge] Conversion of ValueObject failed "); } catch (const BridgeRuntimeError &) { @@ -2102,15 +2102,15 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva } catch (const Exception & e) { - throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::convertValueObject ! Message : \n") + + throw BridgeRuntimeError("[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::convertValueObject ! Message : \n" + e.Message); } catch(...) { throw BridgeRuntimeError( - OUSTR("[automation bridge] unexpected exception in " - "UnoConversionUtilities<T>::convertValueObject !")); + "[automation bridge] unexpected exception in " + "UnoConversionUtilities<T>::convertValueObject !"); } } @@ -2367,7 +2367,7 @@ Reference<XTypeConverter> UnoConversionUtilities<T>::getTypeConverter() if ( ! m_typeConverter.is()) { Reference<XInterface> xIntConverter = - m_smgr->createInstance(OUSTR("com.sun.star.script.Converter")); + m_smgr->createInstance("com.sun.star.script.Converter"); if (xIntConverter.is()) m_typeConverter = Reference<XTypeConverter>(xIntConverter, UNO_QUERY); } diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index a391d64a907d..b4cacc970e10 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -358,8 +358,8 @@ void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id, InvocationInfo info; if( ! getInvocationInfoForCall( id, info)) throw BridgeRuntimeError( - OUSTR("[automation bridge]InterfaceOleWrapper_Impl::convertDispparamsArgs \n" - "Could not obtain type information for current call.")); + "[automation bridge]InterfaceOleWrapper_Impl::convertDispparamsArgs \n" + "Could not obtain type information for current call."); for (int i = 0; i < countArgs; i++) { @@ -401,8 +401,8 @@ void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id, if( FAILED( hr)) { throw BridgeRuntimeError( - OUSTR("[automation bridge] Could not determine " - "if the object has a member \"0\". Error: ") + + "[automation bridge] Could not determine " + + "if the object has a member \"0\". Error: " + OUString::valueOf(hr)); } } @@ -878,15 +878,15 @@ STDMETHODIMP InterfaceOleWrapper_Impl::Invoke(DISPID dispidMember, } catch(const Exception& e) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::Invoke : \n") + + OUString message= "InterfaceOleWrapper_Impl::Invoke : \n" + e.Message; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } catch(...) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::Invoke : \n" - "Unexpected exception"); + OUString message= "InterfaceOleWrapper_Impl::Invoke : \n" + + "Unexpected exception"; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } @@ -955,7 +955,7 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT * Exception excTarget; org >>= excTarget; OUString message= - org.getValueType().getTypeName() + OUSTR(": ") + excTarget.Message; + org.getValueType().getTypeName() + ": " + excTarget.Message; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } @@ -971,15 +971,15 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT * } catch(const Exception & e) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::doInvoke : \n") + + OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n" + e.Message; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } catch( ... ) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::doInvoke : \n" - "Unexpected exception"); + OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n" + + "Unexpected exception"; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } @@ -1011,14 +1011,14 @@ HRESULT InterfaceOleWrapper_Impl::doGetProperty( DISPPARAMS * /*pdispparams*/, V } catch(const Exception& e) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::doGetProperty : \n") + + OUString message= "InterfaceOleWrapper_Impl::doGetProperty : \n" + e.Message; writeExcepinfo(pexcepinfo, message); } catch( ... ) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::doInvoke : \n" - "Unexpected exception"); + OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n" + + "Unexpected exception"); writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } @@ -1151,15 +1151,15 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s if (getType(arg.bstrVal, type) == false) { writeExcepinfo(pexcepinfo,OUString( - OUSTR("[automation bridge] A UNO type with the name ") + - OUString(reinterpret_cast<const sal_Unicode*>(arg.bstrVal)) + OUSTR(" does not exist!"))); + "[automation bridge] A UNO type with the name " + + OUString(reinterpret_cast<const sal_Unicode*>(arg.bstrVal)) + " does not exist!")); return DISP_E_EXCEPTION; } if (createUnoTypeWrapper(arg.bstrVal, pvarResult) == false) { - writeExcepinfo(pexcepinfo,OUSTR("[automation bridge] InterfaceOleWrapper_Impl::InvokeGeneral\n" - "Could not initialize UnoTypeWrapper object!")); + writeExcepinfo(pexcepinfo, "[automation bridge] InterfaceOleWrapper_Impl::InvokeGeneral\n" + + "Could not initialize UnoTypeWrapper object!"); return DISP_E_EXCEPTION; } } @@ -1171,15 +1171,15 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s } catch(const Exception & e) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::InvokeGeneral : \n") + + OUString message= "InterfaceOleWrapper_Impl::InvokeGeneral : \n" + e.Message; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } catch( ... ) { - OUString message= OUSTR("InterfaceOleWrapper_Impl::InvokeGeneral : \n" - "Unexpected exception"); + OUString message= "InterfaceOleWrapper_Impl::InvokeGeneral : \n" + + "Unexpected exception"; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } @@ -1572,15 +1572,15 @@ STDMETHODIMP UnoObjectWrapperRemoteOpt::Invoke ( DISPID dispidMember, REFIID /* } catch(const Exception& e) { - OUString message= OUSTR("UnoObjectWrapperRemoteOpt::Invoke : \n") + + OUString message= "UnoObjectWrapperRemoteOpt::Invoke : \n" + e.Message; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } catch(...) { - OUString message= OUSTR("UnoObjectWrapperRemoteOpt::Invoke : \n" - "Unexpected exception"); + OUString message= "UnoObjectWrapperRemoteOpt::Invoke : \n" + + "Unexpected exception"; writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } diff --git a/extensions/test/ole/OleClient/clientTest.cxx b/extensions/test/ole/OleClient/clientTest.cxx index 05b47d1b951f..6aca362f9c65 100644 --- a/extensions/test/ole/OleClient/clientTest.cxx +++ b/extensions/test/ole/OleClient/clientTest.cxx @@ -40,7 +40,6 @@ CComModule _Module; #include <cppuhelper/servicefactory.hxx> #include <rtl/string.h> -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) BEGIN_OBJECT_MAP(ObjectMap) END_OBJECT_MAP() @@ -607,15 +606,15 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) //hasProperty, hasMethod - if (inv->hasProperty(OUSTR("prpMultiArg1"))) + if (inv->hasProperty("prpMultiArg1")) return false; - if ( ! inv->hasMethod(OUSTR("prpMultiArg1"))) + if ( ! inv->hasMethod("prpMultiArg1")) return false; - if ( ! inv->hasProperty(OUSTR("prprefLong"))) + if ( ! inv->hasProperty("prprefLong")) return false; - if (inv->hasMethod(OUSTR("prprefLong"))) + if (inv->hasMethod("prprefLong")) return false; - if ( ! inv->hasMethod(OUSTR("inLong"))) + if ( ! inv->hasMethod("inLong")) return false; return true; |