[Libreoffice-commits] core.git: idl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 7 17:56:50 UTC 2020
idl/source/objects/slot.cxx | 35 +++++++++++++++++------------------
idl/source/prj/parser.cxx | 24 ++++++++++++------------
2 files changed, 29 insertions(+), 30 deletions(-)
New commits:
commit 8ee2063fa8e0871fb91e1e92c52dbc5ecb73c9ab
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 7 16:13:10 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 7 19:56:18 2020 +0200
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 at collabora.co.uk>
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)
More information about the Libreoffice-commits
mailing list