NewColourList Class Reference

Holds a list of colours that are imported while importing a file into a Camelot document. More...

#include <impcol.h>

Inheritance diagram for NewColourList:

List CCObject SimpleCCObject List of all members.

Public Member Functions

NewColourAddColour (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.

Detailed Description

Holds a list of colours that are imported while importing a file into a Camelot document.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/94
See also:
NewColour; ImportedColours

Definition at line 195 of file impcol.h.


Member Function Documentation

NewColour * NewColourList::AddColour IndexedColour pCol,
BOOL  AlreadyExists
 

Add a new colour to the list of colours.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/94
Parameters:
pCol - the new colour to add to the document. [INPUTS] AlreadyExists - TRUE if pNewCol points to a colour that already exists in the destination document; FALSE if pNewCol poinst to a brand new colour.
Returns:
Pointer to the newly added colour, or NULL if out of memory => ERROR1

Errors: Out of memory => ERROR1

See also:
NewColour

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 }

DWORD NewColourList::GetCount void   )  const
 

Find out how many colours are held in this list - this includes any duplicates.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/12/94
Returns:
Number of colours in this list.

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:28 2007 for Camelot by  doxygen 1.4.4