#include <loadbrsh.h>
Inheritance diagram for LoadBrushDirect:
Protected Member Functions | |
virtual BOOL | OnLoadDocument (Document *pKernelDoc) |
We need to replace indexed brush colours by local colours - since the linked indexed colours get deleted (this especially effects fill ramps!). | |
Private Member Functions | |
CC_DECLARE_MEMDUMP (LoadBrushDirect) |
Definition at line 120 of file loadbrsh.h.
|
|
|
We need to replace indexed brush colours by local colours - since the linked indexed colours get deleted (this especially effects fill ramps!).
Reimplemented from LoadDirect. Definition at line 131 of file loadbrsh.cpp. 00132 { 00133 ERROR3IF(pDoc==NULL,"No doc pointer during PrintMarksMan::ConvertAllDocColours!"); 00134 00135 Node *CurNode = Node::DocFindFirstDepthFirst(pDoc); 00136 Node *NextNode; 00137 00138 while (CurNode !=NULL) 00139 { 00140 // We may be about to chop this node out of the tree, so get the next node now 00141 NextNode = CurNode->DocFindNextDepthFirst(); 00142 00143 // Use to scan the colour fields of the attribute. 00144 UINT32 Context = 0; 00145 DocColour *pColour; 00146 00147 if (CurNode->IsAnAttribute()) 00148 { 00149 NodeAttribute *pNodeAttr = (NodeAttribute *) CurNode; 00150 00151 // Get the next colour field from the attribute 00152 pColour = pNodeAttr->EnumerateColourFields(Context++); 00153 00154 while (pColour != NULL) 00155 { 00156 // For each colour field, make sure the colour is a local DocColour so that 00157 // the sub-tree is entirely stand-alone 00158 if (pColour->FindParentIndexedColour() != NULL) 00159 { 00160 ColourGeneric ColDef; 00161 ColourContext *cc = ColourManager::GetColourContext(pColour->GetColourModel()); 00162 ERROR3IF(cc == NULL, "Can't find colour context?!"); 00163 00164 // Get the IndexedColour definition as a standalone colour definition 00165 cc->ConvertColour(pColour->FindParentIndexedColour(), &ColDef); 00166 00167 // Make the DocColour into a simple standalone "lookalike" of the parent colour 00168 *pColour = DocColour(pColour->GetColourModel(), &ColDef); 00169 } 00170 00171 pColour = pNodeAttr->EnumerateColourFields(Context++); 00172 } 00173 } 00174 CurNode = NextNode; 00175 } 00176 00177 // All is well we hope. 00178 return TRUE; 00179 }
|