コード例 #1
0
        public override Object Clone()
        {
            BRAIRecord rec = new BRAIRecord();

            rec.field_1_linkType             = field_1_linkType;
            rec.field_2_referenceType        = field_2_referenceType;
            rec.field_3_options              = field_3_options;
            rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
            rec.field_5_formulaOfLink        = field_5_formulaOfLink.Copy();
            return(rec);
        }
コード例 #2
0
 public AttachedLabelAggregate(RecordStream rs, ChartRecordAggregate container)
     : base(RuleName_ATTACHEDLABEL, container)
 {
     ChartSheetAggregate cs = GetContainer<ChartSheetAggregate>(ChartRecordAggregate.RuleName_CHARTSHEET);
     IsFirst = cs.AttachLabelCount == 0;
     cs.AttachLabelCount++;
     text = (TextRecord)rs.GetNext();
     rs.GetNext();//BeginRecord
     pos = (PosRecord)rs.GetNext();
     if (rs.PeekNextChartSid() == FontXRecord.sid)
     {
         fontX = (FontXRecord)rs.GetNext();
     }
     if (rs.PeekNextChartSid() == AlRunsRecord.sid)
     {
         alRuns = (AlRunsRecord)rs.GetNext();
     }
     brai = (BRAIRecord)rs.GetNext();
     if (rs.PeekNextChartSid() == SeriesTextRecord.sid)
     {
         seriesText = (SeriesTextRecord)rs.GetNext();
     }
     if (rs.PeekNextChartSid() == FrameRecord.sid)
     {
         frame = new FrameAggregate(rs, this);
     }
     if (rs.PeekNextChartSid() == ObjectLinkRecord.sid)
     {
         objectLink = (ObjectLinkRecord)rs.GetNext();
     }
     if (rs.PeekNextChartSid() == DataLabExtContentsRecord.sid)
     {
         dataLab = (DataLabExtContentsRecord)rs.GetNext();
     }
     if (rs.PeekNextChartSid() == CrtLayout12Record.sid)
     {
         crtLayout = (CrtLayout12Record)rs.GetNext();
     }
     if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
     {
         textProps = new TextPropsAggregate(rs, this);
     }
     if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
     {
         crtMlFrt = new CrtMlFrtAggregate(rs, this);
     }
     Record r = rs.GetNext();//EndRecord
     Debug.Assert(r.GetType() == typeof(EndRecord));
 }
コード例 #3
0
ファイル: HSSFChart.cs プロジェクト: 89sos98/npoi
 private BRAIRecord CreateTitleLinkedDataRecord()
 {
     BRAIRecord r = new BRAIRecord();
     r.LinkType = (BRAIRecord.LINK_TYPE_TITLE_OR_TEXT);
     r.ReferenceType = (BRAIRecord.REFERENCE_TYPE_DIRECT);
     r.IsCustomNumberFormat = (false);
     r.IndexNumberFmtRecord = ((short)0);
     r.FormulaOfLink = (null);
     return r;
 }
コード例 #4
0
ファイル: HSSFChart.cs プロジェクト: 89sos98/npoi
 private BRAIRecord CreateValuesLinkedDataRecord()
 {
     BRAIRecord r = new BRAIRecord();
     r.LinkType = (BRAIRecord.LINK_TYPE_VALUES);
     r.ReferenceType = (BRAIRecord.REFERENCE_TYPE_WORKSHEET);
     r.IsCustomNumberFormat = (false);
     r.IndexNumberFmtRecord = ((short)0);
     Area3DPtg p = new Area3DPtg(0, 31, 0, 0,
             false, false, false, false, 0);
     r.FormulaOfLink = (new Ptg[] { p, });
     return r;
 }
コード例 #5
0
ファイル: HSSFChart.cs プロジェクト: 89sos98/npoi
            private int SetVerticalCellRange(BRAIRecord linkedDataRecord,
                                                 CellRangeAddressBase range)
            {
                if (linkedDataRecord == null)
                {
                    throw new ArgumentNullException("linkedDataRecord should not be null"); ;
                }

                List<Ptg> ptgList = new List<Ptg>();

                int rowCount = (range.LastRow - range.FirstRow) + 1;
                int colCount = (range.LastColumn - range.FirstColumn) + 1;

                foreach (Ptg ptg in linkedDataRecord.FormulaOfLink)
                {
                    if (ptg is AreaPtgBase)
                    {
                        AreaPtgBase areaPtg = (AreaPtgBase)ptg;

                        areaPtg.FirstRow = range.FirstRow;
                        areaPtg.LastRow = range.LastRow;

                        areaPtg.FirstColumn = range.FirstColumn;
                        areaPtg.LastColumn = range.LastColumn;
                        ptgList.Add(areaPtg);
                    }
                }

                linkedDataRecord.FormulaOfLink = (ptgList.ToArray());

                return rowCount * colCount;
            }
