当前位置: 首页>>代码示例>>C++>>正文


C++ ERROR2IF函数代码示例

本文整理汇总了C++中ERROR2IF函数的典型用法代码示例。如果您正苦于以下问题:C++ ERROR2IF函数的具体用法?C++ ERROR2IF怎么用?C++ ERROR2IF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ERROR2IF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ERROR2IF

BOOL BfxPixelOp::SetBitmap(KernelBitmap * pKB, DWORD theCacheStateMask, DWORD theCacheValueMask,
								  BOOL theDefaultValue)
{
	Base = NULL;
	ERROR2IF( ((!pKB) || (pKB->ActualBitmap==NULL)) ,FALSE,"BfxALU can't find OIL bitmap");
	ERROR3IF( (!(pKB->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxALU Oil layer inconsistency");

	BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pKB->ActualBitmap))->BMInfo->bmiHeader);

	ERROR2IF( (BPP && pBMI->biBitCount != BPP), FALSE, "BfxPixelOp called with incorrect BPP");

	Base = (DWORD *)(void *)(((CWxBitmap *)(pKB->ActualBitmap))->BMBytes);
	Width = pBMI->biWidth;
	INT32 Bits = pBMI->biBitCount;
	switch (Bits)
	{
		case 1 : WidthRounded = (Width+31) &~31; break;
		case 2 : WidthRounded = (Width+15) &~15; break;
		case 4 : WidthRounded = (Width+7) &~7; break;
		case 8 : WidthRounded = (Width+3) &~3; break;
		case 16: WidthRounded = (Width+1) &~1; break;
		case 32:
		default:
				 WidthRounded = Width; break;
	}

 	Height = pBMI->biHeight;
	Size = (pBMI->biSizeImage)>>2;

	return TRUE;
}
开发者ID:UIKit0,项目名称:xara-xtreme,代码行数:31,代码来源:bfxpixop.cpp

示例2: TRACEUSER

BOOL PointersTab::CommitSection()
{
TRACEUSER( "Neville", _T("commit PointersTab section\n"));
	ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::CommitSection called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS));	// The pointers page identifier
	if (!ok)
		return TRUE;	// Talk to page failed to return now

	// Section = Pointers

	// Ok has been pressed so take the values from this section of the dialog box
	BOOL Valid=FALSE;		// Flag for validity of value
//	BOOL State=FALSE;		// Flag for state of button/switch
	BOOL SetOk=TRUE;		// Preference value set ok

	// Middle button removed for now as nothing seems to use it.

	// 0, 1 or 2 indicating Left Middle or Right mouse button
	ButtonFunction LeftButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_LEFTBUTTON));
//	ButtonFunction MiddleButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_MIDDLEBUTTON));
	ButtonFunction RightButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_RIGHTBUTTON));
	ClickModifiers::SetButtonFunc(0, LeftButton);
//	ClickModifiers::SetButtonFunc(1, MiddleButton);
	ClickModifiers::SetButtonFunc(2, RightButton);

	// All units work off the selected document and so we must do nothing if there is no
	// selected document. Check our clas variable to see if this is true or not.
	// Units should have been set up by the caller.
	if (pDocument == NULL || pSpread == NULL)
		return (TRUE);

	// Now the magnetic radii
	INT32 LineRadius = 0;					
	INT32 PointRadius = 0;					
	LineRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_LINERADIUS), CurrentPageUnits,
											 0, INT_MAX, _R(IDE_OPTS_INVALIDLINERAD), &Valid);
TRACEUSER( "Neville", _T("commit LineRadius distance='%d' Valid ='%d'\n"),LineRadius, Valid);
	if (Valid)
	{
		SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Line Radius"), &LineRadius);
		ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT));
	}
	else
		return FALSE; 			// Magnetic line radius incorrect, user has been warned already

	PointRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_POINTRADIUS), CurrentPageUnits,
											 0, INT_MAX, _R(IDE_OPTS_INVALIDPOINTRAD), &Valid);
