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) {
|
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 );
|
||||||
|
if ( m == null )
|
||||||
return .75;
|
return .75;
|
||||||
break;
|
break;
|
||||||
case RightMargin :
|
case RightMargin:
|
||||||
m = (Margin)findFirstRecordBySid(RightMarginRecord.sid);
|
m = (Margin) findFirstRecordBySid( RightMarginRecord.sid );
|
||||||
if (m == null)
|
if ( m == null )
|
||||||
return .75;
|
return .75;
|
||||||
break;
|
break;
|
||||||
case TopMargin :
|
case TopMargin:
|
||||||
m = (Margin)findFirstRecordBySid(TopMarginRecord.sid);
|
m = (Margin) findFirstRecordBySid( TopMarginRecord.sid );
|
||||||
if (m == null)
|
if ( m == null )
|
||||||
return 1.0;
|
return 1.0;
|
||||||
break;
|
break;
|
||||||
case BottomMargin :
|
case BottomMargin:
|
||||||
m = (Margin)findFirstRecordBySid(BottomMarginRecord.sid);
|
m = (Margin) findFirstRecordBySid( BottomMarginRecord.sid );
|
||||||
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,38 +2237,44 @@ 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 :
|
{
|
||||||
m = (Margin)findFirstRecordBySid(LeftMarginRecord.sid);
|
case LeftMargin:
|
||||||
if (m == null) {
|
m = (Margin) findFirstRecordBySid( LeftMarginRecord.sid );
|
||||||
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getEofLoc()
|
public int getEofLoc()
|
||||||
|
Loading…
Reference in New Issue
Block a user