summaryrefslogtreecommitdiff
path: root/idl/source
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-04-30 14:02:18 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-05-01 01:30:44 +0300
commitc2f7c567b7264c25180e2717eabad61c4c92ae0e (patch)
tree498adf9aa359c2d831e5c765227c1153b29b5185 /idl/source
parent1c6cb1e8386eb627adb0c70169582cc58fd76ec7 (diff)
svidl: Adapt to SlotType removal
No diff in workdir/SdiTarget. BEWARE: If you're going to revert this for whatever reason, you should also revert the previous commit that removed the SlotType property from sdi files! Change-Id: I78cc391a6b47f4672157926eba1b55e786f48f2d
Diffstat (limited to 'idl/source')
-rw-r--r--idl/source/objects/slot.cxx86
-rw-r--r--idl/source/prj/globals.cxx1
-rw-r--r--idl/source/prj/parser.cxx59
3 files changed, 37 insertions, 109 deletions
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 018b57cf202c..b14b0ec1b031 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -88,11 +88,6 @@ bool SvMetaSlot::IsMethod() const
|* IsSet() provides FALSE (default initialization).
*************************************************************************/
/** reference disbandment **/
-SvMetaType * SvMetaSlot::GetSlotType() const
-{
- if( aSlotType.is() || !GetRef() ) return aSlotType.get();
- return static_cast<SvMetaSlot *>(GetRef())->GetSlotType();
-}
const OString& SvMetaSlot::GetGroupId() const
{
if( !aGroupId.getString().isEmpty() || !GetRef() ) return aGroupId.getString();
@@ -191,75 +186,36 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
{
SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm );
- bool bOk = false;
- bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm );
- bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm );
- bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm );
- bOk |= ReadStringSvIdl( SvHash_DisableFlags(), rInStm, aDisableFlags );
- bOk |= aReadOnlyDoc.ReadSvIdl( SvHash_ReadOnlyDoc(), rInStm );
- bOk |= aExport.ReadSvIdl( SvHash_Export(), rInStm );
+ aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm );
+ aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm );
+ aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm );
+ ReadStringSvIdl( SvHash_DisableFlags(), rInStm, aDisableFlags );
+ aReadOnlyDoc.ReadSvIdl( SvHash_ReadOnlyDoc(), rInStm );
+ aExport.ReadSvIdl( SvHash_Export(), rInStm );
+ aToggle.ReadSvIdl( SvHash_Toggle(), rInStm );
+ aAutoUpdate.ReadSvIdl( SvHash_AutoUpdate(), rInStm );
+ aAsynchron.ReadSvIdl( SvHash_Asynchron(), rInStm );
+ aRecordAbsolute.ReadSvIdl( SvHash_RecordAbsolute(), rInStm );
- if( aToggle.ReadSvIdl( SvHash_Toggle(), rInStm ) )
- {
- bOk = true;
- }
- if( aAutoUpdate.ReadSvIdl( SvHash_AutoUpdate(), rInStm ) )
- {
- bOk = true;
- }
- if( aAsynchron.ReadSvIdl( SvHash_Asynchron(), rInStm ) )
- {
- bOk = true;
- }
- if( aRecordAbsolute.ReadSvIdl( SvHash_RecordAbsolute(), rInStm ) )
- {
- bOk = true;
- }
if( aRecordPerItem.ReadSvIdl( SvHash_RecordPerItem(), rInStm ) )
{
SetRecordPerItem( aRecordPerItem );
- bOk = true;
}
if( aRecordPerSet.ReadSvIdl( SvHash_RecordPerSet(), rInStm ) )
{
SetRecordPerSet( aRecordPerSet );
- bOk = true;
}
if( aNoRecord.ReadSvIdl( SvHash_NoRecord(), rInStm ) )
{
SetNoRecord( aNoRecord );
- bOk = true;
}
- bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm );
- bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm );
- bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm );
-
- bOk |= aFastCall.ReadSvIdl( SvHash_FastCall(), rInStm );
- bOk |= aContainer.ReadSvIdl( SvHash_Container(), rInStm );
+ aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm );
+ aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm );
+ aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm );
- if( !bOk )
- {
- if( !aSlotType.is() )
- {
- sal_uInt32 nTokPos = rInStm.Tell();
- SvToken& rTok = rInStm.GetToken_Next();
- if( rTok.Is( SvHash_SlotType() ) )
- {
- if( rInStm.ReadIf( '=' ) )
- {
- aSlotType = rBase.ReadKnownType( rInStm );
- if( !aSlotType.is() )
- throw SvParseException( rInStm, "SlotType with unknown item type" );
- if( !aSlotType->IsItem() )
- throw SvParseException( rInStm, "the SlotType is not a item" );
- return;
- }
- }
- rInStm.Seek( nTokPos );
-
- }
- }
+ aFastCall.ReadSvIdl( SvHash_FastCall(), rInStm );
+ aContainer.ReadSvIdl( SvHash_Container(), rInStm );
}
bool SvMetaSlot::Test( SvTokenStream & rInStm )
@@ -586,16 +542,16 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
- SvMetaType * pT = GetSlotType();
- if( !pT )
+ SvMetaType * pT = GetType();
+ if( !IsVariable() )
{
- if( !IsVariable() )
- pT = rBase.FindType( "SfxVoidItem" );
- else
- pT = GetType();
+ SvMetaType * pRT = GetType()->GetReturnType();
+ pT = pRT ? pRT : rBase.FindType( "SfxVoidItem" );
}
+
if( pT )
{
+ assert(pT->IsItem());
rOutStm.WriteOString( pT->GetName() );
if( !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) )
rBase.aUsedTypes.push_back( pT );
diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx
index 57b27b1c85e5..965369b1f130 100644
--- a/idl/source/prj/globals.cxx
+++ b/idl/source/prj/globals.cxx
@@ -90,7 +90,6 @@ SvGlobalHashNames::SvGlobalHashNames()
A_ENTRY(Container)
A_ENTRY(ReadOnlyDoc)
A_ENTRY(struct)
- A_ENTRY(SlotType)
A_ENTRY(DisableFlags)
{}
diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx
index da8e574c17a6..f0683ab92a92 100644
--- a/idl/source/prj/parser.cxx
+++ b/idl/source/prj/parser.cxx
@@ -381,70 +381,43 @@ bool SvIdlParser::ReadSlot(SvMetaSlot& rSlot)
void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot )
{
- bool bOk = false;
- bOk |= ReadIfIdAttribute(rSlot.aGroupId, SvHash_GroupId() );
- bOk |= ReadIfIdAttribute(rSlot.aExecMethod, SvHash_ExecMethod() );
- bOk |= ReadIfIdAttribute(rSlot.aStateMethod, SvHash_StateMethod() );
- bOk |= ReadStringSvIdl( SvHash_DisableFlags(), rInStm, rSlot.aDisableFlags );
- bOk |= ReadIfBoolAttribute(rSlot.aReadOnlyDoc, SvHash_ReadOnlyDoc() );
- bOk |= ReadIfBoolAttribute(rSlot.aExport, SvHash_Export() );
-
- bOk |= ReadIfBoolAttribute(rSlot.aToggle, SvHash_Toggle() );
- bOk |= ReadIfBoolAttribute(rSlot.aAutoUpdate, SvHash_AutoUpdate() );
- bOk |= ReadIfBoolAttribute(rSlot.aAsynchron, SvHash_Asynchron() );
- bOk |= ReadIfBoolAttribute(rSlot.aRecordAbsolute, SvHash_RecordAbsolute() );
+ ReadIfIdAttribute(rSlot.aGroupId, SvHash_GroupId() );
+ ReadIfIdAttribute(rSlot.aExecMethod, SvHash_ExecMethod() );
+ ReadIfIdAttribute(rSlot.aStateMethod, SvHash_StateMethod() );
+ ReadStringSvIdl( SvHash_DisableFlags(), rInStm, rSlot.aDisableFlags );
+ ReadIfBoolAttribute(rSlot.aReadOnlyDoc, SvHash_ReadOnlyDoc() );
+ ReadIfBoolAttribute(rSlot.aExport, SvHash_Export() );
+
+ ReadIfBoolAttribute(rSlot.aToggle, SvHash_Toggle() );
+ ReadIfBoolAttribute(rSlot.aAutoUpdate, SvHash_AutoUpdate() );
+ ReadIfBoolAttribute(rSlot.aAsynchron, SvHash_Asynchron() );
+ ReadIfBoolAttribute(rSlot.aRecordAbsolute, SvHash_RecordAbsolute() );
if( ReadIfBoolAttribute(rSlot.aRecordPerItem, SvHash_RecordPerItem()) )
{
if (rSlot.aRecordPerSet.IsSet() || rSlot.aNoRecord.IsSet())
throw SvParseException(rInStm, "conflicting attributes");
rSlot.SetRecordPerItem( rSlot.aRecordPerItem );
- bOk = true;
}
if( ReadIfBoolAttribute(rSlot.aRecordPerSet, SvHash_RecordPerSet() ) )
{
if (rSlot.aRecordPerItem.IsSet() || rSlot.aNoRecord.IsSet())
throw SvParseException(rInStm, "conflicting attributes");
rSlot.SetRecordPerSet( rSlot.aRecordPerSet );
- bOk = true;
}
if( ReadIfBoolAttribute(rSlot.aNoRecord, SvHash_NoRecord() ) )
{
if (rSlot.aRecordPerItem.IsSet() || rSlot.aRecordPerSet.IsSet())
throw SvParseException(rInStm, "conflicting attributes");
rSlot.SetNoRecord( rSlot.aNoRecord );
- bOk = true;
}
- bOk |= ReadIfBoolAttribute(rSlot.aMenuConfig, SvHash_MenuConfig() );
- bOk |= ReadIfBoolAttribute(rSlot.aToolBoxConfig, SvHash_ToolBoxConfig() );
- bOk |= ReadIfBoolAttribute(rSlot.aAccelConfig, SvHash_AccelConfig() );
-
- bOk |= ReadIfBoolAttribute(rSlot.aFastCall, SvHash_FastCall() );
- bOk |= ReadIfBoolAttribute(rSlot.aContainer, SvHash_Container() );
-
- if( bOk )
- return;
-
- if( !rSlot.aSlotType.is() )
- {
- sal_uInt32 nTokPos = rInStm.Tell();
- SvToken& rTok = rInStm.GetToken_Next();
- if( rTok.Is( SvHash_SlotType() ) )
- {
- if( rInStm.ReadIf( '=' ) )
- {
- rSlot.aSlotType = rBase.ReadKnownType( rInStm );
- if( !rSlot.aSlotType.is() )
- throw SvParseException( rInStm, "SlotType with unknown item type" );
- if( !rSlot.aSlotType->IsItem() )
- throw SvParseException( rInStm, "the SlotType is not a item" );
- return;
- }
- }
- rInStm.Seek( nTokPos );
+ ReadIfBoolAttribute(rSlot.aMenuConfig, SvHash_MenuConfig() );
+ ReadIfBoolAttribute(rSlot.aToolBoxConfig, SvHash_ToolBoxConfig() );
+ ReadIfBoolAttribute(rSlot.aAccelConfig, SvHash_AccelConfig() );
- }
+ ReadIfBoolAttribute(rSlot.aFastCall, SvHash_FastCall() );
+ ReadIfBoolAttribute(rSlot.aContainer, SvHash_Container() );
}
void SvIdlParser::ReadInterfaceOrShellMethod( SvMetaAttribute& rAttr )