diff options
author | Mathias Bauer <mba@openoffice.org> | 2002-05-07 09:26:30 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2002-05-07 09:26:30 +0000 |
commit | fccc63b47e36921cf1773ad7035143fb239cf6cd (patch) | |
tree | 69f6239db6124907b326837c8cae008c92be58ef /idl | |
parent | 5d4854451ba2784fc49edd0381e5af3d590e4738 (diff) |
#98405#: EnumSlots need names and arguments
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/database.hxx | 6 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 52 |
2 files changed, 34 insertions, 24 deletions
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx index 5b181efbd377..a4fb7d785550 100644 --- a/idl/inc/database.hxx +++ b/idl/inc/database.hxx @@ -2,9 +2,9 @@ * * $RCSfile: database.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:30:41 $ + * last change: $Author: mba $ $Date: 2002-05-07 10:26:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -119,7 +119,6 @@ class SvIdlDataBase protected: #ifdef IDL_COMPILER - SvMetaAttributeMemberList& GetAttrList() { return aAttrList; } ByteString aModulePrefix; SvMetaObjectMemberStack aContextStack; String aPath; @@ -141,6 +140,7 @@ public: BOOL IsModified() const; + SvMetaAttributeMemberList& GetAttrList() { return aAttrList; } SvStringHashTable * GetIdTable() { return pIdTable; } SvMetaTypeMemberList & GetTypeList(); SvMetaClassMemberList & GetClassList() { return aClassList; } diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 62c849c71f50..948321779bd1 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -2,9 +2,9 @@ * * $RCSfile: slot.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mba $ $Date: 2002-04-18 14:12:59 $ + * last change: $Author: mba $ $Date: 2002-05-07 10:26:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1128,16 +1128,12 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix, if( GetPseudoSlots() && pEnum && pEnum->Count() ) { // Den MasterSlot clonen - SvMetaSlotRef xEnumSlot = Clone(); - SvMetaSlot *pFirstEnumSlot = xEnumSlot; + SvMetaSlotRef xEnumSlot; + SvMetaSlot *pFirstEnumSlot = NULL; for( ULONG n = 0; n < pEnum->Count(); n++ ) { - // Die Slaves sind kein Master ! - xEnumSlot->aPseudoSlots = FALSE; - // Die SlotId erzeugen SvMetaEnumValue *pEnumValue = pEnum->GetObject(n); - xEnumSlot->SetEnumValue(pEnumValue); ByteString aValName = pEnumValue->GetName(); ByteString aSId( GetSlotId() ); if( GetPseudoPrefix().Len() ) @@ -1146,30 +1142,44 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix, USHORT nLen = pEnum->GetPrefix().Len(); aSId += aValName.Copy( pEnum->GetPrefix().Len() ); - ULONG nValue; - if ( rBase.FindId(aSId , &nValue) ) + xEnumSlot = NULL; + for( ULONG m=0; m<rBase.GetAttrList().Count(); m++ ) { - SvNumberIdentifier aId; - *((SvIdentifier*)&aId) = aSId; - aId.SetValue(nValue); - xEnumSlot->SetSlotId(aId); + SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m ); + if( pAttr->GetSlotId() == aSId ) + { + SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr ); + xEnumSlot = pSlot->Clone(); + break; + } } - if ( xEnumSlot->GetSlotId().GetValue() < - pFirstEnumSlot->GetSlotId().GetValue() ) + if ( m == rBase.GetAttrList().Count() ) { - pFirstEnumSlot = xEnumSlot; + DBG_ERROR("Invalid EnumSlot!"); + xEnumSlot = Clone(); + ULONG nValue; + if ( rBase.FindId(aSId , &nValue) ) + { + SvNumberIdentifier aId; + *((SvIdentifier*)&aId) = aSId; + aId.SetValue(nValue); + xEnumSlot->SetSlotId(aId); + } } + // Die Slaves sind kein Master ! + xEnumSlot->aPseudoSlots = FALSE; + xEnumSlot->SetEnumValue(pEnumValue); + + if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() ) + pFirstEnumSlot = xEnumSlot; + // Den erzeugten Slave ebenfalls einf"ugen xEnumSlot->Insert( rList, rPrefix, rBase); // Die EnumSlots mit dem Master verketten xEnumSlot->pLinkedSlot = this; - - // N"achster EnumSlot - if ( n != pEnum->Count() - 1 ) - xEnumSlot = Clone(); } // Master zeigt auf den ersten Slave |