Lines 81-86
Link Here
|
81 |
* @author Glen Stampoultzis (glens at apache.org) |
81 |
* @author Glen Stampoultzis (glens at apache.org) |
82 |
* @author Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, and PrintSetup |
82 |
* @author Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, and PrintSetup |
83 |
* @author Jason Height (jheight at chariot dot net dot au) Clone support |
83 |
* @author Jason Height (jheight at chariot dot net dot au) Clone support |
|
|
84 |
* @author Brian Sanders (kestrel at burdell dot org) Active Cell support |
84 |
* |
85 |
* |
85 |
* @see org.apache.poi.hssf.model.Workbook |
86 |
* @see org.apache.poi.hssf.model.Workbook |
86 |
* @see org.apache.poi.hssf.usermodel.HSSFSheet |
87 |
* @see org.apache.poi.hssf.usermodel.HSSFSheet |
Lines 108-113
Link Here
|
108 |
protected FooterRecord footer = null; |
109 |
protected FooterRecord footer = null; |
109 |
protected PrintGridlinesRecord printGridlines = null; |
110 |
protected PrintGridlinesRecord printGridlines = null; |
110 |
protected MergeCellsRecord merged = null; |
111 |
protected MergeCellsRecord merged = null; |
|
|
112 |
protected SelectionRecord selection = null; |
111 |
protected int mergedloc = 0; |
113 |
protected int mergedloc = 0; |
112 |
private static POILogger log = POILogFactory.getLogger(Sheet.class); |
114 |
private static POILogger log = POILogFactory.getLogger(Sheet.class); |
113 |
private ArrayList columnSizes = null; // holds column info |
115 |
private ArrayList columnSizes = null; // holds column info |
Lines 252-257
Link Here
|
252 |
{ |
254 |
{ |
253 |
retval.printSetup = (PrintSetupRecord) rec; |
255 |
retval.printSetup = (PrintSetupRecord) rec; |
254 |
} |
256 |
} |
|
|
257 |
else if ( rec.getSid() == SelectionRecord.sid ) |
258 |
{ |
259 |
retval.selection = (SelectionRecord) rec; |
260 |
} |
255 |
|
261 |
|
256 |
if (rec != null) |
262 |
if (rec != null) |
257 |
{ |
263 |
{ |
Lines 376-382
Link Here
|
376 |
records.add(retval.dims); |
382 |
records.add(retval.dims); |
377 |
records.add(retval.createWindowTwo()); |
383 |
records.add(retval.createWindowTwo()); |
378 |
retval.setLoc(records.size() - 1); |
384 |
retval.setLoc(records.size() - 1); |
379 |
records.add(retval.createSelection()); |
385 |
retval.selection = |
|
|
386 |
(SelectionRecord) retval.createSelection(); |
387 |
records.add(retval.selection); |
380 |
records.add(retval.createEOF()); |
388 |
records.add(retval.createEOF()); |
381 |
retval.records = records; |
389 |
retval.records = records; |
382 |
log.log(log.DEBUG, "Sheet createsheet from scratch exit"); |
390 |
log.log(log.DEBUG, "Sheet createsheet from scratch exit"); |
Lines 1934-1939
Link Here
|
1934 |
retval.setActiveCellRow(( short ) 0x0); |
1942 |
retval.setActiveCellRow(( short ) 0x0); |
1935 |
retval.setNumRefs(( short ) 0x0); |
1943 |
retval.setNumRefs(( short ) 0x0); |
1936 |
return retval; |
1944 |
return retval; |
|
|
1945 |
} |
1946 |
|
1947 |
/** |
1948 |
* Returns the active row |
1949 |
* |
1950 |
* @see org.apache.poi.hssf.record.SelectionRecord |
1951 |
* @return row the active row index |
1952 |
*/ |
1953 |
public int getActiveCellRow() |
1954 |
{ |
1955 |
if (selection == null) |
1956 |
{ |
1957 |
return 0; |
1958 |
} |
1959 |
return selection.getActiveCellRow(); |
1960 |
} |
1961 |
|
1962 |
/** |
1963 |
* Sets the active row |
1964 |
* |
1965 |
* @param row the row index |
1966 |
* @see org.apache.poi.hssf.record.SelectionRecord |
1967 |
*/ |
1968 |
public void setActiveCellRow(int row) |
1969 |
{ |
1970 |
//shouldn't have a sheet w/o a SelectionRecord, but best to guard anyway |
1971 |
if (selection != null) |
1972 |
{ |
1973 |
selection.setActiveCellRow(row); |
1974 |
} |
1975 |
} |
1976 |
|
1977 |
/** |
1978 |
* Returns the active column |
1979 |
* |
1980 |
* @see org.apache.poi.hssf.record.SelectionRecord |
1981 |
* @return row the active column index |
1982 |
*/ |
1983 |
public short getActiveCellCol() |
1984 |
{ |
1985 |
if (selection == null) |
1986 |
{ |
1987 |
return (short) 0; |
1988 |
} |
1989 |
return selection.getActiveCellCol(); |
1990 |
} |
1991 |
|
1992 |
/** |
1993 |
* Sets the active column |
1994 |
* |
1995 |
* @param col the column index |
1996 |
* @see org.apache.poi.hssf.record.SelectionRecord |
1997 |
*/ |
1998 |
public void setActiveCellCol(short col) |
1999 |
{ |
2000 |
//shouldn't have a sheet w/o a SelectionRecord, but best to guard anyway |
2001 |
if (selection != null) |
2002 |
{ |
2003 |
selection.setActiveCellCol(col); |
2004 |
} |
1937 |
} |
2005 |
} |
1938 |
|
2006 |
|
1939 |
protected Record createMergedCells() |
2007 |
protected Record createMergedCells() |