Kaydet (Commit) fccc63b4 authored tarafından Mathias Bauer's avatar Mathias Bauer

#98405#: EnumSlots need names and arguments

üst 5d485445
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: database.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -119,7 +119,6 @@ class SvIdlDataBase ...@@ -119,7 +119,6 @@ class SvIdlDataBase
protected: protected:
#ifdef IDL_COMPILER #ifdef IDL_COMPILER
SvMetaAttributeMemberList& GetAttrList() { return aAttrList; }
ByteString aModulePrefix; ByteString aModulePrefix;
SvMetaObjectMemberStack aContextStack; SvMetaObjectMemberStack aContextStack;
String aPath; String aPath;
...@@ -141,6 +140,7 @@ public: ...@@ -141,6 +140,7 @@ public:
BOOL IsModified() const; BOOL IsModified() const;
SvMetaAttributeMemberList& GetAttrList() { return aAttrList; }
SvStringHashTable * GetIdTable() { return pIdTable; } SvStringHashTable * GetIdTable() { return pIdTable; }
SvMetaTypeMemberList & GetTypeList(); SvMetaTypeMemberList & GetTypeList();
SvMetaClassMemberList & GetClassList() { return aClassList; } SvMetaClassMemberList & GetClassList() { return aClassList; }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: slot.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1128,16 +1128,12 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix, ...@@ -1128,16 +1128,12 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
if( GetPseudoSlots() && pEnum && pEnum->Count() ) if( GetPseudoSlots() && pEnum && pEnum->Count() )
{ {
// Den MasterSlot clonen // Den MasterSlot clonen
SvMetaSlotRef xEnumSlot = Clone(); SvMetaSlotRef xEnumSlot;
SvMetaSlot *pFirstEnumSlot = xEnumSlot; SvMetaSlot *pFirstEnumSlot = NULL;
for( ULONG n = 0; n < pEnum->Count(); n++ ) for( ULONG n = 0; n < pEnum->Count(); n++ )
{ {
// Die Slaves sind kein Master !
xEnumSlot->aPseudoSlots = FALSE;
// Die SlotId erzeugen // Die SlotId erzeugen
SvMetaEnumValue *pEnumValue = pEnum->GetObject(n); SvMetaEnumValue *pEnumValue = pEnum->GetObject(n);
xEnumSlot->SetEnumValue(pEnumValue);
ByteString aValName = pEnumValue->GetName(); ByteString aValName = pEnumValue->GetName();
ByteString aSId( GetSlotId() ); ByteString aSId( GetSlotId() );
if( GetPseudoPrefix().Len() ) if( GetPseudoPrefix().Len() )
...@@ -1146,30 +1142,44 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix, ...@@ -1146,30 +1142,44 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
USHORT nLen = pEnum->GetPrefix().Len(); USHORT nLen = pEnum->GetPrefix().Len();
aSId += aValName.Copy( pEnum->GetPrefix().Len() ); aSId += aValName.Copy( pEnum->GetPrefix().Len() );
ULONG nValue; xEnumSlot = NULL;
if ( rBase.FindId(aSId , &nValue) ) for( ULONG m=0; m<rBase.GetAttrList().Count(); m++ )
{ {
SvNumberIdentifier aId; SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m );
*((SvIdentifier*)&aId) = aSId; if( pAttr->GetSlotId() == aSId )
aId.SetValue(nValue); {
xEnumSlot->SetSlotId(aId); SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr );
xEnumSlot = pSlot->Clone();
break;
}
} }
if ( xEnumSlot->GetSlotId().GetValue() < if ( m == rBase.GetAttrList().Count() )
pFirstEnumSlot->GetSlotId().GetValue() )
{ {
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 // Den erzeugten Slave ebenfalls einf"ugen
xEnumSlot->Insert( rList, rPrefix, rBase); xEnumSlot->Insert( rList, rPrefix, rBase);
// Die EnumSlots mit dem Master verketten // Die EnumSlots mit dem Master verketten
xEnumSlot->pLinkedSlot = this; xEnumSlot->pLinkedSlot = this;
// N"achster EnumSlot
if ( n != pEnum->Count() - 1 )
xEnumSlot = Clone();
} }
// Master zeigt auf den ersten Slave // Master zeigt auf den ersten Slave
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment