1 19 20 package jxl.read.biff; 21 22 import common.Logger; 23 24 import jxl.Cell; 25 import jxl.CellType; 26 import jxl.CellFeatures; 27 import jxl.format.CellFormat; 28 import jxl.biff.FormattingRecords; 29 30 34 class MulBlankCell implements Cell, CellFeaturesAccessor 35 { 36 39 private static Logger logger = Logger.getLogger(MulBlankCell.class); 40 41 44 private int row; 45 48 private int column; 49 52 private CellFormat cellFormat; 53 54 57 private int xfIndex; 58 59 62 private FormattingRecords formattingRecords; 63 64 68 private boolean initialized; 69 70 73 private SheetImpl sheet; 74 75 78 private CellFeatures features; 79 80 81 90 public MulBlankCell(int r, int c, 91 int xfi, 92 FormattingRecords fr, 93 SheetImpl si) 94 { 95 row = r; 96 column = c; 97 xfIndex = xfi; 98 formattingRecords = fr; 99 sheet = si; 100 initialized = false; 101 } 102 103 108 public final int getRow() 109 { 110 return row; 111 } 112 113 118 public final int getColumn() 119 { 120 return column; 121 } 122 123 128 public String getContents() 129 { 130 return ""; 131 } 132 133 138 public CellType getType() 139 { 140 return CellType.EMPTY; 141 } 142 143 148 public CellFormat getCellFormat() 149 { 150 if (!initialized) 151 { 152 cellFormat = formattingRecords.getXFRecord(xfIndex); 153 initialized = true; 154 } 155 156 return cellFormat; 157 } 158 159 164 public boolean isHidden() 165 { 166 ColumnInfoRecord cir = sheet.getColumnInfo(column); 167 168 if (cir != null && cir.getWidth() == 0) 169 { 170 return true; 171 } 172 173 RowRecord rr = sheet.getRowInfo(row); 174 175 if (rr != null && (rr.getRowHeight() == 0 || rr.isCollapsed())) 176 { 177 return true; 178 } 179 180 return false; 181 } 182 183 188 public CellFeatures getCellFeatures() 189 { 190 return features; 191 } 192 193 198 public void setCellFeatures(CellFeatures cf) 199 { 200 if (features != null) 201 { 202 logger.warn("current cell features not null - overwriting"); 203 } 204 205 features = cf; 206 } 207 } 208 | Popular Tags |