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,7 +772,8 @@ 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 );
} }
@ -780,7 +781,8 @@ public class HSSFSheet
* 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() );
} }
@ -788,7 +790,8 @@ public class HSSFSheet
* 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() );
} }
@ -796,7 +799,8 @@ public class HSSFSheet
* 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() );
} }
@ -804,7 +808,8 @@ public class HSSFSheet
* 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,7 +818,8 @@ 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,7 +828,8 @@ 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,32 +842,40 @@ 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 row = getRow( rowNum );
HSSFRow row2Replace = getRow( rowNum + n ); HSSFRow row2Replace = getRow( rowNum + n );
if ( row2Replace == null ) if ( row2Replace == null )
row2Replace = createRow( rowNum + n ); 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 ); cell = row2Replace.getCell( col );
if ( cell != null ) if ( cell != null )
row2Replace.removeCell( cell ); 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 ); cell = row.getCell( col );
if (cell != null) { if ( cell != null )
{
row.removeCell( cell ); row.removeCell( cell );
CellValueRecordInterface cellRecord = cell.getCellValueRecord(); CellValueRecordInterface cellRecord = cell.getCellValueRecord();
cellRecord.setRow( rowNum + n ); cellRecord.setRow( rowNum + n );