From c2f7c567b7264c25180e2717eabad61c4c92ae0e Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Sun, 30 Apr 2017 14:02:18 +0300 Subject: 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 --- idl/inc/globals.hxx | 2 -- idl/inc/slot.hxx | 2 -- idl/source/objects/slot.cxx | 86 +++++++++++---------------------------------- idl/source/prj/globals.cxx | 1 - idl/source/prj/parser.cxx | 59 +++++++++---------------------- 5 files changed, 37 insertions(+), 113 deletions(-) (limited to 'idl') diff --git a/idl/inc/globals.hxx b/idl/inc/globals.hxx index 964176cfcce6..d54153badc30 100644 --- a/idl/inc/globals.hxx +++ b/idl/inc/globals.hxx @@ -60,7 +60,6 @@ struct SvGlobalHashNames SvStringHashEntry* MM_Container; SvStringHashEntry* MM_ReadOnlyDoc; SvStringHashEntry* MM_struct; - SvStringHashEntry* MM_SlotType; SvStringHashEntry* MM_DisableFlags; SvGlobalHashNames(); @@ -122,7 +121,6 @@ HASH_INLINE(SbxObject) HASH_INLINE(Container) HASH_INLINE(ReadOnlyDoc) HASH_INLINE(struct) -HASH_INLINE(SlotType) HASH_INLINE(DisableFlags) diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx index 4816332ef6cf..b7762d0089df 100644 --- a/idl/inc/slot.hxx +++ b/idl/inc/slot.hxx @@ -26,7 +26,6 @@ class SvMetaSlot : public SvMetaAttribute { public: - tools::SvRef aSlotType; SvIdentifier aGroupId; SvIdentifier aExecMethod; SvIdentifier aStateMethod; @@ -84,7 +83,6 @@ public: SvMetaSlot(); SvMetaSlot( SvMetaType * pType ); - SvMetaType * GetSlotType() const; const OString& GetGroupId() const; const OString& GetExecMethod() const; const OString& GetStateMethod() const; 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(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 ) -- cgit