コード例 #6
0
ファイル: HSSFChart.cs プロジェクト: 89sos98/npoi
            private CellRangeAddressBase GetCellRange(BRAIRecord linkedDataRecord)
            {
                if (linkedDataRecord == null)
                {
                    return null;
                }

                int firstRow = 0;
                int lastRow = 0;
                int firstCol = 0;
                int lastCol = 0;

                foreach (Ptg ptg in linkedDataRecord.FormulaOfLink)
                {
                    if (ptg is AreaPtgBase)
                    {
                        AreaPtgBase areaPtg = (AreaPtgBase)ptg;

                        firstRow = areaPtg.FirstRow;
                        lastRow = areaPtg.LastRow;

                        firstCol = areaPtg.FirstColumn;
                        lastCol = areaPtg.LastColumn;
                    }
                }

                return new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);
            }
コード例 #7
0
ファイル: HSSFChart.cs プロジェクト: 89sos98/npoi
 internal void InsertData(BRAIRecord data)
 {
     switch (data.LinkType)
     {
         case 0: dataName = data;
             break;
         case 1: dataValues = data;
             break;
         case 2: dataCategoryLabels = data;
             break;
         case 3: dataSecondaryCategoryLabels = data;
             break;
     }
 }
コード例 #8
0
ファイル: InternalChart.cs プロジェクト: WPG/npoi
 private static BRAIRecord CreateBRAIRecord()
 {
     BRAIRecord r = new BRAIRecord();
     r.LinkType = 0;
     r.ReferenceType = 1;
     r.IsCustomNumberFormat = (false);
     r.IndexNumberFmtRecord = ((short)0);
     r.FormulaOfLink = (null);
     return r;
 }
コード例 #9
0
ファイル: BRAIRecord.cs プロジェクト: 89sos98/npoi
        public override Object Clone()
        {
            BRAIRecord rec = new BRAIRecord();

            rec.field_1_linkType = field_1_linkType;
            rec.field_2_referenceType = field_2_referenceType;
            rec.field_3_options = field_3_options;
            rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
            rec.field_5_formulaOfLink = field_5_formulaOfLink.Copy();
            return rec;
        }
コード例 #10
0
ファイル: TestBRAIRecord.cs プロジェクト: 89sos98/npoi
        public void TestStore()
        {
            BRAIRecord record = new BRAIRecord();
            record.LinkType=(BRAIRecord.LINK_TYPE_VALUES);
            record.ReferenceType=(BRAIRecord.REFERENCE_TYPE_WORKSHEET);
            record.Options=((short)0);
            record.IsCustomNumberFormat=(false);
            record.IndexNumberFmtRecord=((short)0);
            Area3DPtg ptg = new Area3DPtg(0, 7936, 0, 0,
                false, false, false, false, 0);
            record.FormulaOfLink = (new Ptg[] { ptg, });

            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
        }
コード例 #11
0
ファイル: TestBRAIRecord.cs プロジェクト: 89sos98/npoi
        public void TestLoad()
        {

            BRAIRecord record = new BRAIRecord(TestcaseRecordInputStream.Create((short)0x1051, data));
            Assert.AreEqual(BRAIRecord.LINK_TYPE_VALUES, record.LinkType);
            Assert.AreEqual(BRAIRecord.REFERENCE_TYPE_WORKSHEET, record.ReferenceType);
            Assert.AreEqual(0, record.Options);
            Assert.AreEqual(false, record.IsCustomNumberFormat);
            Assert.AreEqual(0, record.IndexNumberFmtRecord);

            Area3DPtg ptgExpected = new Area3DPtg(0, 7936, 0, 0,false, false, false, false, 0);

            Object ptgActual = record.FormulaOfLink[0];
            Assert.AreEqual(ptgExpected.ToString(), ptgActual.ToString());

            Assert.AreEqual(data.Length + 4, record.RecordSize);

        }