[Libreoffice-commits] core.git: 3 commits - idl/inc idl/source svx/sdi
Noel Grandin
noel at peralex.com
Wed Feb 17 09:22:52 UTC 2016
idl/inc/lex.hxx | 58 +++++++-------
idl/inc/object.hxx | 1
idl/inc/parser.hxx | 42 +++++-----
idl/inc/types.hxx | 3
idl/source/prj/parser.cxx | 180 +++++++++++++++++++++++++++++-----------------
svx/sdi/svxitems.sdi | 2
6 files changed, 175 insertions(+), 111 deletions(-)
New commits:
commit b94272a55ee208b22cf73e8738152d9feaa7916f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Feb 17 09:01:27 2016 +0200
cleanup the Read*() methods in SvIdlParser
to be consistent about when they move to the next token
Change-Id: I8f5b1eab497fb4a7cb2a2267e815668c3d363de7
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index f513e9e..7a71520 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -181,28 +181,38 @@ public:
SvToken& GetToken() const { return *(*pCurToken).get(); }
bool ReadIf( char cChar )
- {
- if( (*pCurToken)->IsChar()
- && cChar == (*pCurToken)->GetChar() )
- {
- GetToken_Next();
- return true;
- }
- else
- return false;
- }
+ {
+ if( GetToken().IsChar() && cChar == GetToken().GetChar() )
+ {
+ GetToken_Next();
+ return true;
+ }
+ else
+ return false;
+ }
+
+ bool ReadIf( SvStringHashEntry* pEntry )
+ {
+ if( GetToken().Is( pEntry ) )
+ {
+ GetToken_Next();
+ return true;
+ }
+ else
+ return false;
+ }
bool ReadIfDelimiter()
- {
- if( (*pCurToken)->IsChar()
- && (';' == (*pCurToken)->GetChar()
- || ',' == (*pCurToken)->GetChar()) )
- {
- GetToken_Next();
- return true;
- }
- return false;
- }
+ {
+ if( GetToken().IsChar()
+ && (';' == GetToken().GetChar()
+ || ',' == GetToken().GetChar()) )
+ {
+ GetToken_Next();
+ return true;
+ }
+ return false;
+ }
sal_uInt32 Tell() const { return pCurToken-aTokList.begin(); }
diff --git a/idl/inc/parser.hxx b/idl/inc/parser.hxx
index 612fda0..fd1a352 100644
--- a/idl/inc/parser.hxx
+++ b/idl/inc/parser.hxx
@@ -52,11 +52,14 @@ public:
void ReadEnumValue( SvMetaTypeEnum& rEnum );
SvMetaClass* ReadKnownClass();
SvMetaType* ReadKnownType();
- void ReadChar(char cChar);
+ void Read(char cChar);
+ bool ReadIf(char cChar);
void ReadDelimiter();
+ bool ReadIfDelimiter();
OString ReadIdentifier();
OString ReadString();
- void ReadToken(SvStringHashEntry*);
+ void Read(SvStringHashEntry*);
+ bool ReadIf(SvStringHashEntry*);
};
#endif // INCLUDED_IDL_INC_PARSER_HXX
diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx
index 01cab62..fe1e2b9 100644
--- a/idl/source/prj/parser.cxx
+++ b/idl/source/prj/parser.cxx
@@ -37,18 +37,15 @@ void SvIdlParser::ReadSvIdl( bool bImported, const OUString & rPath )
if( rTok.IsEof() )
return;
- if( rTok.Is( SvHash_module() ) )
- {
- tools::SvRef<SvMetaModule> aModule = new SvMetaModule( bImported );
- ReadModuleHeader(*aModule);
- rBase.GetModuleList().push_back( aModule );
- }
+ Read( SvHash_module() );
+ tools::SvRef<SvMetaModule> aModule = new SvMetaModule( bImported );
+ ReadModuleHeader(*aModule);
+ rBase.GetModuleList().push_back( aModule );
}
}
void SvIdlParser::ReadModuleHeader(SvMetaModule& rModule)
{
- rInStm.GetToken_Next();
OString aName = ReadIdentifier();
rBase.Push( &rModule ); // onto the context stack
rModule.SetName( aName );
@@ -58,7 +55,7 @@ void SvIdlParser::ReadModuleHeader(SvMetaModule& rModule)
void SvIdlParser::ReadModuleBody(SvMetaModule& rModule)
{
- if( rInStm.ReadIf( '[' ) )
+ if( ReadIf( '[' ) )
{
while( true )
{
@@ -69,12 +66,12 @@ void SvIdlParser::ReadModuleBody(SvMetaModule& rModule)
{
throw SvParseException( rInStm, "cannot read file: " + aSlotIdFile );
}
- rInStm.ReadIfDelimiter();
+ ReadIfDelimiter();
}
- ReadChar( ']' );
+ Read( ']' );
}
- if( !rInStm.ReadIf( '{' ) )
+ if( !ReadIf( '{' ) )
return;
sal_uInt32 nBeginPos = 0;
@@ -82,34 +79,34 @@ void SvIdlParser::ReadModuleBody(SvMetaModule& rModule)
{
nBeginPos = rInStm.Tell();
ReadModuleElement( rModule );
- rInStm.ReadIfDelimiter();
+ ReadIfDelimiter();
}
- ReadChar( '}' );
+ Read( '}' );
}
void SvIdlParser::ReadModuleElement( SvMetaModule& rModule )
{
- if( rInStm.GetToken().Is( SvHash_interface() ) )
+ if( ReadIf( SvHash_interface() ) )
{
ReadInterfaceOrShell(rModule, MetaTypeType::Interface);
}
- else if( rInStm.GetToken().Is( SvHash_shell() ) )
+ else if( ReadIf( SvHash_shell() ) )
{
ReadInterfaceOrShell(rModule, MetaTypeType::Shell);
}
- else if( rInStm.GetToken().Is( SvHash_enum() ) )
+ else if( ReadIf( SvHash_enum() ) )
{
ReadEnum();
}
- else if( rInStm.GetToken().Is( SvHash_item() ) )
+ else if( ReadIf( SvHash_item() ) )
{
ReadItem();
}
- else if( rInStm.GetToken().Is( SvHash_struct() ) )
+ else if( ReadIf( SvHash_struct() ) )
{
ReadStruct();
}
- else if( rInStm.GetToken().Is( SvHash_include() ) )
+ else if( ReadIf( SvHash_include() ) )
{
ReadInclude(rModule);
}
@@ -132,7 +129,6 @@ void SvIdlParser::ReadInclude( SvMetaModule& rModule )
{
sal_uInt32 nTokPos = rInStm.Tell();
bool bOk = false;
- rInStm.GetToken_Next();
OUString aFullName(OStringToOUString(ReadString(), RTL_TEXTENCODING_ASCII_US));
rBase.StartNewFile( aFullName );
osl::FileBase::RC searchError = osl::File::searchFileURL(aFullName, rBase.GetPath(), aFullName);
@@ -182,12 +178,10 @@ void SvIdlParser::ReadInclude( SvMetaModule& rModule )
void SvIdlParser::ReadStruct()
{
- ReadToken( SvHash_struct() );
- rInStm.GetToken_Next();
tools::SvRef<SvMetaType> xStruct(new SvMetaType() );
xStruct->SetType( MetaTypeType::Struct );
xStruct->SetName( ReadIdentifier() );
- ReadChar( '{' );
+ Read( '{' );
sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
@@ -201,19 +195,19 @@ void SvIdlParser::ReadStruct()
throw SvParseException( rInStm, "no value for identifier <" + xAttr->aSlotId.getString() + "> " );
xAttr->aSlotId.SetValue(n);
xStruct->GetAttrList().push_back( xAttr );
- rInStm.ReadIfDelimiter();
- if ( rInStm.GetToken().IsChar() && rInStm.GetToken().GetChar() == '}')
+ if( !ReadIfDelimiter() )
+ break;
+ if( rInStm.GetToken().IsChar() && rInStm.GetToken().GetChar() == '}')
break;
}
- ReadChar( '}' );
+ Read( '}' );
+ ReadDelimiter();
// announce globally
rBase.GetTypeList().push_back( xStruct );
}
void SvIdlParser::ReadItem()
{
- ReadToken( SvHash_item() );
- rInStm.GetToken_Next();
tools::SvRef<SvMetaType> xItem(new SvMetaType() );
xItem->SetItem(true);
xItem->SetRef( ReadKnownType() );
@@ -224,19 +218,18 @@ void SvIdlParser::ReadItem()
void SvIdlParser::ReadEnum()
{
- rInStm.GetToken_Next();
tools::SvRef<SvMetaTypeEnum> xEnum( new SvMetaTypeEnum() );
xEnum->SetType( MetaTypeType::Enum );
xEnum->SetName( ReadIdentifier() );
- ReadChar('{');
+ Read('{');
while( true )
{
ReadEnumValue( *xEnum );
- if( !rInStm.ReadIfDelimiter() )
+ if( !ReadIfDelimiter() )
break;
}
- ReadChar( '}' );
+ Read( '}' );
// announce globally
rBase.GetTypeList().push_back( xEnum );
}
@@ -274,26 +267,24 @@ void SvIdlParser::ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMet
{
tools::SvRef<SvMetaClass> aClass( new SvMetaClass() );
- rInStm.GetToken_Next();
-
aClass->SetType( aMetaTypeType );
aClass->SetName( ReadIdentifier() );
- if( rInStm.ReadIf( ':' ) )
+ if( ReadIf( ':' ) )
{
aClass->aSuperClass = ReadKnownClass();
}
- if( rInStm.ReadIf( '{' ) )
+ if( ReadIf( '{' ) )
{
sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
nBeginPos = rInStm.Tell();
ReadInterfaceOrShellEntry(*aClass);
- rInStm.ReadIfDelimiter();
+ ReadIfDelimiter();
}
- ReadChar( '}' );
+ Read( '}' );
}
rModule.aClassList.push_back( aClass );
// announce globally
@@ -362,16 +353,16 @@ bool SvIdlParser::ReadInterfaceOrShellSlot(SvMetaSlot& rSlot)
throw SvParseException( rInStm, "attribute " + pAttr->GetName() + " is method or variable but not a slot" );
rSlot.SetRef( pKnownSlot );
rSlot.SetName( pKnownSlot->GetName() );
- if( rInStm.ReadIf( '[' ) )
+ if( ReadIf( '[' ) )
{
sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
nBeginPos = rInStm.Tell();
rSlot.ReadAttributesSvIdl( rBase, rInStm );
- rInStm.ReadIfDelimiter();
+ ReadIfDelimiter();
}
- bOk = rInStm.ReadIf( ']' );
+ bOk = ReadIf( ']' );
}
}
else
@@ -408,7 +399,7 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr
rAttr.aSlotId.SetValue(n);
bOk = true;
- if( rInStm.ReadIf( '(' ) )
+ if( ReadIf( '(' ) )
{
// read method arguments
tools::SvRef<SvMetaType> xT(new SvMetaType() );
@@ -424,14 +415,14 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr
if( xAttr->Test( rInStm ) )
rAttr.aType->GetAttrList().push_back( xAttr );
}
- rInStm.ReadIfDelimiter();
+ ReadIfDelimiter();
}
- ReadChar( ')' );
+ Read( ')' );
rAttr.aType->SetType( MetaTypeType::Method );
}
- if( bOk && rInStm.ReadIf( '[' ) )
+ if( bOk && ReadIf( '[' ) )
{
- ReadChar( ']' );
+ Read( ']' );
}
if( !bOk )
@@ -463,36 +454,71 @@ SvMetaType * SvIdlParser::ReadKnownType()
void SvIdlParser::ReadDelimiter()
{
- if( !rInStm.ReadIfDelimiter() )
+ if( !ReadIfDelimiter() )
throw SvParseException(rInStm, "expected delimiter");
}
+bool SvIdlParser::ReadIfDelimiter()
+{
+ if( rInStm.GetToken().IsChar()
+ && (';' == rInStm.GetToken().GetChar()
+ || ',' == rInStm.GetToken().GetChar()) )
+ {
+ rInStm.GetToken_Next();
+ return true;
+ }
+ return false;
+}
+
OString SvIdlParser::ReadIdentifier()
{
- SvToken& rTok = rInStm.GetToken_Next();
+ SvToken& rTok = rInStm.GetToken();
if( !rTok.IsIdentifier() )
throw SvParseException("expected identifier", rTok);
+ rInStm.GetToken_Next();
return rTok.GetString();
}
OString SvIdlParser::ReadString()
{
- SvToken& rTok = rInStm.GetToken_Next();
+ SvToken& rTok = rInStm.GetToken();
if( !rTok.IsString() )
throw SvParseException("expected string", rTok);
+ rInStm.GetToken_Next();
return rTok.GetString();
}
-void SvIdlParser::ReadChar(char cChar)
+void SvIdlParser::Read(char cChar)
{
- if( !rInStm.ReadIf( cChar ) )
+ if( !(rInStm.GetToken().IsChar() && rInStm.GetToken().GetChar() == cChar ) )
throw SvParseException(rInStm, "expected char '" + OString(cChar) + "'");
+ rInStm.GetToken_Next();
}
-void SvIdlParser::ReadToken(SvStringHashEntry* entry)
+bool SvIdlParser::ReadIf(char cChar)
+{
+ if( rInStm.GetToken().IsChar() && rInStm.GetToken().GetChar() == cChar )
+ {
+ rInStm.GetToken_Next();
+ return true;
+ }
+ return false;
+}
+
+void SvIdlParser::Read(SvStringHashEntry* entry)
{
if( !rInStm.GetToken().Is(entry) )
throw SvParseException("expected " + entry->GetName(), rInStm.GetToken());
+ rInStm.GetToken_Next();
}
+bool SvIdlParser::ReadIf(SvStringHashEntry* entry)
+{
+ if( rInStm.GetToken().Is(entry) )
+ {
+ rInStm.GetToken_Next();
+ return true;
+ }
+ return false;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 7680d69..e44ae28 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -314,7 +314,7 @@ item SvxLine SvxLineItem;
struct SvxLRSpace
{
INT32 LeftMargin MID_L_MARGIN; // % or direct
- INT32 TextLeftMargin MID_TXT_LMARGIN
+ INT32 TextLeftMargin MID_TXT_LMARGIN;
INT32 RightMargin MID_R_MARGIN; // % or direct
INT16 LeftRelMargin MID_L_REL_MARGIN;
INT16 RightRelMargin MID_R_REL_MARGIN;
commit cd3bb3047d3f4c9cc9b4aa0c0eb8a42930b9bb86
Author: Noel Grandin <noel at peralex.com>
Date: Tue Feb 16 15:18:33 2016 +0200
move some more slot parsing to SvIdlParser
Change-Id: I186e80ed0446585aceaf4d25f32ecca7e8ed396c
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 6d56eeb..4c26597 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -33,6 +33,7 @@ class SvClassElement
tools::SvRef<SvMetaClass> xClass;
public:
SvClassElement();
+ SvClassElement(SvMetaClass* pClass) { xClass = pClass; }
void SetPrefix( const OString& rPrefix )
{ aPrefix = rPrefix; }
diff --git a/idl/inc/parser.hxx b/idl/inc/parser.hxx
index 8059cfd..612fda0 100644
--- a/idl/inc/parser.hxx
+++ b/idl/inc/parser.hxx
@@ -37,25 +37,26 @@ class SvIdlParser
SvTokenStream & rInStm;
public:
SvIdlParser( SvIdlDataBase& rBase_, SvTokenStream & rInStrm_) : rBase(rBase_), rInStm(rInStrm_) {}
- void ReadSvIdl( bool bImported, const OUString & rPath );
- void ReadModuleHeader(SvMetaModule& rModule);
- void ReadModuleBody(SvMetaModule& rModule);
- void ReadModuleElement( SvMetaModule& rModule );
- void ReadInclude( SvMetaModule& rModule );
- void ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMetaTypeType );
- void ReadInterfaceOrShellEntry( SvMetaClass& rClass );
- bool ReadInterfaceOrShellSlot( SvMetaSlot& rSlot );
- bool ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr );
- void ReadItem();
- void ReadStruct();
- void ReadEnum();
- void ReadEnumValue( SvMetaTypeEnum& rEnum );
- SvMetaType* ReadKnownType();
- void ReadChar(char cChar);
- void ReadDelimiter();
- OString ReadIdentifier();
- OString ReadString();
- void ReadToken(SvStringHashEntry*);
+ void ReadSvIdl( bool bImported, const OUString & rPath );
+ void ReadModuleHeader(SvMetaModule& rModule);
+ void ReadModuleBody(SvMetaModule& rModule);
+ void ReadModuleElement( SvMetaModule& rModule );
+ void ReadInclude( SvMetaModule& rModule );
+ void ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMetaTypeType );
+ void ReadInterfaceOrShellEntry( SvMetaClass& rClass );
+ bool ReadInterfaceOrShellSlot( SvMetaSlot& rSlot );
+ bool ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr );
+ void ReadItem();
+ void ReadStruct();
+ void ReadEnum();
+ void ReadEnumValue( SvMetaTypeEnum& rEnum );
+ SvMetaClass* ReadKnownClass();
+ SvMetaType* ReadKnownType();
+ void ReadChar(char cChar);
+ void ReadDelimiter();
+ OString ReadIdentifier();
+ OString ReadString();
+ void ReadToken(SvStringHashEntry*);
};
#endif // INCLUDED_IDL_INC_PARSER_HXX
diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx
index d1793c8..01cab62 100644
--- a/idl/source/prj/parser.cxx
+++ b/idl/source/prj/parser.cxx
@@ -282,9 +282,7 @@ void SvIdlParser::ReadInterfaceOrShell( SvMetaModule& rModule, MetaTypeType aMet
if( rInStm.ReadIf( ':' ) )
{
- aClass->aSuperClass = rBase.ReadKnownClass( rInStm );
- if( !aClass->aSuperClass.Is() )
- throw SvParseException( rInStm, "unknown super class" );
+ aClass->aSuperClass = ReadKnownClass();
}
if( rInStm.ReadIf( '{' ) )
{
@@ -309,19 +307,15 @@ void SvIdlParser::ReadInterfaceOrShellEntry(SvMetaClass& rClass)
if( rTok.Is( SvHash_import() ) )
{
- SvMetaClass * pClass = rBase.ReadKnownClass( rInStm );
- if( !pClass )
- throw SvParseException( rInStm, "unknown imported interface" );
- SvClassElement xEle;
- xEle.SetClass( pClass );
- rClass.aClassElementList.push_back( xEle );
-
+ SvMetaClass * pClass = ReadKnownClass();
+ SvClassElement xEle(pClass);
rTok = rInStm.GetToken();
if( rTok.IsString() )
{
xEle.SetPrefix( rTok.GetString() );
rInStm.GetToken_Next();
}
+ rClass.aClassElementList.push_back( xEle );
return;
}
else
@@ -363,12 +357,22 @@ bool SvIdlParser::ReadInterfaceOrShellSlot(SvMetaSlot& rSlot)
SvMetaAttribute * pAttr = rBase.ReadKnownAttr( rInStm, rSlot.GetType() );
if( pAttr )
{
- SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr );
+ SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr );
if( !pKnownSlot )
throw SvParseException( rInStm, "attribute " + pAttr->GetName() + " is method or variable but not a slot" );
rSlot.SetRef( pKnownSlot );
rSlot.SetName( pKnownSlot->GetName() );
- bOk = rSlot.SvMetaObject::ReadSvIdl( rBase, rInStm );
+ if( rInStm.ReadIf( '[' ) )
+ {
+ sal_uInt32 nBeginPos = 0; // can not happen with Tell
+ while( nBeginPos != rInStm.Tell() )
+ {
+ nBeginPos = rInStm.Tell();
+ rSlot.ReadAttributesSvIdl( rBase, rInStm );
+ rInStm.ReadIfDelimiter();
+ }
+ bOk = rInStm.ReadIf( ']' );
+ }
}
else
{
@@ -376,7 +380,7 @@ bool SvIdlParser::ReadInterfaceOrShellSlot(SvMetaSlot& rSlot)
SvMetaAttribute *pAttr2 = rBase.SearchKnownAttr( rSlot.GetSlotId() );
if( pAttr2 )
{
- SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr2 );
+ SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr2 );
if( !pKnownSlot )
throw SvParseException( rInStm, "attribute " + pAttr2->GetName() + " is method or variable but not a slot" );
rSlot.SetRef( pKnownSlot );
@@ -435,6 +439,14 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr
return bOk;
}
+SvMetaClass * SvIdlParser::ReadKnownClass()
+{
+ SvMetaClass* pClass = rBase.ReadKnownClass( rInStm );
+ if( !pClass )
+ throw SvParseException( rInStm, "unknown class" );
+ return pClass;
+}
+
SvMetaType * SvIdlParser::ReadKnownType()
{
OString aName = ReadIdentifier();
commit 0f8f733eaf54c00f79d086c2b2867c7a8b1bcc6c
Author: Noel Grandin <noel at peralex.com>
Date: Tue Feb 16 13:15:43 2016 +0200
move parsing of method ags into SvIdlParser
Change-Id: I2fb969529c0670ae93c3cba69bf207d2c87887dc
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index 7780a36..f513e9e 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -166,7 +166,7 @@ public:
return *(*pRetToken).get();
}
- SvToken& GetToken_NextAll()
+ SvToken& GetToken_Next()
{
std::vector<std::unique_ptr<SvToken> >::iterator pRetToken = pCurToken++;
@@ -178,12 +178,6 @@ public:
return *(*pRetToken).get();
}
- SvToken& GetToken_Next()
- {
- // comments get removed initially
- return GetToken_NextAll();
- }
-
SvToken& GetToken() const { return *(*pCurToken).get(); }
bool ReadIf( char cChar )
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index ec7a0de..167e902 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -62,7 +62,6 @@ class SvMetaType : public SvMetaReference
SvStream & rOutStm );
protected:
bool ReadNamesSvIdl( SvTokenStream & rInStm );
- virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
bool ReadHeaderSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
public:
@@ -71,6 +70,8 @@ public:
virtual ~SvMetaType();
+ virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
+
SvRefMemberList<SvMetaAttribute *>&
GetAttrList() { return aAttrList; }
sal_uLong GetAttrCount() const { return aAttrList.size(); }
diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx
index 9d77a36..d1793c8 100644
--- a/idl/source/prj/parser.cxx
+++ b/idl/source/prj/parser.cxx
@@ -404,11 +404,27 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr
rAttr.aSlotId.SetValue(n);
bOk = true;
- SvToken& rTok = rInStm.GetToken();
- if( rTok.IsChar() && rTok.GetChar() == '(' )
+ if( rInStm.ReadIf( '(' ) )
{
- bOk = rAttr.aType->ReadMethodArgs( rBase, rInStm );
- }
+ // read method arguments
+ tools::SvRef<SvMetaType> xT(new SvMetaType() );
+ xT->SetRef(rAttr.GetType() );
+ rAttr.aType = xT;
+ sal_uInt32 nBeginPos = 0; // can not happen with Tell
+ while( nBeginPos != rInStm.Tell() )
+ {
+ nBeginPos = rInStm.Tell();
+ tools::SvRef<SvMetaAttribute> xAttr( new SvMetaAttribute() );
+ if( xAttr->ReadSvIdl( rBase, rInStm ) )
+ {
+ if( xAttr->Test( rInStm ) )
+ rAttr.aType->GetAttrList().push_back( xAttr );
+ }
+ rInStm.ReadIfDelimiter();
+ }
+ ReadChar( ')' );
+ rAttr.aType->SetType( MetaTypeType::Method );
+ }
if( bOk && rInStm.ReadIf( '[' ) )
{
ReadChar( ']' );
More information about the Libreoffice-commits
mailing list