Kaydet (Commit) f863d260 authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Noel Grandin

fdo#57950 Replace chained append() with operator+

Replaced all in cli_ure

Change-Id: I144542f386fe26444c290edd9e23b26cb07941a6
Reviewed-on: https://gerrit.libreoffice.org/15040Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 25c5bf88
...@@ -368,12 +368,7 @@ SAL_IMPLEMENT_MAIN() ...@@ -368,12 +368,7 @@ SAL_IMPLEMENT_MAIN()
} }
if (option_info == 0) if (option_info == 0)
{ {
OUStringBuffer buf; throw RuntimeException("unknown option " + cmd_arg + "! Use climaker --help to print all options.");
buf.append("unknown option ");
buf.append( cmd_arg );
buf.append( "! Use climaker --help to print all options." );
throw RuntimeException(
buf.makeStringAndClear() );
} }
else else
{ {
......
...@@ -41,10 +41,7 @@ System::String^ mapUnoPolymorphicName(System::String^ unoName); ...@@ -41,10 +41,7 @@ System::String^ mapUnoPolymorphicName(System::String^ unoName);
static inline ::System::String ^ to_cts_name( static inline ::System::String ^ to_cts_name(
OUString const & uno_name ) OUString const & uno_name )
{ {
OUStringBuffer buf( 7 + uno_name.getLength() ); return ustring_to_String("unoidl." + uno_name);
buf.append( "unoidl." );
buf.append( uno_name );
return ustring_to_String( buf.makeStringAndClear() );
} }
......
...@@ -79,11 +79,7 @@ UnoInterfaceInfo::UnoInterfaceInfo(Bridge const * bridge, uno_Interface* unoI, ...@@ -79,11 +79,7 @@ UnoInterfaceInfo::UnoInterfaceInfo(Bridge const * bridge, uno_Interface* unoI,
sal_Bool bComplete = ::typelib_typedescription_complete( & _pt); sal_Bool bComplete = ::typelib_typedescription_complete( & _pt);
if( ! bComplete) if( ! bComplete)
{ {
OUStringBuffer buf( 128 ); throw BridgeRuntimeError("cannot make type complete: " + *reinterpret_cast< OUString const * >(& m_typeDesc->aBase.pTypeName));
buf.append( "cannot make type complete: " );
buf.append( *reinterpret_cast< OUString const * >(
& m_typeDesc->aBase.pTypeName));
throw BridgeRuntimeError(buf.makeStringAndClear());
} }
} }
} }
...@@ -198,13 +194,7 @@ void UnoInterfaceProxy::addUnoInterface(uno_Interface* pUnoI, ...@@ -198,13 +194,7 @@ void UnoInterfaceProxy::addUnoInterface(uno_Interface* pUnoI,
"id:\n\t{0}\n\t{1}"), m_oid, sInterfaceName)); "id:\n\t{0}\n\t{1}"), m_oid, sInterfaceName));
// add to the string that contains all interface names // add to the string that contains all interface names
_numInterfaces++; _numInterfaces++;
OUStringBuffer buf(512); OUString _sNewInterface = "\t" + OUString::number(_numInterfaces) + ". " + mapCliString(sInterfaceName) + "\n";
buf.append("\t");
buf.append( OUString::number(_numInterfaces));
buf.append(". ");
buf.append(mapCliString(sInterfaceName));
buf.append("\n");
OUString _sNewInterface = buf.makeStringAndClear();
pin_ptr<rtl_uString *> pp_sInterfaces = &_sInterfaces; pin_ptr<rtl_uString *> pp_sInterfaces = &_sInterfaces;
rtl_uString_newConcat( pp_sInterfaces, * pp_sInterfaces, rtl_uString_newConcat( pp_sInterfaces, * pp_sInterfaces,
_sNewInterface.pData); _sNewInterface.pData);
...@@ -551,13 +541,9 @@ srrm::IMessage^ UnoInterfaceProxy::Invoke(srrm::IMessage^ callmsg) ...@@ -551,13 +541,9 @@ srrm::IMessage^ UnoInterfaceProxy::Invoke(srrm::IMessage^ callmsg)
} }
// ToDo check if the message of the exception is not crippled // ToDo check if the message of the exception is not crippled
// the thing that should not be... no method info found! // the thing that should not be... no method info found!
OUStringBuffer buf( 64 ); throw BridgeRuntimeError("[cli_uno bridge]calling undeclared function on interface " +
buf.append( "[cli_uno bridge]calling undeclared function on interface " ); *reinterpret_cast< OUString const * >(& ((typelib_TypeDescription *)info->m_typeDesc)->pTypeName) +
buf.append( *reinterpret_cast< OUString const * >( ": " + usMethodName);
& ((typelib_TypeDescription *)info->m_typeDesc)->pTypeName));
buf.append( ": " );
buf.append( usMethodName );
throw BridgeRuntimeError( buf.makeStringAndClear() );
} }
catch (BridgeRuntimeError & err) catch (BridgeRuntimeError & err)
{ {
...@@ -750,11 +736,7 @@ void CliProxy::makeMethodInfos() ...@@ -750,11 +736,7 @@ void CliProxy::makeMethodInfos()
} }
catch (System::InvalidCastException^ ) catch (System::InvalidCastException^ )
{ {
OUStringBuffer buf( 128 ); throw BridgeRuntimeError("[cli_uno bridge] preparing proxy for cli interface: " + mapCliString(m_type->ToString()) + " \nfailed!");
buf.append( "[cli_uno bridge] preparing proxy for cli interface: " );
buf.append(mapCliString(m_type->ToString() ));
buf.append( " \nfailed!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
} }
} }
...@@ -814,11 +796,7 @@ sr::MethodInfo^ CliProxy::getMethodInfo(int nUnoFunctionPos, ...@@ -814,11 +796,7 @@ sr::MethodInfo^ CliProxy::getMethodInfo(int nUnoFunctionPos,
} }
if (indexCliMethod == -1) if (indexCliMethod == -1)
{ {
OUStringBuffer buf(256); throw BridgeRuntimeError("[cli_uno bridge] CliProxy::getMethodInfo():cli object does not implement interface method: " + usMethodName);
buf.append( "[cli_uno bridge] CliProxy::getMethodInfo():"
"cli object does not implement interface method: " );
buf.append(usMethodName);
throw BridgeRuntimeError(buf.makeStringAndClear());
} }
m_arUnoPosToCliPos[nUnoFunctionPos] = indexCliMethod; m_arUnoPosToCliPos[nUnoFunctionPos] = indexCliMethod;
ret = m_arMethodInfos[indexCliMethod]; ret = m_arMethodInfos[indexCliMethod];
......
...@@ -230,11 +230,7 @@ void Bridge::call_cli( ...@@ -230,11 +230,7 @@ void Bridge::call_cli(
} }
catch (System::Exception^ e) catch (System::Exception^ e)
{ {
OUStringBuffer buf( 128 ); throw BridgeRuntimeError("Unexpected exception during invocation of cli object. Original message is: \n" + mapCliString(e->Message));
buf.append( "Unexpected exception during invocation of cli object. "
"Original message is: \n" );
buf.append(mapCliString(e->Message));
throw BridgeRuntimeError( buf.makeStringAndClear() );
} }
//convert out, in/out params //convert out, in/out params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment