diff options
Diffstat (limited to 'idl/source')
-rw-r--r-- | idl/source/objects/object.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 271 | ||||
-rw-r--r-- | idl/source/objects/types.cxx | 2 | ||||
-rw-r--r-- | idl/source/prj/command.cxx | 2 | ||||
-rw-r--r-- | idl/source/prj/globals.cxx | 2 | ||||
-rw-r--r-- | idl/source/prj/parser.cxx | 2 |
6 files changed, 63 insertions, 218 deletions
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index d4b2eee57eae..931ad3a1aacf 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -192,7 +192,7 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& // Write only if not already written by subclass or // imported interface. rSuperList.push_back(nId); - pAttr->Insert(rList, rPrefix, rBase); + pAttr->Insert(rList); } } diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 1c21a4ad039e..1a5c68e65d3d 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -28,10 +28,8 @@ SvMetaSlot::SvMetaSlot() : aRecordPerSet( true ) , aRecordAbsolute( false ) - , pLinkedSlot(nullptr) , pNextSlot(nullptr) , nListPos(0) - , pEnumValue(nullptr) , aReadOnlyDoc ( true ) , aExport( true ) { @@ -41,10 +39,8 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType ) : SvMetaAttribute( pType ) , aRecordPerSet( true ) , aRecordAbsolute( false ) - , pLinkedSlot(nullptr) , pNextSlot(nullptr) , nListPos(0) - , pEnumValue(nullptr) , aReadOnlyDoc ( true ) , aExport( true ) { @@ -131,11 +127,6 @@ const OString& SvMetaSlot::GetStateMethod() const if( !aStateMethod.getString().isEmpty() || !GetRef() ) return aStateMethod.getString(); return static_cast<SvMetaSlot *>(GetRef())->GetStateMethod(); } -bool SvMetaSlot::GetPseudoSlots() const -{ - if( aPseudoSlots.IsSet() || !GetRef() ) return aPseudoSlots; - return static_cast<SvMetaSlot *>(GetRef())->GetPseudoSlots(); -} bool SvMetaSlot::GetToggle() const { if( aToggle.IsSet() || !GetRef() ) return aToggle; @@ -183,11 +174,6 @@ bool SvMetaSlot::GetRecordAbsolute() const return aRecordAbsolute; return static_cast<SvMetaSlot *>(GetRef())->GetRecordAbsolute(); } -const OString& SvMetaSlot::GetPseudoPrefix() const -{ - if( !aPseudoPrefix.getString().isEmpty() || !GetRef() ) return aPseudoPrefix.getString(); - return static_cast<SvMetaSlot *>(GetRef())->GetPseudoPrefix(); -} bool SvMetaSlot::GetMenuConfig() const { if( aMenuConfig.IsSet() || !GetRef() ) return aMenuConfig; @@ -220,7 +206,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm ); bool bOk = false; - bOk |= aPseudoSlots.ReadSvIdl( SvHash_PseudoSlots(), rInStm ); bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm ); bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm ); bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm ); @@ -260,7 +245,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, bOk = true; } - bOk |= aPseudoPrefix.ReadSvIdl( SvHash_PseudoPrefix(), rInStm ); bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm ); bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm ); bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm ); @@ -376,14 +360,12 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) return bOk; } -void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, - SvIdlDataBase& rBase) +void SvMetaSlot::Insert( SvSlotElementList& rList) { // get insert position through binary search in slotlist sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue(); sal_uInt16 nListCount = (sal_uInt16) rList.size(); sal_uInt16 nPos; - sal_uLong m; // for inner "for" loop if ( !nListCount ) nPos = 0; @@ -441,90 +423,6 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, { rList.push_back( this ); } - - // iron out EnumSlots - SvMetaTypeEnum * pEnum = nullptr; - SvMetaType * pBType = GetType()->GetBaseType(); - pEnum = dynamic_cast<SvMetaTypeEnum*>( pBType ); - if( GetPseudoSlots() && pEnum && pEnum->Count() ) - { - // clone the MasterSlot - tools::SvRef<SvMetaSlot> xEnumSlot; - SvMetaSlot *pFirstEnumSlot = nullptr; - for( sal_uLong n = 0; n < pEnum->Count(); n++ ) - { - // create SlotId - SvMetaEnumValue *enumValue = pEnum->GetObject(n); - OString aValName = enumValue->GetName(); - OStringBuffer aBuf; - if( !GetPseudoPrefix().isEmpty() ) - aBuf.append(GetPseudoPrefix()); - else - aBuf.append(GetSlotId().getString()); - aBuf.append('_'); - aBuf.append(aValName.copy(pEnum->GetPrefix().getLength())); - - OString aSId = aBuf.makeStringAndClear(); - - xEnumSlot = nullptr; - for( m=0; m<rBase.GetSlotList().size(); m++ ) - { - SvMetaSlot * pAttr = rBase.GetSlotList()[m]; - if (aSId.equals(pAttr->GetSlotId().getString())) - { - SvMetaSlot& rSlot = dynamic_cast<SvMetaSlot&>(*pAttr); - xEnumSlot = new SvMetaSlot( rSlot ); - break; - } - } - - if ( m == rBase.GetSlotList().size() ) - { - OSL_FAIL(OString("Invalid EnumSlot! " + aSId).getStr()); - xEnumSlot = new SvMetaSlot( *this ); - sal_uLong nValue; - if ( rBase.FindId(aSId , &nValue) ) - { - SvIdentifier aId; - aId.setString(aSId); - aId.SetValue(nValue); - xEnumSlot->SetSlotId(aId); - } - } - - // The slaves are no master! - xEnumSlot->aPseudoSlots = false; - xEnumSlot->SetEnumValue(enumValue); - - if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() ) - pFirstEnumSlot = xEnumSlot.get(); - - // insert the created slave as well - xEnumSlot->Insert( rList, rPrefix, rBase); - - // concatenate the EnumSlots with the master - xEnumSlot->pLinkedSlot = this; - } - - // master points to the first slave - pLinkedSlot = pFirstEnumSlot; - - // concatenate slaves among themselves - xEnumSlot = pFirstEnumSlot; - size_t i = 0; - SvMetaSlot* pEle; - do - { - pEle = ( ++i < rList.size() ) ? rList[ i ] : nullptr; - if ( pEle && pEle->pLinkedSlot == this ) - { - xEnumSlot->pNextSlot = pEle; - xEnumSlot = pEle; - } - } - while ( pEle ); - xEnumSlot->pNextSlot = pFirstEnumSlot; - } } @@ -600,18 +498,13 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, if ( !GetExport() && !GetHidden() ) return; - bool bIsEnumSlot = nullptr != pEnumValue; - rOutStm.WriteCharPtr( "// Slot Nr. " ) .WriteOString( OString::number(nListPos) ) .WriteCharPtr( " : " ); OString aSlotIdValue(OString::number(GetSlotId().GetValue())); rOutStm.WriteOString( aSlotIdValue ) << endl; WriteTab( rOutStm, 1 ); - if( bIsEnumSlot ) - rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ENUM( " ); - else - rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ; + rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ; rOutStm.WriteOString( rSlotId ).WriteChar( ',' ); @@ -623,100 +516,68 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, rOutStm.WriteChar( ',' ) << endl; WriteTab( rOutStm, 4 ); - if( bIsEnumSlot ) + // look for the next slot with the same StateMethod like me + // the slotlist is set to the current slot + size_t i = nStart; + SvMetaSlot* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; + pNextSlot = pEle; + while ( pNextSlot ) { - rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) - .WriteOString( OString::number(pLinkedSlot->GetListPos()) ) - .WriteCharPtr( "] /*Offset Master*/, " ) << endl; - WriteTab( rOutStm, 4 ); - rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) - .WriteOString( OString::number(pNextSlot->GetListPos()) ) - .WriteCharPtr( "] /*Offset Next*/, " ) << endl; - - WriteTab( rOutStm, 4 ); - - // SlotId - if( !GetSlotId().getString().isEmpty() ) - rOutStm.WriteOString( pLinkedSlot->GetSlotId().getString() ); - else - rOutStm.WriteChar( '0' ); - rOutStm.WriteChar( ',' ); - rOutStm.WriteOString( pEnumValue->GetName() ); + if ( !pNextSlot->pNextSlot && + pNextSlot->GetStateMethod() == GetStateMethod() + ) { + break; + } + pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; + pNextSlot = pEle; } - else + + if ( !pNextSlot ) { - // look for the next slot with the same StateMethod like me - // the slotlist is set to the current slot - size_t i = nStart; - SvMetaSlot* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; + // There is no slot behind me that has the same ExecMethod. + // So I search for the first slot with it (could be myself). + i = 0; + pEle = rSlotList.empty() ? nullptr : rSlotList[ i ]; pNextSlot = pEle; - while ( pNextSlot ) + while ( pNextSlot != this ) { - if ( !pNextSlot->pNextSlot && - pNextSlot->GetStateMethod() == GetStateMethod() - ) { + if ( pNextSlot->GetStateMethod() == GetStateMethod() ) break; - } pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; pNextSlot = pEle; } + } - if ( !pNextSlot ) - { - // There is no slot behind me that has the same ExecMethod. - // So I search for the first slot with it (could be myself). - i = 0; - pEle = rSlotList.empty() ? nullptr : rSlotList[ i ]; - pNextSlot = pEle; - while ( pNextSlot != this ) - { - if ( !pNextSlot->pEnumValue && - pNextSlot->GetStateMethod() == GetStateMethod() ) - break; - pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; - pNextSlot = pEle; - } - } - if ( !pLinkedSlot ) - { - rOutStm.WriteCharPtr( "0 ," ); - } - else - { - rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) - .WriteOString( OString::number(pLinkedSlot->GetListPos()) ) - .WriteCharPtr( "] /*Offset Linked*/, " ) << endl; - WriteTab( rOutStm, 4 ); - } + rOutStm.WriteCharPtr( "0 ," ); - rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) - .WriteOString( OString::number(pNextSlot->GetListPos()) ) - .WriteCharPtr( "] /*Offset Next*/, " ) << endl; + rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) + .WriteOString( OString::number(pNextSlot->GetListPos()) ) + .WriteCharPtr( "] /*Offset Next*/, " ) << endl; - WriteTab( rOutStm, 4 ); + WriteTab( rOutStm, 4 ); - // write ExecMethod, with standard name if not specified - if( !GetExecMethod().isEmpty() && - GetExecMethod() != "NoExec") - { - rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) - .WriteOString( GetExecMethod() ).WriteChar( ')' ); - } - else - rOutStm.WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE" ); - rOutStm.WriteChar( ',' ); + // write ExecMethod, with standard name if not specified + if( !GetExecMethod().isEmpty() && + GetExecMethod() != "NoExec") + { + rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) + .WriteOString( GetExecMethod() ).WriteChar( ')' ); + } + else + rOutStm.WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE" ); + rOutStm.WriteChar( ',' ); - // write StateMethod, with standard name if not specified - if( !GetStateMethod().isEmpty() && - GetStateMethod() != "NoState") - { - rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) - .WriteOString( GetStateMethod() ).WriteChar( ')' ); - } - else - rOutStm.WriteCharPtr( "SFX_STUB_PTR_STATE_NONE" ); + // write StateMethod, with standard name if not specified + if( !GetStateMethod().isEmpty() && + GetStateMethod() != "NoState") + { + rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) + .WriteOString( GetStateMethod() ).WriteChar( ')' ); } + else + rOutStm.WriteCharPtr( "SFX_STUB_PTR_STATE_NONE" ); + rOutStm.WriteChar( ',' ) << endl; WriteTab( rOutStm, 4 ); @@ -757,36 +618,26 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, rOutStm.WriteOString( GetDisableFlags() ); // write attribute type - if( !bIsEnumSlot ) - { - rOutStm.WriteChar( ',' ) << endl; - WriteTab( rOutStm, 4 ); + rOutStm.WriteChar( ',' ) << endl; + WriteTab( rOutStm, 4 ); - SvMetaType * pT = GetSlotType(); - if( !pT ) - { - if( !IsVariable() ) - pT = rBase.FindType( "SfxVoidItem" ); - else - pT = GetType(); - } - if( pT ) - { - rOutStm.WriteOString( pT->GetName() ); - if( !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) ) - rBase.aUsedTypes.push_back( pT ); - } + SvMetaType * pT = GetSlotType(); + if( !pT ) + { + if( !IsVariable() ) + pT = rBase.FindType( "SfxVoidItem" ); else - rOutStm.WriteCharPtr( "SfxVoidItem not defined" ); + pT = GetType(); } - else + if( pT ) { - SvMetaType *pT = rBase.FindType( "SfxBoolItem" ); - if ( pT && !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) ) + rOutStm.WriteOString( pT->GetName() ); + if( !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) ) rBase.aUsedTypes.push_back( pT ); } + else + rOutStm.WriteCharPtr( "SfxVoidItem not defined" ); - if( !bIsEnumSlot ) { rOutStm.WriteChar( ',' ) << endl; WriteTab( rOutStm, 4 ); diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index d76333524ddc..30b945c9abcb 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -115,7 +115,7 @@ sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray ) } } -void SvMetaAttribute::Insert (SvSlotElementList&, const OString&, SvIdlDataBase&) +void SvMetaAttribute::Insert(SvSlotElementList&) { } diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 02a3661b8155..4c83b588d67c 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -83,8 +83,6 @@ char const * const SyntaxStrings[] = { "\t\tFastCall", "\t\tGet, Set", "\t\tGroupId = Identifier", -"\t\tPseudoPrefix = Identifier", -"\t\tPseudoSlots", "\t\tReadOnlyDoc*", "\t\tRecordPerSet*, RecordPerItem, NoRecord", "\t\tRecordAbsolute", diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index 483c41dd4191..57b27b1c85e5 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -74,7 +74,6 @@ SvGlobalHashNames::SvGlobalHashNames() A_ENTRY(float) A_ENTRY(double) A_ENTRY(item) - A_ENTRY(PseudoSlots) A_ENTRY(import) A_ENTRY(SlotIdFile) A_ENTRY(include) @@ -82,7 +81,6 @@ SvGlobalHashNames::SvGlobalHashNames() A_ENTRY(StateMethod) A_ENTRY(GroupId) A_ENTRY(Export) - A_ENTRY(PseudoPrefix) A_ENTRY(define) A_ENTRY(MenuConfig) A_ENTRY(ToolBoxConfig) diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index 2172fb87b029..d7d134723cf4 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -382,7 +382,6 @@ bool SvIdlParser::ReadSlot(SvMetaSlot& rSlot) void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot ) { bool bOk = false; - bOk |= ReadIfBoolAttribute(rSlot.aPseudoSlots, SvHash_PseudoSlots() ); bOk |= ReadIfIdAttribute(rSlot.aGroupId, SvHash_GroupId() ); bOk |= ReadIfIdAttribute(rSlot.aExecMethod, SvHash_ExecMethod() ); bOk |= ReadIfIdAttribute(rSlot.aStateMethod, SvHash_StateMethod() ); @@ -417,7 +416,6 @@ void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot ) bOk = true; } - bOk |= ReadIfIdAttribute(rSlot.aPseudoPrefix, SvHash_PseudoPrefix() ); bOk |= ReadIfBoolAttribute(rSlot.aMenuConfig, SvHash_MenuConfig() ); bOk |= ReadIfBoolAttribute(rSlot.aToolBoxConfig, SvHash_ToolBoxConfig() ); bOk |= ReadIfBoolAttribute(rSlot.aAccelConfig, SvHash_AccelConfig() ); |