void CreateMultiLineFunc::execute() { ComValue& vect = stack_arg(0); if (!vect.is_type(ComValue::ArrayType) || vect.array_len()==0) { reset_stack(); push_stack(ComValue::nullval()); return; } const int len = vect.array_len(); const int npts = len/2; int x[npts]; int y[npts]; ALIterator i; AttributeValueList* avl = vect.array_val(); avl->First(i); for (int j=0; j<npts && !avl->Done(i); j++) { x[j] = avl->GetAttrVal(i)->int_val(); avl->Next(i); y[j] = avl->GetAttrVal(i)->int_val(); avl->Next(i); } AttributeList* al = stack_keys(); Resource::ref(al); reset_stack(); PasteCmd* cmd = nil; if (npts) { BrushVar* brVar = (BrushVar*) _ed->GetState("BrushVar"); PatternVar* patVar = (PatternVar*) _ed->GetState("PatternVar"); ColorVar* colVar = (ColorVar*) _ed->GetState("ColorVar"); Transformer* rel = get_transformer(al); ArrowVar* aVar = (ArrowVar*) _ed->GetState("ArrowVar"); ArrowMultiLine* multiline = new ArrowMultiLine(x, y, npts, aVar->Head(), aVar->Tail(), _ed->GetViewer()->GetMagnification(), stdgraphic); if (brVar != nil) multiline->SetBrush(brVar->GetBrush()); if (patVar != nil) multiline->SetPattern(patVar->GetPattern()); if (colVar != nil) { multiline->FillBg(!colVar->GetBgColor()->None()); multiline->SetColors(colVar->GetFgColor(), colVar->GetBgColor()); } multiline->SetTransformer(rel); Unref(rel); ArrowMultiLineOvComp* comp = new ArrowMultiLineOvComp(multiline); comp->SetAttributeList(al); if (PasteModeFunc::paste_mode()==0) cmd = new PasteCmd(_ed, new Clipboard(comp)); ComValue compval(new OverlayViewRef(comp), symbol_add("ArrowMultiLineComp")); push_stack(compval); execute_log(cmd); } else push_stack(ComValue::nullval()); Unref(al); }