diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 20:41:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-20 07:27:30 +0100 |
commit | f8087b516ac1b000ca0454682d865340e790915a (patch) | |
tree | 5ef9164a87f0f31cd093842c803f5f7da91c7c13 /idl/source | |
parent | 1b19c6b7d03b0f7098f43131358227df28e59d84 (diff) |
Extended loplugin:ostr: idl
Change-Id: I22adb7f3750f1e1b9910f37046c5da98ac7ab5be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159697
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'idl/source')
-rw-r--r-- | idl/source/cmptools/lex.cxx | 4 | ||||
-rw-r--r-- | idl/source/objects/bastype.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/types.cxx | 6 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 16 | ||||
-rw-r--r-- | idl/source/prj/globals.cxx | 12 | ||||
-rw-r--r-- | idl/source/prj/parser.cxx | 22 |
8 files changed, 33 insertions, 33 deletions
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index eb9ad11703a2..e8fd0280d393 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -72,8 +72,8 @@ SvToken & SvToken::operator = ( const SvToken & rObj ) void SvTokenStream::InitCtor() { - aStrTrue = OString("TRUE"); - aStrFalse = OString("FALSE"); + aStrTrue = "TRUE"_ostr; + aStrFalse = "FALSE"_ostr; nLine = nColumn = 0; nBufPos = 0; nMaxPos = 0; diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx index 6a36db617f54..3d03c7308f74 100644 --- a/idl/source/objects/bastype.cxx +++ b/idl/source/objects/bastype.cxx @@ -34,7 +34,7 @@ bool SvBOOL::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm { rTok = rInStm.GetToken(); if( !rTok.IsBool() ) - throw SvParseException(rInStm, "xxx"); + throw SvParseException(rInStm, "xxx"_ostr); *this = rTok.GetBool(); rInStm.GetToken_Next(); } diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 4f3a0836791d..908ef3d16548 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -48,7 +48,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase, { SvMetaClass * pClass = rBase.ReadKnownClass( rInStm ); if( !pClass ) - throw SvParseException( rInStm, "unknown imported interface" ); + throw SvParseException( rInStm, "unknown imported interface"_ostr ); SvClassElement aEle; aEle.SetClass( pClass ); aClassElementList.push_back( aEle ); diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 6b2d7640c077..58b3faa522b4 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -207,7 +207,7 @@ bool SvMetaSlot::Test( SvTokenStream & rInStm ) pType = pType->GetReturnType(); if( !pType->IsItem() ) { - throw SvParseException( rInStm, "this attribute is not a slot" ); + throw SvParseException( rInStm, "this attribute is not a slot"_ostr ); } } diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 3af00c22cd0e..1089e929043c 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -52,7 +52,7 @@ bool SvMetaAttribute::Test( SvTokenStream & rInStm ) { if( GetType()->IsItem() && !GetSlotId().IsSet() ) { - throw SvParseException( rInStm, "slot without id declared" ); + throw SvParseException( rInStm, "slot without id declared"_ostr ); } return true; } @@ -300,7 +300,7 @@ bool SvMetaType::ReadMethodArgs( SvIdlDataBase & rBase, } SvMetaTypeString::SvMetaTypeString() - : SvMetaType( "String" ) + : SvMetaType( "String"_ostr ) { } @@ -313,7 +313,7 @@ SvMetaTypeEnum::SvMetaTypeEnum() } SvMetaTypevoid::SvMetaTypevoid() - : SvMetaType( "void" ) + : SvMetaType( "void"_ostr ) { } diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index 699d90e0f913..59ceab5dee9b 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -88,7 +88,7 @@ SvRefMemberList<SvMetaType *>& SvIdlDataBase::GetTypeList() void SvIdlDataBase::SetError( const OString& rError, SvToken const & rTok ) { if( rTok.GetLine() > 10000 ) - aError.SetText( "line count overflow" ); + aError.SetText( "line count overflow"_ostr ); if( aError.nLine < rTok.GetLine() || (aError.nLine == rTok.GetLine() && aError.nColumn < rTok.GetColumn()) ) @@ -161,7 +161,7 @@ bool SvIdlDataBase::ReadIdFile( std::string_view rOFileName ) rTok = aTokStm.GetToken_Next(); OString aDefName; if( !rTok.IsIdentifier() ) - throw SvParseException( "unexpected token after define", rTok ); + throw SvParseException( "unexpected token after define"_ostr, rTok ); aDefName = rTok.GetString(); sal_uInt32 nVal = 0; @@ -173,24 +173,24 @@ bool SvIdlDataBase::ReadIdFile( std::string_view rOFileName ) { rTok = aTokStm.GetToken_Next(); if( !rTok.IsChar() || rTok.GetChar() != '<') - throw SvParseException( "expected '<'", rTok ); + throw SvParseException( "expected '<'"_ostr, rTok ); rTok = aTokStm.GetToken_Next(); if (rTok.IsChar() && rTok.GetChar() == ':') { // add support for "::avmedia::MediaItem" namespaced identifier rTok = aTokStm.GetToken_Next(); if( !rTok.IsChar() || rTok.GetChar() != ':') - throw SvParseException( "expected ':'", rTok ); + throw SvParseException( "expected ':'"_ostr, rTok ); // the lexer reads "avmedia::MediaItem" as an identifier rTok = aTokStm.GetToken_Next(); if( !rTok.IsIdentifier() ) - throw SvParseException( "expected identifier", rTok ); + throw SvParseException( "expected identifier"_ostr, rTok ); } else if( !rTok.IsIdentifier() ) - throw SvParseException( "expected identifier", rTok ); + throw SvParseException( "expected identifier"_ostr, rTok ); rTok = aTokStm.GetToken_Next(); if( !rTok.IsChar() || rTok.GetChar() != '>') - throw SvParseException( "expected '<'", rTok ); + throw SvParseException( "expected '<'"_ostr, rTok ); rTok = aTokStm.GetToken_Next(); } else if( rTok.IsIdentifier() ) @@ -249,7 +249,7 @@ bool SvIdlDataBase::ReadIdFile( std::string_view rOFileName ) } if( rTok.IsEof() ) { - throw SvParseException("unexpected eof in #include", rTok); + throw SvParseException("unexpected eof in #include"_ostr, rTok); } } OString aName(aNameBuf.makeStringAndClear()); diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index 316d43d832d7..c4ac9ff20a25 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -43,12 +43,12 @@ static SvStringHashEntry * INS( const OString& rName ) #define A_ENTRY( Name ) , MM_##Name( INS( #Name ""_ostr ) ) SvGlobalHashNames::SvGlobalHashNames() - : MM_module( INS( "module" ) ) - , MM_interface( INS( "interface" ) ) - , MM_shell( INS( "shell" ) ) - , MM_Toggle( INS( "Toggle" ) ) - , MM_AutoUpdate( INS( "AutoUpdate" ) ) - , MM_Asynchron( INS( "Asynchron" ) ) + : MM_module( INS( "module"_ostr ) ) + , MM_interface( INS( "interface"_ostr ) ) + , MM_shell( INS( "shell"_ostr ) ) + , MM_Toggle( INS( "Toggle"_ostr ) ) + , MM_AutoUpdate( INS( "AutoUpdate"_ostr ) ) + , MM_Asynchron( INS( "Asynchron"_ostr ) ) A_ENTRY(RecordPerSet) A_ENTRY(RecordPerItem) A_ENTRY(NoRecord) diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index 31bbee9a9d85..d3e796d52efc 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -370,7 +370,7 @@ bool SvIdlParser::ReadSlot(SvMetaSlot& rSlot) rSlot.SetRef( pKnownSlot ); // names may differ, because explicitly given if ( pKnownSlot->GetName() != rSlot.GetName() ) - throw SvParseException( rInStm, "Illegal definition!" ); + throw SvParseException( rInStm, "Illegal definition!"_ostr ); } } @@ -396,19 +396,19 @@ void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot ) if( ReadIfBoolAttribute(rSlot.aRecordPerItem, SvHash_RecordPerItem()) ) { if (rSlot.aRecordPerSet.IsSet() || rSlot.aNoRecord.IsSet()) - throw SvParseException(rInStm, "conflicting attributes"); + throw SvParseException(rInStm, "conflicting attributes"_ostr); rSlot.SetRecordPerItem( rSlot.aRecordPerItem ); } if( ReadIfBoolAttribute(rSlot.aRecordPerSet, SvHash_RecordPerSet() ) ) { if (rSlot.aRecordPerItem.IsSet() || rSlot.aNoRecord.IsSet()) - throw SvParseException(rInStm, "conflicting attributes"); + throw SvParseException(rInStm, "conflicting attributes"_ostr); rSlot.SetRecordPerSet( rSlot.aRecordPerSet ); } if( ReadIfBoolAttribute(rSlot.aNoRecord, SvHash_NoRecord() ) ) { if (rSlot.aRecordPerItem.IsSet() || rSlot.aRecordPerSet.IsSet()) - throw SvParseException(rInStm, "conflicting attributes"); + throw SvParseException(rInStm, "conflicting attributes"_ostr); rSlot.SetNoRecord( rSlot.aNoRecord ); } @@ -461,7 +461,7 @@ SvMetaClass * SvIdlParser::ReadKnownClass() OString aName(ReadIdentifier()); SvMetaClass* pClass = rBase.FindKnownClass( aName ); if( !pClass ) - throw SvParseException( rInStm, "unknown class" ); + throw SvParseException( rInStm, "unknown class"_ostr ); return pClass; } @@ -473,7 +473,7 @@ SvMetaType * SvIdlParser::ReadKnownType() if( aType->GetName() == aName ) return aType; } - throw SvParseException( rInStm, "wrong typedef: "); + throw SvParseException( rInStm, "wrong typedef: "_ostr); } bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry const * pName ) @@ -487,7 +487,7 @@ bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry const * { rTok = rInStm.GetToken(); if( !rTok.IsBool() ) - throw SvParseException(rInStm, "xxx"); + throw SvParseException(rInStm, "xxx"_ostr); rBool = rTok.GetBool(); rInStm.GetToken_Next(); } @@ -510,7 +510,7 @@ void SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntr { rTok = rInStm.GetToken(); if( !rTok.IsIdentifier() ) - throw SvParseException(rInStm, "expected identifier"); + throw SvParseException(rInStm, "expected identifier"_ostr); rIdentifier.setString(rTok.GetString()); rInStm.GetToken_Next(); } @@ -522,7 +522,7 @@ void SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntr void SvIdlParser::ReadDelimiter() { if( !ReadIfDelimiter() ) - throw SvParseException(rInStm, "expected delimiter"); + throw SvParseException(rInStm, "expected delimiter"_ostr); } bool SvIdlParser::ReadIfDelimiter() @@ -541,7 +541,7 @@ OString SvIdlParser::ReadIdentifier() { SvToken& rTok = rInStm.GetToken(); if( !rTok.IsIdentifier() ) - throw SvParseException("expected identifier", rTok); + throw SvParseException("expected identifier"_ostr, rTok); rInStm.GetToken_Next(); return rTok.GetString(); } @@ -550,7 +550,7 @@ OString SvIdlParser::ReadString() { SvToken& rTok = rInStm.GetToken(); if( !rTok.IsString() ) - throw SvParseException("expected string", rTok); + throw SvParseException("expected string"_ostr, rTok); rInStm.GetToken_Next(); return rTok.GetString(); } |