Commits

Anonymous committed e4bbd0b

CWS-TOOLING: integrate CWS m48fixshorttrack
2009-05-18 14:54:14 +0200 mba r272025 : #i101919#: fix event list

Comments (0)

Files changed (2)

sfx2/inc/sfx2/evntconf.hxx

                 , maUIName( rUIName ) {}
 };
 
-DECLARE_TABLE( _SfxEventNamesList, SfxEventName* )
+DECLARE_LIST( _SfxEventNamesList, SfxEventName* )
 
 class SFX2_DLLPUBLIC SfxEventNamesList : public _SfxEventNamesList
 {

sfx2/source/config/evntconf.cxx

 SfxEventNamesList& SfxEventNamesList::operator=( const SfxEventNamesList& rTbl )
 {
 	DelDtor();
-	SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).First();
-	while( pTmp )
+	for (USHORT n=0; n<rTbl.Count(); n++ )
 	{
+		SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).GetObject(n);
 		SfxEventName *pNew = new SfxEventName( *pTmp );
-		Insert( rTbl.GetCurKey(), pNew );
-		pTmp = ((SfxEventNamesList&)rTbl).Next();
+		Insert( pNew, n );
 	}
 	return *this;
 }
 	const SfxEventNamesList& rOwn = aEventsList;
 	const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList;
 
-	// Anzahl unterschiedlich => auf jeden Fall ungleich
 	if ( rOwn.Count() != rOther.Count() )
 		return FALSE;
 
-	// einzeln verleichen; wegen Performance ist die Reihenfolge wichtig
 	for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo )
 	{
 		const SfxEventName *pOwn = rOwn.GetObject(nNo);
 		const SfxEventName *pOther = rOther.GetObject(nNo);
-		if ( 	rOwn.GetKey(pOwn) != rOther.GetKey(pOther)  ||
+		if ( 	pOwn->mnId != pOther->mnId ||
 				pOwn->maEventName != pOther->maEventName ||
 				pOwn->maUIName != pOther->maUIName )
 			return FALSE;
 void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, USHORT nID )
 {
 	SfxEventName* pName;
-	if ( 0 != (pName=aEventsList.Get(nID)) )
-	{
-		DBG_WARNING("Event already added!");
-	}
-	else
-		aEventsList.Insert( nID, new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
+	aEventsList.Insert( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) );
 }
 
 // class SfxAsyncEvent_Impl ----------------------------------------------
         return;
     }
 
-    gp_Id_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) );
+    gp_Id_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
     nPos = GetPos_Impl( rMacroName, bFound );
 
 	DBG_ASSERT( !bFound, "RegisterEvent: Name in List, but ID not?" );
 
-    gp_Name_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) );
+    gp_Name_SortList->Insert( new SfxEventName( nId, rMacroName, rUIName ), nPos );
 
     SFX_APP()->GetEventConfig();
 }