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:
parent
841ecac5b7
commit
2eb1a142ca
@ -2202,28 +2202,30 @@ public class Sheet implements Model
|
||||
*/
|
||||
public double getMargin(short margin) {
|
||||
Margin m;
|
||||
switch (margin) {
|
||||
case LeftMargin :
|
||||
m = (Margin)findFirstRecordBySid(LeftMarginRecord.sid);
|
||||
if (m == null)
|
||||
switch ( margin )
|
||||
{
|
||||
case LeftMargin:
|
||||
m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
|
||||
if ( m == null )
|
||||
return .75;
|
||||
break;
|
||||
case RightMargin :
|
||||
m = (Margin)findFirstRecordBySid(RightMarginRecord.sid);
|
||||
if (m == null)
|
||||
case RightMargin:
|
||||
m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
|
||||
if ( m == null )
|
||||
return .75;
|
||||
break;
|
||||
case TopMargin :
|
||||
m = (Margin)findFirstRecordBySid(TopMarginRecord.sid);
|
||||
if (m == null)
|
||||
case TopMargin:
|
||||
m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
|
||||
if ( m == null )
|
||||
return 1.0;
|
||||
break;
|
||||
case BottomMargin :
|
||||
m = (Margin)findFirstRecordBySid(BottomMarginRecord.sid);
|
||||
if (m == null)
|
||||
case BottomMargin:
|
||||
m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
|
||||
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,38 +2237,44 @@ public class Sheet implements Model
|
||||
*/
|
||||
public void setMargin(short margin, double size) {
|
||||
Margin m;
|
||||
switch (margin) {
|
||||
case LeftMargin :
|
||||
m = (Margin)findFirstRecordBySid(LeftMarginRecord.sid);
|
||||
if (m == null) {
|
||||
switch ( margin )
|
||||
{
|
||||
case LeftMargin:
|
||||
m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
|
||||
if ( m == null )
|
||||
{
|
||||
m = new LeftMarginRecord();
|
||||
records.add(getDimsLoc() + 1, m);
|
||||
records.add( getDimsLoc() + 1, m );
|
||||
}
|
||||
break;
|
||||
case RightMargin :
|
||||
m = (Margin)findFirstRecordBySid(RightMarginRecord.sid);
|
||||
if (m == null) {
|
||||
case RightMargin:
|
||||
m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
|
||||
if ( m == null )
|
||||
{
|
||||
m = new RightMarginRecord();
|
||||
records.add(getDimsLoc() + 1, m);
|
||||
records.add( getDimsLoc() + 1, m );
|
||||
}
|
||||
break;
|
||||
case TopMargin :
|
||||
m = (Margin)findFirstRecordBySid(TopMarginRecord.sid);
|
||||
if (m == null) {
|
||||
case TopMargin:
|
||||
m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
|
||||
if ( m == null )
|
||||
{
|
||||
m = new TopMarginRecord();
|
||||
records.add(getDimsLoc() + 1, m);
|
||||
records.add( getDimsLoc() + 1, m );
|
||||
}
|
||||
break;
|
||||
case BottomMargin :
|
||||
m = (Margin)findFirstRecordBySid(BottomMarginRecord.sid);
|
||||
if (m == null) {
|
||||
case BottomMargin:
|
||||
m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
|
||||
if ( m == null )
|
||||
{
|
||||
m = new BottomMarginRecord();
|
||||
records.add(getDimsLoc() + 1, m);
|
||||
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);
|
||||
m.setMargin( size );
|
||||
}
|
||||
|
||||
public int getEofLoc()
|
||||
|
Loading…
Reference in New Issue
Block a user