Some reformatting only.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Glen Stampoultzis 2002-12-26 22:55:26 +00:00
parent 2eb1a142ca
commit 6d73597035

View File

@ -772,40 +772,45 @@ public class HSSFSheet
* @param newPrintGridlines boolean to turn on or off the printing of * @param newPrintGridlines boolean to turn on or off the printing of
* gridlines * gridlines
*/ */
public void setPrintGridlines(boolean newPrintGridlines) { public void setPrintGridlines( boolean newPrintGridlines )
getSheet().getPrintGridlines().setPrintGridlines(newPrintGridlines); {
getSheet().getPrintGridlines().setPrintGridlines( newPrintGridlines );
} }
/** /**
* Gets the print setup object. * Gets the print setup object.
* @return The user model for the print setup object. * @return The user model for the print setup object.
*/ */
public HSSFPrintSetup getPrintSetup() { public HSSFPrintSetup getPrintSetup()
return new HSSFPrintSetup(getSheet().getPrintSetup()); {
return new HSSFPrintSetup( getSheet().getPrintSetup() );
} }
/** /**
* Gets the user model for the document header. * Gets the user model for the document header.
* @return The Document header. * @return The Document header.
*/ */
public HSSFHeader getHeader() { public HSSFHeader getHeader()
return new HSSFHeader(getSheet().getHeader()); {
return new HSSFHeader( getSheet().getHeader() );
} }
/** /**
* Gets the user model for the document footer. * Gets the user model for the document footer.
* @return The Document footer. * @return The Document footer.
*/ */
public HSSFFooter getFooter() { public HSSFFooter getFooter()
return new HSSFFooter(getSheet().getFooter()); {
return new HSSFFooter( getSheet().getFooter() );
} }
/** /**
* Sets whether sheet is selected. * Sets whether sheet is selected.
* @param sel Whether to select the sheet or deselect the sheet. * @param sel Whether to select the sheet or deselect the sheet.
*/ */
public void setSelected(boolean sel) { public void setSelected( boolean sel )
getSheet().setSelected(sel); {
getSheet().setSelected( sel );
} }
/** /**
@ -813,8 +818,9 @@ public class HSSFSheet
* @param margin which margin to get * @param margin which margin to get
* @return the size of the margin * @return the size of the margin
*/ */
public double getMargin(short margin) { public double getMargin( short margin )
return getSheet().getMargin(margin); {
return getSheet().getMargin( margin );
} }
/** /**
@ -822,8 +828,9 @@ public class HSSFSheet
* @param margin which margin to get * @param margin which margin to get
* @param size the size of the margin * @param size the size of the margin
*/ */
public void setMargin(short margin, double size) { public void setMargin( short margin, double size )
getSheet().setMargin(margin, size); {
getSheet().setMargin( margin, size );
} }
/** /**
@ -835,47 +842,55 @@ public class HSSFSheet
* @param endRow the row to end shifting * @param endRow the row to end shifting
* @param n the number of rows to shift * @param n the number of rows to shift
*/ */
public void shiftRows(int startRow, int endRow, int n) { public void shiftRows( int startRow, int endRow, int n )
{
int s, e, inc; int s, e, inc;
if (n < 0) { if ( n < 0 )
{
s = startRow; s = startRow;
e = endRow; e = endRow;
inc = 1; inc = 1;
} else { }
else
{
s = endRow; s = endRow;
e = startRow; e = startRow;
inc = -1; inc = -1;
} }
for (int rowNum = s; rowNum >= startRow && rowNum <= endRow && rowNum >= 0 && rowNum < 65536; rowNum+=inc) { for ( int rowNum = s; rowNum >= startRow && rowNum <= endRow && rowNum >= 0 && rowNum < 65536; rowNum += inc )
HSSFRow row = getRow(rowNum); {
HSSFRow row2Replace = getRow(rowNum + n); HSSFRow row = getRow( rowNum );
if (row2Replace == null) HSSFRow row2Replace = getRow( rowNum + n );
row2Replace = createRow(rowNum + n); if ( row2Replace == null )
row2Replace = createRow( rowNum + n );
HSSFCell cell; HSSFCell cell;
for (short col = row2Replace.getFirstCellNum(); col <= row2Replace.getLastCellNum(); col++) { for ( short col = row2Replace.getFirstCellNum(); col <= row2Replace.getLastCellNum(); col++ )
cell = row2Replace.getCell(col); {
if (cell != null) cell = row2Replace.getCell( col );
row2Replace.removeCell(cell); if ( cell != null )
row2Replace.removeCell( cell );
} }
for (short col = row.getFirstCellNum(); col <= row.getLastCellNum(); col++) { for ( short col = row.getFirstCellNum(); col <= row.getLastCellNum(); col++ )
cell = row.getCell(col); {
if (cell != null) { cell = row.getCell( col );
row.removeCell(cell); if ( cell != null )
{
row.removeCell( cell );
CellValueRecordInterface cellRecord = cell.getCellValueRecord(); CellValueRecordInterface cellRecord = cell.getCellValueRecord();
cellRecord.setRow(rowNum + n); cellRecord.setRow( rowNum + n );
row2Replace.createCellFromRecord(cellRecord); row2Replace.createCellFromRecord( cellRecord );
sheet.addValueRecord(rowNum + n, cellRecord); sheet.addValueRecord( rowNum + n, cellRecord );
} }
} }
} }
if (endRow == lastrow || endRow + n > lastrow) lastrow = Math.min(endRow + n, 65535); if ( endRow == lastrow || endRow + n > lastrow ) lastrow = Math.min( endRow + n, 65535 );
if (startRow == firstrow || startRow + n < firstrow) firstrow = Math.max(startRow + n, 0); if ( startRow == firstrow || startRow + n < firstrow ) firstrow = Math.max( startRow + n, 0 );
} }
protected void insertChartRecords( List records ) protected void insertChartRecords( List records )
{ {
int window2Loc = sheet.findFirstRecordLocBySid(WindowTwoRecord.sid); int window2Loc = sheet.findFirstRecordLocBySid( WindowTwoRecord.sid );
sheet.getRecords().addAll(window2Loc, records ); sheet.getRecords().addAll( window2Loc, records );
} }
} }