// Implements the following "truth" table for the aggregate and // running sequence function sum. // A B result // x y call eval to compute A=x+y // x N set y to nonnull and zero and call eval to compute A=x+0 // N y set x to nonnull and zero and call eval to compute A=0+y // N N set result to null. // ex_expr::exp_return_type ex_arith_sum_clause::processNulls(char *null_data[], CollHeap *heap, ComDiagsArea **diagsArea) { // If both x and y are NULL, the result is NULL. Make it so and do not // call eval. // if(!null_data[1] && !null_data[2]) { ExpTupleDesc::setNullValue(null_data[0], getOperand(0)->getNullBitIndex(), getOperand(0)->getTupleFormat() ); return ex_expr::EXPR_NULL; } // If only x is NULL, then the result is y. // if(!null_data[1]) { CopyAttributes(null_data[2*MAX_OPERANDS+0], null_data[0], null_data[MAX_OPERANDS+0], getOperand(0), null_data[2*MAX_OPERANDS+2], null_data[2], null_data[MAX_OPERANDS+2], getOperand(2)); return ex_expr::EXPR_NULL; } // If only y is NULL, then the result is x. // if(!null_data[2]) { CopyAttributes(null_data[2*MAX_OPERANDS+0], null_data[0], null_data[MAX_OPERANDS+0], getOperand(0), null_data[2*MAX_OPERANDS+1], null_data[1], null_data[MAX_OPERANDS+1], getOperand(1)); return ex_expr::EXPR_NULL; } // Otherwise, set the result to not null and call eval to compute x+y. // ExpTupleDesc::clearNullValue(null_data[0], getOperand(0)->getNullBitIndex(), getOperand(0)->getTupleFormat() ); return ex_expr::EXPR_OK; }
BOOL CEditPoly::CopyEditPoly( CEditPoly *pPoly, BOOL bCopyIndices, CStringHolder *pStringHolder ) { if( bCopyIndices ) m_Indices.CopyArray( pPoly->m_Indices ); CopyAttributes( pPoly, pStringHolder ); m_pBrush = pPoly->m_pBrush; return TRUE; }
/* ---------------------------------------------------------------------- TtaCopyAttributes Copy all attributes of the src element to the target element Parameters: src: the element which provides attributes. target: the element which receives attributes. ---------------------------------------------------------------------- */ void TtaCopyAttributes (Element src, Element target, Document doc_src, Document doc_target) { UserErrorCode = 0; if (src == NULL || target == NULL) TtaError (ERR_invalid_parameter); else { CopyAttributes ((PtrElement)src, (PtrElement)target, LoadedDocument[doc_src - 1], LoadedDocument[doc_target - 1], TRUE, FALSE); } }
Primitive* BezierCurve::Copy() const { Primitive* primitive = new BezierCurve(points); CopyAttributes(primitive); return primitive; }
Primitive* Polygon::Copy() const { Primitive* primitive = new Polygon(points); CopyAttributes(primitive); return primitive; }