TRACEUSER( "Neville", _T("commit PointRadius distance='%d' Valid ='%d'\n"),PointRadius, Valid);
	if (Valid)
	{
		SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Point Radius"), &PointRadius);
		ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT));
	}
	else
		return FALSE; 			// Magnetic point radius incorrect, user has been warned already


	return TRUE;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:60,代码来源:optspntr.cpp

示例3: Peter_Arnold

/********************************************************************************************

>	BOOL EllipseTool::Init()

	Author:		Peter_Arnold (Xara Group Ltd) <[email protected]>
	Created:	18/03/95
	Inputs:		-
	Outputs:	-
	Returns:	TRUE/FALSE for success/failure
	Purpose:	Called to initialise the ellipse tool.
	Errors:		-
	SeeAlso:	QuickShapeBase::Init

********************************************************************************************/
BOOL EllipseTool::Init()
{
	BOOL ok = TRUE;

	pQuickShapeBaseInfoBarOp = new QuickShapeBaseInfoBarOp(this, _R(IDD_ELLIPSETOOLBAR));
	return pQuickShapeBaseInfoBarOp != NULL;

PORTNOTE("dialog", "Removed Bar reading")
#if 0
	CCResTextFile file;									// Resource File
	QuickShapeBaseInfoBarOpCreate BarCreate;			// Object that creates QuickShapeBaseInfoBarOp objects

	 		ok = file.open(_R(IDM_ELLIPSE_BAR), _R(IDT_INFO_BAR_RES));	// Open resource
	if (ok) ok = DialogBarOp::ReadBarsFromFile(file,BarCreate);	// Read and create info bar
	if (ok) file.close();									 	// Close resource

	ERROR2IF(!ok,FALSE,"Unable to load EllipseTool.ini from resource"); 

	// Info bar now exists.  Now get a pointer to it
	String_32 str = String_32(_R(IDS_ELIPTOOL_INFOBARNAME));
	DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(str);
	
	ERROR2IF(pDialogBarOp==NULL, FALSE, "Ellipse infobar not found\n");

	ok = pDialogBarOp->IsKindOf(CC_RUNTIME_CLASS(QuickShapeBaseInfoBarOp));
	if (ok)
	{
		pQuickShapeBaseInfoBarOp = (QuickShapeBaseInfoBarOp*)pDialogBarOp;
		pQuickShapeBaseInfoBarOp->pQuickShapeBase = this;
	}
#endif
	ERROR2IF(!ok,FALSE,"Error finding the Ellipse tool info bar");

	return (ok);
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:49,代码来源:eliptool.cpp

示例4: ERROR2IF

BOOL FreeHandEPSFilter::ValidateGroup(Node *pGroup)
{
	ERROR2IF(pGroup == 0, FALSE, "Group passed to validateGroup is null");

	Node *pFirstChild = pGroup->FindFirstChild();

	ERROR2IF(pFirstChild == 0, FALSE, "Group without children passed to ValidateGroup - should have been deleted by EndGroup"); 

	if(pFirstChild->FindNext() == 0)
	{
		// there was only one object - delete this group.

		// if pFirstNodeInRange is this node, set it to the child
		if(pFirstNodeInRange == pGroup)
			pFirstNodeInRange = pFirstChild;
		
		// move the child to the parent of the group
		if (!ImportInfo.pOp->DoMoveNode(pFirstChild, pNode, LASTCHILD))
			return FALSE;

		// see EPSFilter::EndGroup for the reason why it's hidden rather than deleted
		if (!ImportInfo.pOp->DoHideNode(pGroup, TRUE))
			return FALSE;

	}

	return TRUE;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:28,代码来源:freeeps.cpp

示例5: Colin_Barfoot

/********************************************************************************************

>	virtual BOOL WizOpStyleRefRecordHandler::HandleRecord(CXaraFileRecord* pRecord)

 	Author:		Colin_Barfoot (Xara Group Ltd) <[email protected]>
	Created:	27/06/97

	Purpose:	Handles the given TAG_WIZOP record.

	Inputs:		pCXaraFileRecord = ptr to record to handle

	Returns:	TRUE if handled successfuly
				FALSE otherwise

	Errors:		If pCXaraFileRecord isn't a TAG_WIZOP record

********************************************************************************************/
BOOL WizOpStyleRefRecordHandler::HandleRecord(CXaraFileRecord* pRecord)
{
	ERROR2IF(pRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
	ERROR2IF(pRecord->GetTag() != TAG_WIZOP_STYLEREF, FALSE, "I don't handle this tag type");

	XFileRef			StyleRecordRef;

	BOOL				Ok = pRecord->ReadINT32(&StyleRecordRef);
	if (Ok)
	{
		WizOpStyle* const pStyle = GetImportedStyles().FindStyleFromRecordReference(StyleRecordRef);
		if (pStyle != NULL)
		{
			// We managed to read it all OK so add a new StyleRefAttribute to the tree
		 	StyleReferenceAttribute* const pNewAttribute = new StyleReferenceAttribute(*pStyle);
		
			if (pNewAttribute != NULL)
			{
				Ok = InsertNode(pNewAttribute);
			}
			else
			{
				Ok = FALSE;
			}
		}
		else
		{
			BaseCamelotFilter* const pFilter = GetBaseCamelotFilter();
			ENSURE_NOT_NULL(pFilter);
			pFilter->AppendWarning(_R(IDS_STYLE_NOT_FOUND));
		}
	}

	return Ok;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:52,代码来源:tmpltatr.cpp

示例6: ERROR2IF

BOOL PushTool::GetStatusLineText(String_256* pText, Spread*, DocCoord, ClickModifiers)
{
	ERROR2IF(this==NULL, FALSE,"PushTool::GetStatusLineText() - this==NULL");
	ERROR2IF(pText==NULL,FALSE,"PushTool::GetStatusLineText() - pText==NULL");

	return pText->Load(_R(IDS_PUSHTOOL_STATUSHELP));
}
开发者ID:UIKit0,项目名称:xara-xtreme,代码行数:7,代码来源:pushtool.cpp

示例7: Peter_Arnold

/********************************************************************************************
>	BOOL OpMakeSegmentsLines::ProcessSegment(NodePath* pPath, INT32* Index, INT32 PrevIndex)

	Author:		Peter_Arnold (Xara Group Ltd) <[email protected]>
	Created:	16/8/95
	Inputs:		pPath - points to the path to process
				Index - index of the PT_BEZIERTO segment to change into lines
				PrevIndex - index of the previois endpoint (other end of the segment to process)
	Outputs:	Index is changed to point to the new index of the end of the segment
	Returns:	TRUE/FALSE for success/failure
	Purpose:	Performs the make selected segments into lines operation. 
	Errors:		-
	SeeAlso:	OpBaseConvertPathSegment::Do
********************************************************************************************/
BOOL OpMakeSegmentsLines::ProcessSegment(NodePath* pPath, INT32* Index, INT32 PrevIndex)
{
	// Get the path pointers
	PathVerb* Verbs;
	PathFlags* Flags;
	DocCoord* Coords;
	pPath->InkPath.GetPathArrays(&Verbs, &Coords, &Flags);

	// Quick check
	ERROR2IF(((Verbs[*Index] & ~PT_CLOSEFIGURE) != PT_BEZIERTO), FALSE, "Unknown segment encountered");
	ERROR2IF(((PrevIndex+3) != *Index), FALSE, "Not two points between segment start and end");

//	BOOL ok = TRUE;

	DocCoord EndCoord = Coords[*Index];
	PathFlags EndFlags = Flags[*Index];
	PathVerb NewEndVerb = Verbs[*Index];
	NewEndVerb = (NewEndVerb == PT_BEZIERTO) ? PT_LINETO : PT_LINETO | PT_CLOSEFIGURE;

	BOOL DoneOK = TRUE;

	// Insert a line segment
	if (DoneOK)
		DoneOK = DoInsertPathElement(pPath, PrevIndex, EndCoord, EndFlags, NewEndVerb, FALSE);

	// Remove the curve segment
	if (DoneOK)
		DoneOK = DoDeletePathSection(pPath, PrevIndex+2, 3, FALSE);

	*Index = PrevIndex+1;

	return DoneOK;
}
开发者ID:UIKit0,项目名称:xara-xtreme,代码行数:47,代码来源:pathops.cpp

示例8: ERROR2IF

BOOL CXaraFileNodeBitmap::WritePreChildrenNative(BaseCamelotFilter *pFilter, NodeBitmap *pNodeBitmap)
{
	ERROR2IF(pFilter==NULL, FALSE, "parameter pFilter==NULL");
	ERROR2IF(pNodeBitmap==NULL, FALSE, "parameter pNodeBitmap==NULL");

	return WriteNodeBitmap(pFilter, pNodeBitmap);
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:7,代码来源:cxfnbmp.cpp

示例9: Neville_Humphrys

/********************************************************************************************

>	BOOL PNGFilter::ReadFromFile(OILBitmap* pOilBitmap)

	Author:		Neville_Humphrys (Xara Group Ltd) <[email protected]>
	Created:	26/4/96
	Inputs:		pOilBitmap	pointer to the oil bitmap data to be filled in
	Outputs:	Will have filled in BMInfo	pointer to the bitmap header to fill in
									BMBytes	pointer to the bitmap data to fill in
	Purpose:	Actually does the process of reading a bitmap from a file.
				Inherited classes override this to read in different file formats.
				
	Returns:	TRUE if worked, FALSE if failed.

********************************************************************************************/
BOOL PNGFilter::ReadFromFile(OILBitmap* pOilBitmap)
{
	ERROR2IF(pOilBitmap == NULL,FALSE,"PNGFilter::ReadFromFile null OilBitmap pointer");
	
	// Try to import the bitmap as a PNG file.		
	CCLexFile *pImportFile = GetImportFile();
	ERROR2IF(pImportFile==NULL,FALSE,"PNGFilter::ReadFromFile - No import file");

	UINT32 ImportMsgId = GetImportMsgID();		
	String_64 ProgressString(ImportMsgId);
	ProgressString = GetImportProgressString(pImportFile, ImportMsgId);

	CWxBitmap* pWBitmap = (CWxBitmap*)pOilBitmap;
	
	LPBITMAPINFO *pInfo = &(pWBitmap->BMInfo);
	LPBYTE *pBytes = &(pWBitmap->BMBytes);
	
	INT32 TransColour = -1;

	// The PNG filter liked it very much and so use it, showing progress bar
	if (!PNGUtil::ReadFromFile(pImportFile, pInfo, pBytes, &TransColour, &ProgressString))
		return FALSE;

	SetTransColour(TransColour);
	UINT32 Bpp = pWBitmap->GetBPP();
	if (TransColour != -1 && Bpp <= 8)
		pOilBitmap->SetTransparencyIndex(TransColour);

	SetLastBitmap();		// can only import one bitmap at the moment
	
	return TRUE;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:47,代码来源:pngfiltr.cpp

示例10: ERROR2IF

BOOL MouldTransform::TransformPath(Path* const pSource, Path* pDestin)
{
	ERROR2IF(pSource==NULL,FALSE,"MouldTransform::TransformPath() called with a null source path");
	ERROR2IF(pDestin==NULL,FALSE,"MouldTransform::TransformPath() called with a null source path");

	return pMouldGeom->MouldPathToPath(pSource,pDestin);
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:7,代码来源:moldshap.cpp

示例11: TRACEUSER

BOOL EditTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("HandleEditMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"EditTab::Message null message received");
	ERROR2IF(pPrefsDlg == NULL,FALSE,"EditTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_EDIT));	// The edit page identifier
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_SELECTION_CHANGED:
		case DIM_LFT_BN_CLICKED:
		case DIM_TEXT_CHANGED:
			OptionsTabs::SetApplyNowState(TRUE);
			break;
		default:
			break;
	}
	return TRUE;
}  
开发者ID:vata,项目名称:xarino,代码行数:28,代码来源:optsedit.cpp

示例12: ERROR2IF

BOOL UnitListComponent::ExportUserUnits(BaseCamelotFilter *pFilter)
{
#ifdef DO_EXPORT
	ERROR2IF(pFilter == NULL,FALSE,"UnitListComponent::ExportUserUnits null pFilter");
	ERROR2IF(pDocUnitList == NULL,FALSE,"UnitListComponent::ExportUserUnits called with no doc unit list pointer");

	// Export any user defined units
	Unit* pUnit = NULL;
	BOOL ok = TRUE;
	INT32 RecNum = 0;

	pUnit = pDocUnitList->FindFirstUserUnit();
	while (pUnit != NULL)
	{
		RecNum = ExportUnitDefinition(pFilter, pUnit);
		if (RecNum == 0)
			break;

		pUnit = pDocUnitList->FindNextUserUnit(pUnit);
	}

	return ok;
#else
	return TRUE;
#endif
}
开发者ID:UIKit0,项目名称:xara-xtreme,代码行数:26,代码来源:unitcomp.cpp

示例13: ERROR2IF

BOOL OILPanose::Init(CDC *ptr)
{
	ERROR2IF(ptr==NULL, FALSE, "Parameter ptr == NULL");
	ERROR2IF(IsInitialised==TRUE, FALSE, "OILPanose::Init called when IsInitialised==TRUE.");

	pMyCDC = ptr;
	IsInitialised=TRUE;

	return TRUE;
}
开发者ID:UIKit0,项目名称:xara-xtreme,代码行数:10,代码来源:oilpanse.cpp

示例14: ERROR2IF

BOOL NativePrefsDlg::InitDialog ()
{
	ERROR2IF ( mpParams == NULL, FALSE,
			   "NativePrefsDlg::InitDialog called after duff initialisation?!" );

	//First, do we have a selection?
	Application *pApp = GetApplication();

	ERROR2IF(pApp == NULL, FALSE,"NativePrefsDlg::InitDialog -  no application!");
	
	SelRange *pRange = pApp->FindSelection();
	
	ERROR2IF(pRange == NULL, FALSE,"NativePrefsDlg::InitDialog - no selection range!");
	DocRect ClipRect = pRange->GetBoundingRect();

	BOOL fThereIsASelection=!ClipRect.IsEmpty();

	//Now, is there a selection?
	if (fThereIsASelection)
	{
		// Yes. So ungrey both the buttons for selecting the nodes to export.
		EnableGadget(_R(IDC_NATIVEOPTS_SELECT), TRUE);
		EnableGadget(_R(IDC_NATIVEOPTS_DRAWING), TRUE);

		//Now, which of those buttons should be selected?
		switch ( mpParams->GetExportSel () )
		{
		case SELECTION:
			// Choose the export pair of buttons.
			SetLongGadgetValue(_R(IDC_NATIVEOPTS_SELECT), FALSE);
			SetLongGadgetValue(_R(IDC_NATIVEOPTS_DRAWING), TRUE);
			break;

		default:
		case DRAWING:
			// Choose the export pair of buttons.
			SetLongGadgetValue(_R(IDC_NATIVEOPTS_SELECT), TRUE);
			SetLongGadgetValue(_R(IDC_NATIVEOPTS_DRAWING), FALSE);
			break;
		}
	}
	else
	{
		//No. So grey the SELECTION button and ungrey
		//the DRAWING button
		EnableGadget(_R(IDC_NATIVEOPTS_SELECT), FALSE);
		EnableGadget(_R(IDC_NATIVEOPTS_DRAWING), TRUE);

		// And we must select the DRAWING button for the export area controls.
		SetLongGadgetValue(_R(IDC_NATIVEOPTS_SELECT), TRUE);
		SetLongGadgetValue(_R(IDC_NATIVEOPTS_DRAWING), FALSE);
	}

	return TRUE;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:55,代码来源:xarprefs.cpp

示例15: ERROR2IF

// FIXED16 version
BOOL PrintComponent::OutputValue(UINT32 Token,FIXED16 Value)
{
	ERROR2IF(pExportDC == NULL,FALSE,"NULL export DC in PrintComponent::OutputValue()");
	ERROR2IF(Token >= PCTOKEN_UNKNOWN,FALSE,"Token out of range");

	BOOL ok = TRUE;

	if (ok) ok = pExportDC->OutputToken(PCTokenStr[Token]);
	if (ok) ok = pExportDC->OutputReal(Value.MakeDouble());
	if (ok) ok = pExportDC->OutputNewLine();
	return ok;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:13,代码来源:princomp.cpp


注:本文中的ERROR2IF函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。