refs.cpp

Go to the documentation of this file.
00001 #include "refs.h"
00002 
00003 Reference::Reference(int C, int R, bool AC, bool AR)
00004 {
00005   column = C;
00006   row = R;
00007   absolute_col = AC;
00008   absolute_row = AR;
00009 }
00010 
00011 Reference::Reference(Token compound)
00012 {
00013   column = (Unsigned1)compound["column"];
00014   row = (Unsigned1)compound["row"];
00015   absolute_col = (Unsigned1)compound["absolute_col"];
00016   absolute_row = (Unsigned1)compound["absolute_row"];
00017 }
00018 
00019 Data Reference::getSaveDescription(QString) 
00020 {
00021   Token compound;
00022   compound["type"]=Symbol("reference");
00023   compound["column"]=Unsigned1(column);
00024   compound["row"]=Unsigned1(row);
00025   compound["absolute_col"]=Unsigned1(absolute_col);
00026   compound["absolute_row"]=Unsigned1(absolute_row);
00027   return compound;
00028 };
00029 
00030 QString Reference::toString()
00031 {
00032   QString text = "";
00033   if (absolute_col) text+="$";
00034   assert(column<26);
00035   char ch[2];
00036   ch[1]=0;
00037   ch[0]='A'+column;
00038   text+=QString(ch);
00039   if (absolute_row) text+="$";
00040   text+=QString::number(row);
00041   return text; 
00042 }
00043 
00044 bool Reference::equals_same_type(Value * other) 
00045 {
00046   return ((Reference*)other)->column == column &&
00047     ((Reference*)other)->row == row &&
00048     ((Reference*)other)->absolute_col == absolute_col &&
00049     ((Reference*)other)->absolute_row == absolute_row;
00050 };

Generated on Mon Jun 5 22:08:42 2006 for iis by  doxygen 1.4.6