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

@ -2202,7 +2202,8 @@ public class Sheet implements Model
*/
public double getMargin(short margin) {
Margin m;
switch (margin) {
switch ( margin )
{
case LeftMargin:
m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
if ( m == null )
@ -2223,7 +2224,8 @@ public class Sheet implements Model
if ( m == null )
return 1.0;
break;
default : throw new RuntimeException("Unknown margin constant: " + margin);
default :
throw new RuntimeException( "Unknown margin constant: " + margin );
}
return m.getMargin();
}
@ -2235,36 +2237,42 @@ public class Sheet implements Model
*/
public void setMargin(short margin, double size) {
Margin m;
switch (margin) {
switch ( margin )
{
case LeftMargin:
m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
if (m == null) {
if ( m == null )
{
m = new LeftMarginRecord();
records.add( getDimsLoc() + 1, m );
}
break;
case RightMargin:
m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
if (m == null) {
if ( m == null )
{
m = new RightMarginRecord();
records.add( getDimsLoc() + 1, m );
}
break;
case TopMargin:
m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
if (m == null) {
if ( m == null )
{
m = new TopMarginRecord();
records.add( getDimsLoc() + 1, m );
}
break;
case BottomMargin:
m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
if (m == null) {
if ( m == null )
{
m = new BottomMarginRecord();
records.add( getDimsLoc() + 1, m );
}
break;
default : throw new RuntimeException("Unknown margin constant: " + margin);
default :
throw new RuntimeException( "Unknown margin constant: " + margin );
}
m.setMargin( size );
}