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