binaryurp/source/bridge.cxx | 44 +++++++++---------- binaryurp/source/bridgefactory.cxx | 14 +++--- binaryurp/source/currentcontext.cxx | 8 +-- binaryurp/source/marshal.cxx | 2 binaryurp/source/outgoingrequests.cxx | 2 binaryurp/source/reader.cxx | 38 ++++++++-------- binaryurp/source/unmarshal.cxx | 40 ++++++++--------- binaryurp/source/writer.cxx | 6 +- bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx | 2 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx | 2 bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 6 +- bridges/source/jni_uno/jni_base.h | 2 bridges/source/jni_uno/jni_bridge.cxx | 2 bridges/source/jni_uno/jni_info.cxx | 2 bridges/source/jni_uno/jni_java2uno.cxx | 2 bridges/source/jni_uno/jni_uno2java.cxx | 6 +- 16 files changed, 89 insertions(+), 89 deletions(-)
New commits: commit 14cca2c88f86e06ec0c58e36397ddcce9b36a461 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 6 15:15:34 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon May 6 19:23:50 2024 +0200 loplugin:ostr in binaryurp Change-Id: I8fbb3a64cd101f219408103a771e1197e1e69776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index 068649cc3b4b..e755abc117fe 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -178,28 +178,28 @@ Bridge::Bridge( css::uno::Reference< css::bridge::XInstanceProvider > provider): factory_(factory), name_(std::move(name)), connection_(connection), provider_(std::move(provider)), - binaryUno_(UNO_LB_UNO), - cppToBinaryMapping_(CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO), - binaryToCppMapping_(UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME), + binaryUno_(u"" UNO_LB_UNO ""_ustr), + cppToBinaryMapping_(CPPU_CURRENT_LANGUAGE_BINDING_NAME, u"" UNO_LB_UNO ""_ustr), + binaryToCppMapping_(u"" UNO_LB_UNO ""_ustr, CPPU_CURRENT_LANGUAGE_BINDING_NAME), protPropTid_( reinterpret_cast< sal_Int8 const * >(".UrpProtocolPropertiesTid"), RTL_CONSTASCII_LENGTH(".UrpProtocolPropertiesTid")), - protPropOid_("UrpProtocolProperties"), + protPropOid_(u"UrpProtocolProperties"_ustr), protPropType_( cppu::UnoType< css::uno::Reference< css::bridge::XProtocolProperties > >::get()), - protPropRequest_("com.sun.star.bridge.XProtocolProperties::requestChange"), - protPropCommit_("com.sun.star.bridge.XProtocolProperties::commitChange"), + protPropRequest_(u"com.sun.star.bridge.XProtocolProperties::requestChange"_ustr), + protPropCommit_(u"com.sun.star.bridge.XProtocolProperties::commitChange"_ustr), state_(STATE_INITIAL), threadPool_(nullptr), currentContextMode_(false), proxies_(0), calls_(0), normalCall_(false), activeCalls_(0), mode_(MODE_REQUESTED) { assert(factory.is() && connection.is()); if (!binaryUno_.is()) { - throw css::uno::RuntimeException("URP: no binary UNO environment"); + throw css::uno::RuntimeException(u"URP: no binary UNO environment"_ustr); } if (!(cppToBinaryMapping_.is() && binaryToCppMapping_.is())) { - throw css::uno::RuntimeException("URP: no C++ UNO mapping"); + throw css::uno::RuntimeException(u"URP: no C++ UNO mapping"_ustr); } passive_.set(); // coverity[uninit_member] - random_ is set in due course by the reader_ thread's state machine @@ -448,7 +448,7 @@ OUString Bridge::registerOutgoingInterface( assert(stub != &newStub); if (j->second.references == SAL_MAX_UINT32) { throw css::uno::RuntimeException( - "URP: stub reference count overflow"); + u"URP: stub reference count overflow"_ustr); } ++j->second.references; } @@ -489,11 +489,11 @@ void Bridge::releaseStub( std::lock_guard g(mutex_); Stubs::iterator i(stubs_.find(oid)); if (i == stubs_.end()) { - throw css::uno::RuntimeException("URP: release unknown stub"); + throw css::uno::RuntimeException(u"URP: release unknown stub"_ustr); } Stub::iterator j(i->second.find(type)); if (j == i->second.end()) { - throw css::uno::RuntimeException("URP: release unknown stub"); + throw css::uno::RuntimeException(u"URP: release unknown stub"_ustr); } assert(j->second.references > 0); --j->second.references; @@ -611,7 +611,7 @@ bool Bridge::makeCall( if (resp == nullptr) { throw css::lang::DisposedException( - "Binary URP bridge disposed during call", + u"Binary URP bridge disposed during call"_ustr, getXWeak()); } *returnValue = resp->returnValue; @@ -674,7 +674,7 @@ void Bridge::handleRequestChangeReply( } if (n != exp) { throw css::uno::RuntimeException( - "URP: requestChange reply with unexpected return value received", + u"URP: requestChange reply with unexpected return value received"_ustr, getXWeak()); } decrementCalls(); @@ -757,7 +757,7 @@ void Bridge::handleRequestChangeRequest( } default: throw css::uno::RuntimeException( - "URP: unexpected requestChange request received", + u"URP: unexpected requestChange request received"_ustr, getXWeak()); } } @@ -781,7 +781,7 @@ void Bridge::handleCommitChangeRequest( ret = mapCppToBinaryAny( css::uno::Any( css::bridge::InvalidProtocolChangeException( - "InvalidProtocolChangeException", + u"InvalidProtocolChangeException"_ustr, css::uno::Reference< css::uno::XInterface >(), pp, 1))); break; @@ -808,7 +808,7 @@ void Bridge::handleCommitChangeRequest( break; default: throw css::uno::RuntimeException( - "URP: unexpected commitChange request received", + u"URP: unexpected commitChange request received"_ustr, getXWeak()); } } @@ -853,14 +853,14 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance( { if (sInstanceName.isEmpty()) { throw css::uno::RuntimeException( - "XBridge::getInstance sInstanceName must be non-empty", + u"XBridge::getInstance sInstanceName must be non-empty"_ustr, getXWeak()); } for (sal_Int32 i = 0; i != sInstanceName.getLength(); ++i) { if (sInstanceName[i] > 0x7F) { throw css::uno::RuntimeException( - "XBridge::getInstance sInstanceName contains non-ASCII" - " character"); + u"XBridge::getInstance sInstanceName contains non-ASCII" + " character"_ustr); } } css::uno::TypeDescription ifc(cppu::UnoType<css::uno::XInterface>::get()); @@ -874,7 +874,7 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance( bool bExc = makeCall( sInstanceName, css::uno::TypeDescription( - "com.sun.star.uno.XInterface::queryInterface"), + u"com.sun.star.uno.XInterface::queryInterface"_ustr), false, std::move(inArgs), &ret, &outArgs); throwException(bExc, ret); auto const t = ret.getType(); @@ -997,7 +997,7 @@ void Bridge::makeReleaseCall( }(); sendRequest( tid, oid, type, - css::uno::TypeDescription("com.sun.star.uno.XInterface::release"), + css::uno::TypeDescription(u"com.sun.star.uno.XInterface::release"_ustr), std::vector< BinaryAny >()); } @@ -1044,7 +1044,7 @@ void Bridge::checkDisposed() { assert(state_ != STATE_INITIAL); if (state_ != STATE_STARTED) { throw css::lang::DisposedException( - "Binary URP bridge already disposed", + u"Binary URP bridge already disposed"_ustr, getXWeak()); } } diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx index cd43fe592b0e..86b279cd8154 100644 --- a/binaryurp/source/bridgefactory.cxx +++ b/binaryurp/source/bridgefactory.cxx @@ -68,7 +68,7 @@ BridgeFactory::~BridgeFactory() {} OUString BridgeFactory::getImplementationName() { - return "com.sun.star.comp.bridge.BridgeFactory"; + return u"com.sun.star.comp.bridge.BridgeFactory"_ustr; } sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) @@ -78,7 +78,7 @@ sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) css::uno::Sequence< OUString > BridgeFactory::getSupportedServiceNames() { - return { "com.sun.star.bridge.BridgeFactory" }; + return { u"com.sun.star.bridge.BridgeFactory"_ustr }; } css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( @@ -92,7 +92,7 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( osl::MutexGuard g(m_aMutex); if (rBHelper.bDisposed) { throw css::lang::DisposedException( - "BridgeFactory disposed", + u"BridgeFactory disposed"_ustr, getXWeak()); } if (named_.find(sName) != named_.end()) { @@ -101,8 +101,8 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( } if (sProtocol != "urp" || !aConnection.is()) { throw css::lang::IllegalArgumentException( - ("BridgeFactory::createBridge: sProtocol != urp ||" - " aConnection == null"), + (u"BridgeFactory::createBridge: sProtocol != urp ||" + " aConnection == null"_ustr), getXWeak(), -1); } b.set(new Bridge(this, sName, aConnection, anInstanceProvider)); @@ -130,13 +130,13 @@ BridgeFactory::getExistingBridges() { osl::MutexGuard g(m_aMutex); if (unnamed_.size() > SAL_MAX_INT32) { throw css::uno::RuntimeException( - "BridgeFactory::getExistingBridges: too many", + u"BridgeFactory::getExistingBridges: too many"_ustr, getXWeak()); } sal_Int32 n = static_cast< sal_Int32 >(unnamed_.size()); if (named_.size() > o3tl::make_unsigned(SAL_MAX_INT32 - n)) { throw css::uno::RuntimeException( - "BridgeFactory::getExistingBridges: too many", + u"BridgeFactory::getExistingBridges: too many"_ustr, getXWeak()); } n = static_cast< sal_Int32 >(n + named_.size()); diff --git a/binaryurp/source/currentcontext.cxx b/binaryurp/source/currentcontext.cxx index acaf606d269c..530525907686 100644 --- a/binaryurp/source/currentcontext.cxx +++ b/binaryurp/source/currentcontext.cxx @@ -33,9 +33,9 @@ css::uno::UnoInterfaceReference get() { css::uno::UnoInterfaceReference cc; if (!uno_getCurrentContext( reinterpret_cast< void ** >(&cc.m_pUnoI), - OUString(UNO_LB_UNO).pData, nullptr)) + u"" UNO_LB_UNO ""_ustr.pData, nullptr)) { - throw css::uno::RuntimeException("uno_getCurrentContext failed"); + throw css::uno::RuntimeException(u"uno_getCurrentContext failed"_ustr); } return cc; } @@ -44,9 +44,9 @@ void set(css::uno::UnoInterfaceReference const & value) { css::uno::UnoInterfaceReference cc(value); if (!uno_setCurrentContext( cc.m_pUnoI, - OUString(UNO_LB_UNO).pData, nullptr)) + u"" UNO_LB_UNO ""_ustr.pData, nullptr)) { - throw css::uno::RuntimeException("uno_setCurrentContext failed"); + throw css::uno::RuntimeException(u"uno_setCurrentContext failed"_ustr); } } diff --git a/binaryurp/source/marshal.cxx b/binaryurp/source/marshal.cxx index 7d60cbf4de8a..e8c2c3289b0d 100644 --- a/binaryurp/source/marshal.cxx +++ b/binaryurp/source/marshal.cxx @@ -78,7 +78,7 @@ void writeString( RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - "UNO string contains invalid UTF-16 sequence"); + u"UNO string contains invalid UTF-16 sequence"_ustr); } writeCompressed(buffer, static_cast< sal_uInt32 >(v.getLength())); buffer->insert(buffer->end(), v.getStr(), v.getStr() + v.getLength()); diff --git a/binaryurp/source/outgoingrequests.cxx b/binaryurp/source/outgoingrequests.cxx index 3cdc80e82bb2..ed3521c1152e 100644 --- a/binaryurp/source/outgoingrequests.cxx +++ b/binaryurp/source/outgoingrequests.cxx @@ -46,7 +46,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) { Map::iterator i(map_.find(tid)); if (i == map_.end()) { throw css::uno::RuntimeException( - "URP: reply for unknown TID"); + u"URP: reply for unknown TID"_ustr); } assert(!i->second.empty()); return i->second.back(); diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx index 393d8312e43a..6930bd900124 100644 --- a/binaryurp/source/reader.cxx +++ b/binaryurp/source/reader.cxx @@ -64,7 +64,7 @@ css::uno::Sequence< sal_Int8 > read( assert(connection.is()); if (size > SAL_MAX_INT32) { throw css::uno::RuntimeException( - "binaryurp::Reader: block size too large"); + u"binaryurp::Reader: block size too large"_ustr); } css::uno::Sequence< sal_Int8 > buf; sal_Int32 n = connection->read(buf, static_cast< sal_Int32 >(size)); @@ -73,7 +73,7 @@ css::uno::Sequence< sal_Int8 > read( } if (o3tl::make_unsigned(n) != size) { throw css::io::IOException( - "binaryurp::Reader: premature end of input"); + u"binaryurp::Reader: premature end of input"_ustr); } assert(o3tl::make_unsigned(buf.getLength()) == size); return buf; @@ -112,7 +112,7 @@ void Reader::execute() { header.done(); if (count == 0) { throw css::io::IOException( - "binaryurp::Reader: block with zero message count received"); + u"binaryurp::Reader: block with zero message count received"_ustr); } Unmarshal block(bridge_, state_, read(con, size, false)); for (sal_uInt32 i = 0; i != count; ++i) { @@ -150,8 +150,8 @@ void Reader::readMessage(Unmarshal & unmarshal) { if (((flags2 & 0x40) != 0) != forceSynchronous) { // bit 6: SYNCHRONOUS throw css::uno::RuntimeException( - "URP: request message with MUSTREPLY != SYNCHRONOUS" - " received"); + u"URP: request message with MUSTREPLY != SYNCHRONOUS" + " received"_ustr); } } else { forceSynchronous = false; @@ -173,8 +173,8 @@ void Reader::readMessage(Unmarshal & unmarshal) { } else { if (!lastType_.is()) { throw css::uno::RuntimeException( - "URP: request message with NEWTYPE received when last" - " interface type has not yet been set"); + u"URP: request message with NEWTYPE received when last" + " interface type has not yet been set"_ustr); } type = lastType_; } @@ -183,14 +183,14 @@ void Reader::readMessage(Unmarshal & unmarshal) { oid = unmarshal.readOid(); if (oid.isEmpty()) { throw css::io::IOException( - "binaryurp::Unmarshal: empty OID"); + u"binaryurp::Unmarshal: empty OID"_ustr); } lastOid_ = oid; } else { if (lastOid_.isEmpty()) { throw css::uno::RuntimeException( - "URP: request message with NEWOID received when last OID has" - " not yet been set"); + u"URP: request message with NEWOID received when last OID has" + " not yet been set"_ustr); } oid = lastOid_; } @@ -199,13 +199,13 @@ void Reader::readMessage(Unmarshal & unmarshal) { type.makeComplete(); if (type.get()->eTypeClass != typelib_TypeClass_INTERFACE) { throw css::uno::RuntimeException( - "URP: request message with non-interface interface type received"); + u"URP: request message with non-interface interface type received"_ustr); } typelib_InterfaceTypeDescription * itd = reinterpret_cast< typelib_InterfaceTypeDescription * >(type.get()); if (functionId >= itd->nMapFunctionIndexToMemberIndex) { throw css::uno::RuntimeException( - "URP: request message with unknown function ID received"); + u"URP: request message with unknown function ID received"_ustr); } sal_Int32 memberId = itd->pMapFunctionIndexToMemberIndex[functionId]; css::uno::TypeDescription memberTd(itd->ppAllMembers[memberId]); @@ -280,8 +280,8 @@ void Reader::readMessage(Unmarshal & unmarshal) { break; default: throw css::uno::RuntimeException( - "URP: request message with UrpProtocolProperties OID and" - " unknown function ID received"); + u"URP: request message with UrpProtocolProperties OID and" + " unknown function ID received"_ustr); } } else { css::uno::UnoInterfaceReference obj; @@ -317,14 +317,14 @@ void Reader::readMessage(Unmarshal & unmarshal) { break; case SPECIAL_FUNCTION_ID_RESERVED: throw css::uno::RuntimeException( - "URP: request message with unknown function ID 1 received"); + u"URP: request message with unknown function ID 1 received"_ustr); case SPECIAL_FUNCTION_ID_RELEASE: break; default: obj = bridge_->findStub(oid, type); if (!obj.is()) { throw css::uno::RuntimeException( - "URP: request message with unknown OID received"); + u"URP: request message with unknown OID received"_ustr); } break; } @@ -401,7 +401,7 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) { } if (!bOk) { throw css::uno::RuntimeException( - "URP: reply message with bad exception type received"); + u"URP: reply message with bad exception type received"_ustr); } } } else { @@ -471,8 +471,8 @@ rtl::ByteSequence Reader::getTid(Unmarshal & unmarshal, bool newTid) const { } if (lastTid_.getLength() == 0) { throw css::uno::RuntimeException( - "URP: message with NEWTID received when last TID has not yet been" - " set"); + u"URP: message with NEWTID received when last TID has not yet been" + " set"_ustr); } return lastTid_; } diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx index 7d943d37b704..10eb4e780f3f 100644 --- a/binaryurp/source/unmarshal.cxx +++ b/binaryurp/source/unmarshal.cxx @@ -141,7 +141,7 @@ css::uno::TypeDescription Unmarshal::readType() { case typelib_TypeClass_ANY: if ((flags & 0x80) != 0) { throw css::io::IOException( - "binaryurp::Unmarshal: cache flag of simple type is set"); + u"binaryurp::Unmarshal: cache flag of simple type is set"_ustr); } return css::uno::TypeDescription( *typelib_static_type_getByTypeClass(tc)); @@ -155,7 +155,7 @@ css::uno::TypeDescription Unmarshal::readType() { if ((flags & 0x80) == 0) { if (idx == cache::ignore || !state_.typeCache[idx].is()) { throw css::io::IOException( - "binaryurp::Unmarshal: unknown type cache index"); + u"binaryurp::Unmarshal: unknown type cache index"_ustr); } return state_.typeCache[idx]; } else { @@ -175,15 +175,15 @@ css::uno::TypeDescription Unmarshal::readType() { t2.get())->pType); if (!t2.is()) { throw css::io::IOException( - "binaryurp::Unmarshal: sequence type with unknown" - " component type"); + u"binaryurp::Unmarshal: sequence type with unknown" + " component type"_ustr); } switch (t2.get()->eTypeClass) { case typelib_TypeClass_VOID: case typelib_TypeClass_EXCEPTION: throw css::io::IOException( - "binaryurp::Unmarshal: sequence type with bad" - " component type"); + u"binaryurp::Unmarshal: sequence type with bad" + " component type"_ustr); default: break; } @@ -196,7 +196,7 @@ css::uno::TypeDescription Unmarshal::readType() { } default: throw css::io::IOException( - "binaryurp::Unmarshal: type of unknown type class"); + u"binaryurp::Unmarshal: type of unknown type class"_ustr); } } @@ -205,14 +205,14 @@ OUString Unmarshal::readOid() { for (sal_Int32 i = 0; i != oid.getLength(); ++i) { if (oid[i] > 0x7F) { throw css::io::IOException( - "binaryurp::Unmarshal: OID contains non-ASCII character"); + u"binaryurp::Unmarshal: OID contains non-ASCII character"_ustr); } } sal_uInt16 idx = readCacheIndex(); if (oid.isEmpty() && idx != cache::ignore) { if (state_.oidCache[idx].isEmpty()) { throw css::io::IOException( - "binaryurp::Unmarshal: unknown OID cache index"); + u"binaryurp::Unmarshal: unknown OID cache index"_ustr); } return state_.oidCache[idx]; } @@ -235,7 +235,7 @@ rtl::ByteSequence Unmarshal::readTid() { if (tid.getLength() == 0) { if (idx == cache::ignore || state_.tidCache[idx].getLength() == 0) { throw css::io::IOException( - "binaryurp::Unmarshal: unknown TID cache index"); + u"binaryurp::Unmarshal: unknown TID cache index"_ustr); } return state_.tidCache[idx]; } @@ -258,7 +258,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { sal_uInt8 v = read8(); if (v > 1) { throw css::io::IOException( - "binaryurp::Unmarshal: boolean of unknown value"); + u"binaryurp::Unmarshal: boolean of unknown value"_ustr); } return BinaryAny(type, &v); } @@ -304,7 +304,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { css::uno::TypeDescription t(readType()); if (t.get()->eTypeClass == typelib_TypeClass_ANY) { throw css::io::IOException( - "binaryurp::Unmarshal: any of type ANY"); + u"binaryurp::Unmarshal: any of type ANY"_ustr); } return readValue(t); } @@ -326,7 +326,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { } if (!bFound) { throw css::io::IOException( - "binaryurp::Unmarshal: unknown enum value"); + u"binaryurp::Unmarshal: unknown enum value"_ustr); } return BinaryAny(type, &v); } @@ -356,14 +356,14 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { void Unmarshal::done() const { if (data_ != end_) { throw css::io::IOException( - "binaryurp::Unmarshal: block contains excess data"); + u"binaryurp::Unmarshal: block contains excess data"_ustr); } } void Unmarshal::check(sal_Int32 size) const { if (end_ - data_ < size) { throw css::io::IOException( - "binaryurp::Unmarshal: trying to read past end of block"); + u"binaryurp::Unmarshal: trying to read past end of block"_ustr); } } @@ -376,7 +376,7 @@ sal_uInt16 Unmarshal::readCacheIndex() { sal_uInt16 idx = read16(); if (idx >= cache::size && idx != cache::ignore) { throw css::io::IOException( - "binaryurp::Unmarshal: cache index out of range"); + u"binaryurp::Unmarshal: cache index out of range"_ustr); } return idx; } @@ -397,7 +397,7 @@ OUString Unmarshal::readString() { sal_uInt32 n = readCompressed(); if (n > SAL_MAX_INT32) { throw css::uno::RuntimeException( - "binaryurp::Unmarshal: string size too large"); + u"binaryurp::Unmarshal: string size too large"_ustr); } check(static_cast< sal_Int32 >(n)); OUString s; @@ -409,7 +409,7 @@ OUString Unmarshal::readString() { RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) { throw css::io::IOException( - "binaryurp::Unmarshal: string does not contain UTF-8"); + u"binaryurp::Unmarshal: string does not contain UTF-8"_ustr); } data_ += n; return s; @@ -420,7 +420,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) { sal_uInt32 n = readCompressed(); if (n > SAL_MAX_INT32) { throw css::uno::RuntimeException( - "binaryurp::Unmarshal: sequence size too large"); + u"binaryurp::Unmarshal: sequence size too large"_ustr); } if (n == 0) { return BinaryAny(type, nullptr); @@ -448,7 +448,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) { // sal_uInt32 * sal_Int32 -> sal_uInt64 cannot overflow if (size > SAL_MAX_SIZE - SAL_SEQUENCE_HEADER_SIZE) { throw css::uno::RuntimeException( - "binaryurp::Unmarshal: sequence size too large"); + u"binaryurp::Unmarshal: sequence size too large"_ustr); } void * buf = allocate( SAL_SEQUENCE_HEADER_SIZE + static_cast< sal_Size >(size)); diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx index 539d8a2c532f..9b7a9e59d817 100644 --- a/binaryurp/source/writer.cxx +++ b/binaryurp/source/writer.cxx @@ -168,7 +168,7 @@ void Writer::execute() { (item.oid != "UrpProtocolProperties" && !item.member.equals( css::uno::TypeDescription( - "com.sun.star.uno.XInterface::release")) && + u"com.sun.star.uno.XInterface::release"_ustr)) && bridge_->isCurrentContextMode()), item.currentContext); } else { @@ -243,7 +243,7 @@ void Writer::sendRequest( } assert(functionId >= 0); if (functionId > SAL_MAX_UINT16) { - throw css::uno::RuntimeException("function ID too large for URP"); + throw css::uno::RuntimeException(u"function ID too large for URP"_ustr); } std::vector< unsigned char > buf; bool newType = !(lastType_.is() && t.equals(lastType_)); @@ -411,7 +411,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) { std::vector< unsigned char > header; if (buffer.size() > SAL_MAX_UINT32) { throw css::uno::RuntimeException( - "message too large for URP"); + u"message too large for URP"_ustr); } Marshal::write32(&header, static_cast< sal_uInt32 >(buffer.size())); Marshal::write32(&header, 1); commit 171f984c909dcfd9bd76809ad01060395c6c9a75 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 6 15:15:45 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon May 6 19:23:41 2024 +0200 loplugin:ostr in bridges Change-Id: I6e0b9006924f058aceb2b0a4639f6987cec314a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167204 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 14673ab7d5e2..ac06a7de486c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -396,7 +396,7 @@ int cpp_vtable_call( } default: { - throw RuntimeException("no member description found!", + throw RuntimeException(u"no member description found!"_ustr, reinterpret_cast<XInterface *>( pCppI ) ); } } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index d17f3d99c629..2b0b50f531aa 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -195,7 +195,7 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno) __cxxabiv1::__cxa_exception * header = __cxxabiv1::__cxa_get_globals()->caughtExceptions; if (! header) { - RuntimeException aRE( "no exception header!" ); + RuntimeException aRE( u"no exception header!"_ustr ); Type const & rType = cppu::UnoType<decltype(aRE)>::get(); uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); SAL_WARN("bridges", aRE.Message); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index 25277857f82e..8934943622b4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -238,7 +238,7 @@ static void cpp_call( "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": " + o3tl::runtimeToOUString(e.what())); } catch (...) { - throw RuntimeException("C++ code threw unknown exception"); + throw RuntimeException(u"C++ code threw unknown exception"_ustr); } *ppUnoExc = nullptr; @@ -339,7 +339,7 @@ void unoInterfaceProxyDispatch( aParam.bOut = false; typelib_TypeDescriptionReference * pReturnTypeRef = nullptr; - OUString aVoidName("void"); + OUString aVoidName(u"void"_ustr); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); @@ -418,7 +418,7 @@ void unoInterfaceProxyDispatch( default: { ::com::sun::star::uno::RuntimeException aExc( - "illegal member type description!", + u"illegal member type description!"_ustr, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); Type const & rExcType = cppu::UnoType<decltype(aExc)>::get(); diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h index ce4f2833f6c7..4b7471381981 100644 --- a/bridges/source/jni_uno/jni_base.h +++ b/bridges/source/jni_uno/jni_base.h @@ -216,7 +216,7 @@ inline rtl_mem * rtl_mem::allocate( std::size_t bytes ) { void * p = std::malloc( bytes ); if (nullptr == p) - throw BridgeRuntimeError( "out of memory!" ); + throw BridgeRuntimeError( u"out of memory!"_ustr ); return static_cast<rtl_mem *>(p); } diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index c0465424ed4e..bd11e0bbda6d 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -242,7 +242,7 @@ Bridge::Bridge( if (static_cast<jni_uno::JniUnoEnvironmentData *>(m_java_env->pContext) == nullptr) { - throw BridgeRuntimeError("error during JNI-UNO's uno_initEnvironment"); + throw BridgeRuntimeError(u"error during JNI-UNO's uno_initEnvironment"_ustr); } (*m_uno_env->aBase.acquire)( &m_uno_env->aBase ); diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index a1a837545530..2f84d0121e1d 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -742,7 +742,7 @@ JNI_info::JNI_info( assert( m_method_AsynchronousFinalizer_drain != nullptr ); // get java env - OUString java_env_type_name( UNO_LB_JAVA ); + OUString java_env_type_name( u"" UNO_LB_JAVA ""_ustr ); JLocalAutoRef jo_java( jni, ustring_to_jstring( jni, java_env_type_name.pData ) ); jvalue args[ 2 ]; diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx index 600fbdbcee7e..449ed982a5d6 100644 --- a/bridges/source/jni_uno/jni_java2uno.cxx +++ b/bridges/source/jni_uno/jni_java2uno.cxx @@ -389,7 +389,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call( if (info->m_td.get()->eTypeClass != typelib_TypeClass_INTERFACE) { throw BridgeRuntimeError( - "queryInterface() call demands an INTERFACE type!" ); + u"queryInterface() call demands an INTERFACE type!"_ustr ); } JNI_interface_type_info const * iface_info = static_cast< JNI_interface_type_info const * >( info ); diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 83cedc1212dc..66715a7d9d26 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -648,7 +648,7 @@ void UNO_proxy_dispatch( typelib_TypeClass_INTERFACE) { throw BridgeRuntimeError( - "queryInterface() call demands an INTERFACE type!" ); + u"queryInterface() call demands an INTERFACE type!"_ustr ); } uno_Interface * pInterface = nullptr; @@ -758,7 +758,7 @@ void UNO_proxy_dispatch( default: { throw BridgeRuntimeError( - "illegal member type description!" ); + u"illegal member type description!"_ustr ); } } } @@ -788,7 +788,7 @@ void UNO_proxy_dispatch( { // binary identical struct css::uno::RuntimeException exc( - "[jni_uno bridge error] attaching current thread to java failed!", + u"[jni_uno bridge error] attaching current thread to java failed!"_ustr, css::uno::Reference< css::uno::XInterface >() ); css::uno::Type const & exc_type = cppu::UnoType<decltype(exc)>::get();