diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 16:13:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 19:56:18 +0200 |
commit | 8ee2063fa8e0871fb91e1e92c52dbc5ecb73c9ab (patch) | |
tree | 34886831447a42f1b83db22d6f5a3bf28186c082 /idl | |
parent | f9151f426281de0fb7f446d7b968f2b0c09b7a9b (diff) |
loplugin:flatten in idl
Change-Id: I7e8fe338a366d146c7951fe54f74cc5e42bde039
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91833
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idl')
-rw-r--r-- | idl/source/objects/slot.cxx | 35 | ||||
-rw-r--r-- | idl/source/prj/parser.cxx | 24 |
2 files changed, 29 insertions, 30 deletions
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index e9b2d9986410..1793da697c5c 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -386,28 +386,27 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, } aMethodName = GetStateMethod(); - if (!aMethodName.isEmpty() && - aMethodName != "NoState") + if (aMethodName.isEmpty() || aMethodName == "NoState") + return; + + bool bIn = false; + for ( size_t n=0; n < rList.size(); n++ ) { - bool bIn = false; - for ( size_t n=0; n < rList.size(); n++ ) + if (rList[n] == aMethodName) { - if (rList[n] == aMethodName) - { - bIn = true; - break; - } + bIn = true; + break; } + } - if ( !bIn ) - { - rList.push_back( aMethodName ); - rOutStm.WriteCharPtr( "SFX_STATE_STUB(" ) - .WriteOString( rShellName ) - .WriteChar( ',' ) - .WriteOString( aMethodName ) - .WriteChar( ')' ) << endl; - } + if ( !bIn ) + { + rList.push_back( aMethodName ); + rOutStm.WriteCharPtr( "SFX_STATE_STUB(" ) + .WriteOString( rShellName ) + .WriteChar( ',' ) + .WriteOString( aMethodName ) + .WriteChar( ')' ) << endl; } } diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index be948e8ec31f..dc5bb4f14444 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -431,20 +431,20 @@ void SvIdlParser::ReadInterfaceOrShellMethod( SvMetaAttribute& rAttr ) xT->SetRef(rAttr.GetType() ); rAttr.aType = xT; rAttr.aType->SetType( MetaTypeType::Method ); - if (!ReadIf(')')) + if (ReadIf(')')) + return; + + while (true) { - while (true) - { - tools::SvRef<SvMetaAttribute> xParamAttr( new SvMetaAttribute() ); - xParamAttr->aType = ReadKnownType(); - xParamAttr->SetName( ReadIdentifier() ); - ReadSlotId(xParamAttr->aSlotId); - rAttr.aType->GetAttrList().push_back( xParamAttr.get() ); - if (!ReadIfDelimiter()) - break; - } - Read(')'); + tools::SvRef<SvMetaAttribute> xParamAttr( new SvMetaAttribute() ); + xParamAttr->aType = ReadKnownType(); + xParamAttr->SetName( ReadIdentifier() ); + ReadSlotId(xParamAttr->aSlotId); + rAttr.aType->GetAttrList().push_back( xParamAttr.get() ); + if (!ReadIfDelimiter()) + break; } + Read(')'); } void SvIdlParser::ReadSlotId(SvIdentifier& rSlotId) |