From aa8c854590e76a437521596c566ce1327efffb6e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Feb 2016 11:49:07 +0200 Subject: tighten up the attribute parsing, and drop some unused slots Change-Id: I6f2ff99c919851b21ce120c40286c133bf65c778 --- idl/inc/parser.hxx | 2 +- idl/source/prj/parser.cxx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'idl') diff --git a/idl/inc/parser.hxx b/idl/inc/parser.hxx index 78a62af53ca1..8059cfdd9dd5 100644 --- a/idl/inc/parser.hxx +++ b/idl/inc/parser.hxx @@ -45,7 +45,7 @@ public: void ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMetaTypeType ); void ReadInterfaceOrShellEntry( SvMetaClass& rClass ); bool ReadInterfaceOrShellSlot( SvMetaSlot& rSlot ); - bool ReadInterfaceOrShellAttribute( SvMetaAttribute& rAttr ); + bool ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr ); void ReadItem(); void ReadStruct(); void ReadEnum(); diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index 777359859b50..9d77a3682c5a 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -338,7 +338,7 @@ void SvIdlParser::ReadInterfaceOrShellEntry(SvMetaClass& rClass) else { xAttr = new SvMetaAttribute( pType ); - bOk = ReadInterfaceOrShellAttribute(*xAttr); + bOk = ReadInterfaceOrShellMethodOrAttribute(*xAttr); } if( bOk ) bOk = xAttr->Test( rInStm ); @@ -392,20 +392,21 @@ bool SvIdlParser::ReadInterfaceOrShellSlot(SvMetaSlot& rSlot) return bOk; } -bool SvIdlParser::ReadInterfaceOrShellAttribute( SvMetaAttribute& rAttr ) +bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr ) { sal_uInt32 nTokPos = rInStm.Tell(); bool bOk = false; rAttr.SetName( ReadIdentifier() ); - rAttr.aSlotId.ReadSvIdl( rBase, rInStm ); + rAttr.aSlotId.setString( ReadIdentifier() ); + sal_uLong n; + if( !rBase.FindId( rAttr.aSlotId.getString(), &n ) ) + throw SvParseException( rInStm, "no value for identifier <" + rAttr.aSlotId.getString() + "> " ); + rAttr.aSlotId.SetValue(n); bOk = true; SvToken& rTok = rInStm.GetToken(); if( rTok.IsChar() && rTok.GetChar() == '(' ) { - tools::SvRef xT(new SvMetaType() ); - xT->SetRef(rAttr.GetType() ); - rAttr.aType = xT; bOk = rAttr.aType->ReadMethodArgs( rBase, rInStm ); } if( bOk && rInStm.ReadIf( '[' ) ) -- cgit