コード例 #1
0
 public PtgInt(ushort val, PtgDataType dt = PtgDataType.REFERENCE) : base(PtgNumber.PtgInt, dt)
 {
     this.Data    = val.ToString();
     this.type    = PtgType.Operand;
     this.popSize = 1;
     this.Length  = 3;
 }
コード例 #2
0
ファイル: PtgFunc.cs プロジェクト: michaelweber/Macrome
 public PtgFunc(FtabValues fTab, PtgDataType dt = PtgDataType.REFERENCE, bool setHighBit = false) : base(PtgNumber.PtgFunc, dt, setHighBit)
 {
     this.Data    = "";
     this.Length  = 3;
     this.popSize = 1;
     this.tab     = Convert.ToUInt16(fTab);
     this.type    = PtgType.Operator;
 }
コード例 #3
0
ファイル: PtgNum.cs プロジェクト: wikijm/Macrome
        public PtgNum(double number, PtgDataType dt = PtgDataType.REFERENCE) : base(PtgNumber.PtgNum, dt)
        {
            this.Length  = 9;
            this.type    = PtgType.Operand;
            this.popSize = 1;

            this.Data = Convert.ToString(number, CultureInfo.GetCultureInfo("en-US"));
        }
コード例 #4
0
ファイル: PtgRef.cs プロジェクト: wikijm/Macrome
        public PtgRef(int rw, int col, bool rwRelative, bool colRelative, PtgDataType dt = PtgDataType.REFERENCE) : base(PtgNumber.PtgRef, dt)
        {
            this.type    = PtgType.Operand;
            this.popSize = 1;
            this.Length  = 5;

            this.rw          = (ushort)rw;
            this.col         = (ushort)col;
            this.colRelative = colRelative;
            this.rwRelative  = rwRelative;
        }
コード例 #5
0
        public PtgFuncVar(FtabValues ftab, int cparams, PtgDataType dt = PtgDataType.REFERENCE) : base(PtgNumber.PtgFuncVar, dt)
        {
            this.Length = 4;
            this.Data   = "";
            this.type   = PtgType.Operator;

            this.cparams  = (byte)cparams;
            this.tab      = (ushort)ftab;
            this.fCelFunc = false;
            this.popSize  = (uint)this.cparams;
        }
コード例 #6
0
        public PtgRef3d(int rw, int col, int ixti, bool rwRelative = false,
                        bool colRelative = false, PtgDataType dt = PtgDataType.REFERENCE) : base(PtgNumber.PtgRef3d,
                                                                                                 dt)
        {
            this.Length  = 7;
            this.type    = PtgType.Operand;
            this.popSize = 1;

            this.ixti = Convert.ToUInt16(ixti);
            this.rw   = Convert.ToUInt16(rw);
            this.col  = Convert.ToUInt16(col);

            this.rwRelative  = rwRelative;
            this.colRelative = colRelative;
        }
コード例 #7
0
ファイル: PtgStr.cs プロジェクト: wikijm/Macrome
        public PtgStr(string str, bool isUnicode = false, PtgDataType dt = PtgDataType.VALUE) : base(PtgNumber.PtgStr, dt)
        {
            this.type      = PtgType.Operand;
            this.popSize   = 1;
            this.Data      = ExcelHelperClass.EscapeFormulaString(str);
            this.isUnicode = isUnicode;

            if (isUnicode == false)
            {
                this.Length = (uint)(3 + str.Length);   // length = 1 byte Ptgtype + 1byte cch + 1byte highbyte
            }
            else
            {
                this.Length = (uint)(3 + str.Length * 2);
            }
        }
コード例 #8
0
ファイル: AbstractPtg.cs プロジェクト: usmcnomad/Macrome
        public AbstractPtg(PtgNumber ptgid, PtgDataType dt = PtgDataType.REFERENCE)
        {
            if ((int)ptgid > 0x5D)
            {
                this.dataType = PtgDataType.ARRAY;
                this._id      = ptgid - 0x40;
            }

            else if ((int)ptgid > 0x3D)
            {
                this.dataType = PtgDataType.VALUE;
                this._id      = ptgid - 0x20;
            }
            else
            {
                this.dataType = dt;
                this._id      = ptgid;
            }

            this.data = "";
        }
コード例 #9
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="reader">Streamreader</param>
        /// <param name="id">Ptg Id</param>
        /// <param name="length">The recordlength</param>
        public AbstractPtg(IStreamReader reader, PtgNumber ptgid)
        {
            this._reader = reader;
            this._offset = this._reader.BaseStream.Position;

            if ((int)ptgid > 0x5D)
            {
                this.dataType = PtgDataType.ARRAY;
                this._id      = ptgid - 0x40;
            }

            else if ((int)ptgid > 0x3D)
            {
                this.dataType = PtgDataType.VALUE;
                this._id      = ptgid - 0x20;
            }
            else
            {
                this.dataType = PtgDataType.REFERENCE;
                this._id      = ptgid;
            }

            this.data = "";
        }
コード例 #10
0
        public AbstractPtg(PtgNumber ptgid, PtgDataType dt = PtgDataType.REFERENCE, bool fPtgNumberHighBit = false)
        {
            if ((int)ptgid > 0x5D)
            {
                this.dataType = PtgDataType.ARRAY;
                this._id      = ptgid - 0x40;
            }

            else if ((int)ptgid > 0x3D)
            {
                this.dataType = PtgDataType.VALUE;
                this._id      = ptgid - 0x20;
            }
            else
            {
                this.dataType = dt;
                this._id      = ptgid;
            }

            //Looks like whenever this is true the formula is corrupted, probably worth ignoring
            this.fPtgNumberHighBit = fPtgNumberHighBit;

            this.data = "";
        }