#include <impcol.h>
Inheritance diagram for NewColourList:
Public Member Functions | |
NewColour * | AddColour (IndexedColour *pCol, BOOL AlreadyExists) |
Add a new colour to the list of colours. | |
DWORD | GetCount () const |
Find out how many colours are held in this list - this includes any duplicates. |
Definition at line 195 of file impcol.h.
|
Add a new colour to the list of colours.
Definition at line 439 of file impcol.cpp. 00440 { 00441 NewColour *pNewCol = new NewColour(pCol, AlreadyExists); 00442 00443 // Check for out of memory 00444 if (pNewCol == NULL) 00445 return NULL; 00446 00447 // Add to the list and return success 00448 AddTail(pNewCol); 00449 return pNewCol; 00450 }
|
|
Find out how many colours are held in this list - this includes any duplicates.
Reimplemented from List. Definition at line 465 of file impcol.cpp. 00466 { 00467 DWORD Count = 0; 00468 NewColour *pItem = (NewColour *) GetHead(); 00469 00470 while (pItem != NULL) 00471 { 00472 // Count this item 00473 Count++; 00474 00475 // Count any duplicates 00476 NewColour *pDup = pItem->pNextDuplicate; 00477 00478 while (pDup != NULL) 00479 { 00480 // Count this duplicate 00481 Count++; 00482 00483 // Try next duplicate 00484 pDup = pDup->pNextDuplicate; 00485 } 00486 00487 // Try next item 00488 pItem = (NewColour *) GetNext(pItem); 00489 } 00490 00491 return Count; 00492 }
|