Some reformatting only.

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

View File

@ -2129,7 +2129,7 @@ public class Sheet implements Model
*/ */
public void setHeader (HeaderRecord newHeader) public void setHeader (HeaderRecord newHeader)
{ {
header = newHeader; header = newHeader;
} }
/** /**
@ -2138,7 +2138,7 @@ public class Sheet implements Model
*/ */
public FooterRecord getFooter () public FooterRecord getFooter ()
{ {
return footer; return footer;
} }
/** /**
@ -2147,7 +2147,7 @@ public class Sheet implements Model
*/ */
public void setFooter (FooterRecord newFooter) public void setFooter (FooterRecord newFooter)
{ {
footer = newFooter; footer = newFooter;
} }
/** /**
@ -2156,7 +2156,7 @@ public class Sheet implements Model
*/ */
public PrintSetupRecord getPrintSetup () public PrintSetupRecord getPrintSetup ()
{ {
return printSetup; return printSetup;
} }
/** /**
@ -2165,7 +2165,7 @@ public class Sheet implements Model
*/ */
public void setPrintSetup (PrintSetupRecord newPrintSetup) public void setPrintSetup (PrintSetupRecord newPrintSetup)
{ {
printSetup = newPrintSetup; printSetup = newPrintSetup;
} }
/** /**
@ -2174,7 +2174,7 @@ public class Sheet implements Model
*/ */
public PrintGridlinesRecord getPrintGridlines () public PrintGridlinesRecord getPrintGridlines ()
{ {
return printGridlines; return printGridlines;
} }
/** /**
@ -2183,7 +2183,7 @@ public class Sheet implements Model
*/ */
public void setPrintGridlines (PrintGridlinesRecord newPrintGridlines) public void setPrintGridlines (PrintGridlinesRecord newPrintGridlines)
{ {
printGridlines = newPrintGridlines; printGridlines = newPrintGridlines;
} }
/** /**
@ -2191,8 +2191,8 @@ public class Sheet implements Model
* @param sel True to select the sheet, false otherwise. * @param sel True to select the sheet, false otherwise.
*/ */
public void setSelected(boolean sel) { public void setSelected(boolean sel) {
WindowTwoRecord windowTwo = (WindowTwoRecord) findFirstRecordBySid(WindowTwoRecord.sid); WindowTwoRecord windowTwo = (WindowTwoRecord) findFirstRecordBySid(WindowTwoRecord.sid);
windowTwo.setSelected(sel); windowTwo.setSelected(sel);
} }
/** /**
@ -2201,31 +2201,33 @@ public class Sheet implements Model
* @return the size of the margin * @return the size of the margin
*/ */
public double getMargin(short margin) { public double getMargin(short margin) {
Margin m; Margin m;
switch (margin) { switch ( margin )
case LeftMargin : {
m = (Margin)findFirstRecordBySid(LeftMarginRecord.sid); case LeftMargin:
if (m == null) m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
return .75; if ( m == null )
break; return .75;
case RightMargin : break;
m = (Margin)findFirstRecordBySid(RightMarginRecord.sid); case RightMargin:
if (m == null) m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
return .75; if ( m == null )
break; return .75;
case TopMargin : break;
m = (Margin)findFirstRecordBySid(TopMarginRecord.sid); case TopMargin:
if (m == null) m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
return 1.0; if ( m == null )
break; return 1.0;
case BottomMargin : break;
m = (Margin)findFirstRecordBySid(BottomMarginRecord.sid); case BottomMargin:
if (m == null) m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
return 1.0; if ( m == null )
break; return 1.0;
default : throw new RuntimeException("Unknown margin constant: " + margin); break;
} default :
return m.getMargin(); throw new RuntimeException( "Unknown margin constant: " + margin );
}
return m.getMargin();
} }
/** /**
@ -2234,39 +2236,45 @@ public class Sheet implements Model
* @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) {
Margin m; Margin m;
switch (margin) { switch ( margin )
case LeftMargin : {
m = (Margin)findFirstRecordBySid(LeftMarginRecord.sid); case LeftMargin:
if (m == null) { m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
m = new LeftMarginRecord(); if ( m == null )
records.add(getDimsLoc() + 1, m); {
} m = new LeftMarginRecord();
break; records.add( getDimsLoc() + 1, m );
case RightMargin : }
m = (Margin)findFirstRecordBySid(RightMarginRecord.sid); break;
if (m == null) { case RightMargin:
m = new RightMarginRecord(); m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
records.add(getDimsLoc() + 1, m); if ( m == null )
} {
break; m = new RightMarginRecord();
case TopMargin : records.add( getDimsLoc() + 1, m );
m = (Margin)findFirstRecordBySid(TopMarginRecord.sid); }
if (m == null) { break;
m = new TopMarginRecord(); case TopMargin:
records.add(getDimsLoc() + 1, m); m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
} if ( m == null )
break; {
case BottomMargin : m = new TopMarginRecord();
m = (Margin)findFirstRecordBySid(BottomMarginRecord.sid); records.add( getDimsLoc() + 1, m );
if (m == null) { }
m = new BottomMarginRecord(); break;
records.add(getDimsLoc() + 1, m); case BottomMargin:
} m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
break; if ( m == null )
default : throw new RuntimeException("Unknown margin constant: " + margin); {
} m = new BottomMarginRecord();
m.setMargin(size); records.add( getDimsLoc() + 1, m );
}
break;
default :
throw new RuntimeException( "Unknown margin constant: " + margin );
}
m.setMargin( size );
} }
public int getEofLoc() public int getEofLoc()