#include <tmpltatr.h>
Inheritance diagram for WizOpStyleRefRecordHandler:
Public Member Functions | |
WizOpStyleRefRecordHandler () | |
BOOL | Init (BaseCamelotFilter *pFilter) |
Initialises the WizOpStyleRecordHandler. | |
virtual UINT32 * | GetTagList () |
Provides the record handler system with a list of records handled by this handler. | |
virtual BOOL | HandleRecord (CXaraFileRecord *pCXaraFileRecord) |
Handles the given TAG_WIZOP record. | |
Protected Member Functions | |
WizOpStyles & | GetImportedStyles () const |
Data access. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (WizOpStyleRefRecordHandler) | |
Private Attributes | |
WizOpStyles * | m_pStyleComponent |
Definition at line 246 of file tmpltatr.h.
|
Definition at line 252 of file tmpltatr.h. 00252 : m_pStyleComponent(NULL) {}
|
|
|
|
Data access.
Definition at line 1445 of file tmpltatr.cpp. 01446 { 01447 // This static dummy object is used for returning in the ERROR2 case 01448 // The original used to return a ptr to a local variable, which is a tad dangerous. 01449 // This solution is not ideal, because there's a permanent instance of an object 01450 // that will probably never be used. 01451 static WizOpStyles Dummy; 01452 01453 ERROR2IF(m_pStyleComponent == NULL, Dummy, "NULL Member"); 01454 01455 return *m_pStyleComponent; 01456 }
|
|
Provides the record handler system with a list of records handled by this handler.
Implements CXaraFileRecordHandler. Definition at line 1339 of file tmpltatr.cpp. 01340 { 01341 static const UINT32 TagList[] = { TAG_WIZOP_STYLEREF, CXFRH_TAG_LIST_END}; 01342 01343 return (UINT32*)&TagList; 01344 }
|
|
Handles the given TAG_WIZOP record.
Implements CXaraFileRecordHandler. Definition at line 1396 of file tmpltatr.cpp. 01397 { 01398 ERROR2IF(pRecord == NULL,FALSE,"pCXaraFileRecord is NULL"); 01399 ERROR2IF(pRecord->GetTag() != TAG_WIZOP_STYLEREF, FALSE, "I don't handle this tag type"); 01400 01401 XFileRef StyleRecordRef; 01402 01403 BOOL Ok = pRecord->ReadINT32(&StyleRecordRef); 01404 if (Ok) 01405 { 01406 WizOpStyle* const pStyle = GetImportedStyles().FindStyleFromRecordReference(StyleRecordRef); 01407 if (pStyle != NULL) 01408 { 01409 // We managed to read it all OK so add a new StyleRefAttribute to the tree 01410 StyleReferenceAttribute* const pNewAttribute = new StyleReferenceAttribute(*pStyle); 01411 01412 if (pNewAttribute != NULL) 01413 { 01414 Ok = InsertNode(pNewAttribute); 01415 } 01416 else 01417 { 01418 Ok = FALSE; 01419 } 01420 } 01421 else 01422 { 01423 BaseCamelotFilter* const pFilter = GetBaseCamelotFilter(); 01424 ENSURE_NOT_NULL(pFilter); 01425 pFilter->AppendWarning(_R(IDS_STYLE_NOT_FOUND)); 01426 } 01427 } 01428 01429 return Ok; 01430 }
|
|
Initialises the WizOpStyleRecordHandler.
Reimplemented from CamelotRecordHandler. Definition at line 1360 of file tmpltatr.cpp. 01361 { 01362 BOOL Ok = TRUE; 01363 01364 Ok = CamelotRecordHandler::Init(pFilter); 01365 01366 Document* const pDoc = GetDocument(); 01367 Ok = (pDoc != NULL); 01368 01369 if (Ok) 01370 { 01371 m_pStyleComponent = (WizOpStyles*)pDoc->GetDocComponent( CC_RUNTIME_CLASS(WizOpStyles) ); 01372 Ok = (m_pStyleComponent != NULL); 01373 } 01374 01375 return Ok; 01376 }
|
|
Definition at line 268 of file tmpltatr.h. |