1 19 20 package jxl.read.biff; 21 22 import jxl.Range; 23 import jxl.Sheet; 24 import jxl.biff.IntegerHelper; 25 import jxl.biff.RecordData; 26 import jxl.biff.SheetRangeImpl; 27 28 31 public class MergedCellsRecord extends RecordData 32 { 33 36 private Range[] ranges; 37 38 44 MergedCellsRecord(Record t, Sheet s) 45 { 46 super(t); 47 48 byte[] data = getRecord().getData(); 49 50 int numRanges = IntegerHelper.getInt(data[0], data[1]); 51 52 ranges = new Range[numRanges]; 53 54 int pos = 2; 55 int firstRow = 0; 56 int lastRow = 0; 57 int firstCol = 0; 58 int lastCol = 0; 59 60 for (int i = 0; i < numRanges; i++) 61 { 62 firstRow = IntegerHelper.getInt(data[pos], data[pos + 1]); 63 lastRow = IntegerHelper.getInt(data[pos + 2], data[pos + 3]); 64 firstCol = IntegerHelper.getInt(data[pos + 4], data[pos + 5]); 65 lastCol = IntegerHelper.getInt(data[pos + 6], data[pos + 7]); 66 67 ranges[i] = new SheetRangeImpl(s, firstCol, firstRow, 68 lastCol, lastRow); 69 70 pos += 8; 71 } 72 } 73 74 79 public Range[] getRanges() 80 { 81 return ranges; 82 } 83 } 84 85 86 87 88 89 90 91 | Popular Tags |