#include "camtypes.h"
#include "ophist.h"
Go to the source code of this file.
Functions | |
CC_IMPLEMENT_DYNCREATE (UndoableOperation, Operation) BOOL ObjectSet | |
Adds pObject to the set. |
|
Adds pObject to the set.
Definition at line 148 of file undoop.cpp. 00161 : Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00162 Created: 12/5/95 00163 Returns: FALSE if we run out of memory 00164 Purpose: Adds pObject to the set 00165 SeeAlso: ObjectSet::InSet 00166 SeeAlso: ObjectSet::CopySet 00167 00168 00169 ********************************************************************************************/ 00170 00171 BOOL ObjectSet::AddToSet(NodeRenderableInk* pObject) 00172 { 00173 ERROR3IF(pObject == NULL, "AddToSet: pObject is NULL"); 00174 // Determine if the pObject is already in the set 00175 ObjectItem* pObjItem = (ObjectItem*) GetHead(); 00176 while (pObjItem != NULL) 00177 { 00178 if (pObjItem->pObject == pObject) 00179 { 00180 return TRUE; // Already in set so return 00181 } 00182 pObjItem = (ObjectItem*)GetNext(pObjItem); 00183 } 00184 00185 // The attribute type is not in the set so let's add it 00186 pObjItem = new ObjectItem; 00187 if (!pObjItem) 00188 return FALSE; // out of memory (error has been set) 00189 00190 pObjItem->pObject = pObject; 00191 00192 AddHead(pObjItem); // Add attribute to the head of the list 00193 00194 return TRUE; 00195 }
|