ValueCopier Class Reference

#include <value.h>

Inheritance diagram for ValueCopier:

ReferenceFixer CellShifter RelativeShifter CellDownShifter CellRightShifter List of all members.

Public Member Functions

virtual ~ValueCopier ()
Valuecopy (Value *value)

Protected Member Functions

virtual ReferencecopyRef (Reference *vv)=0
virtual ValuecopyText (TextValue *vv)
virtual ValuecopyExpr (Expression *expr)
virtual ValuecopyRange (Range *r)

Detailed Description

Definition at line 70 of file value.h.


Constructor & Destructor Documentation

virtual ValueCopier::~ValueCopier  )  [inline, virtual]
 

Definition at line 78 of file value.h.

00078 {};


Member Function Documentation

Value * ValueCopier::copy Value value  ) 
 

Definition at line 81 of file value.cpp.

References copyExpr(), copyRange(), copyRef(), and copyText().

Referenced by IisCell::colsInserted(), copyExpr(), IisCell::getFormuleTextForCell(), and IisCell::rowsInserted().

00082 {
00083   if (!what) return NULL;
00084   if (typeid(*what)==typeid(TextValue))
00085     return copyText((TextValue*)what);
00086   //  if (typeid(*what)==typeid(ImageValue))
00087   //    return what;
00088   //  if (typeid(*what)==typeid(Variable))
00089   //    return copyVar((Variable*)what);
00090   if (typeid(*what)==typeid(Reference))
00091     return copyRef((Reference*)what);
00092   if (typeid(*what)==typeid(Expression))
00093     return copyExpr((Expression*)what);
00094   if (typeid(*what)==typeid(Range))
00095     return copyRange((Range*)what);
00096   assert(0);
00097   return NULL;
00098 }

Value * ValueCopier::copyExpr Expression expr  )  [protected, virtual]
 

Definition at line 63 of file value.cpp.

References Expression::add(), Expression::argc(), Expression::argv(), copy(), and Expression::op().

Referenced by copy().

00064 {
00065   Expression * result = new Expression(expr->op());
00066   for(int i = 0 ; i < expr->argc(); i ++)
00067     result->add(copy(expr->argv(i)));
00068   return result;
00069 }

Value * ValueCopier::copyRange Range r  )  [protected, virtual]
 

Definition at line 71 of file value.cpp.

References copyRef(), Range::from, and Range::to.

Referenced by copy().

00072 {
00073   return new Range(copyRef(r->from),copyRef(r->to));
00074 }

virtual Reference* ValueCopier::copyRef Reference vv  )  [protected, pure virtual]
 

Implemented in CellDownShifter, CellRightShifter, RelativeShifter, and ReferenceFixer.

Referenced by copy(), and copyRange().

Value * ValueCopier::copyText TextValue vv  )  [protected, virtual]
 

Definition at line 76 of file value.cpp.

References TextValue::getText().

Referenced by copy().

00077 {
00078   return new TextValue(vv->getText());
00079 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 5 22:08:44 2006 for iis by  doxygen 1.4.6