patch 9085

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew C. Oliver 2002-05-17 03:25:13 +00:00
parent 7fca77c9c4
commit 45447a131b
2 changed files with 72 additions and 0 deletions

View File

@ -83,6 +83,42 @@ public class HSSFFooter extends Object {
protected HSSFFooter(FooterRecord footerRecord) {
this.footerRecord = footerRecord;
String foot = footerRecord.getFooter();
while (foot != null && foot.length() > 1) {
int pos = foot.length();
switch (foot.substring(1, 2).charAt(0)) {
case 'L' :
if (foot.indexOf("&C") >= 0) {
pos = Math.min(pos, foot.indexOf("&C"));
}
if (foot.indexOf("&R") >= 0) {
pos = Math.min(pos, foot.indexOf("&R"));
}
left = foot.substring(2, pos);
foot = foot.substring(pos);
break;
case 'C' :
if (foot.indexOf("&L") >= 0) {
pos = Math.min(pos, foot.indexOf("&L"));
}
if (foot.indexOf("&R") >= 0) {
pos = Math.min(pos, foot.indexOf("&R"));
}
center = foot.substring(2, pos);
foot = foot.substring(pos);
break;
case 'R' :
if (foot.indexOf("&C") >= 0) {
pos = Math.min(pos, foot.indexOf("&C"));
}
if (foot.indexOf("&L") >= 0) {
pos = Math.min(pos, foot.indexOf("&L"));
}
right = foot.substring(2, pos);
foot = foot.substring(pos);
break;
default : foot = null;
}
}
}
/**

View File

@ -82,6 +82,42 @@ public class HSSFHeader extends Object {
protected HSSFHeader(HeaderRecord headerRecord) {
this.headerRecord = headerRecord;
String head = headerRecord.getHeader();
while (head != null && head.length() > 1) {
int pos = head.length();
switch (head.substring(1, 2).charAt(0)) {
case 'L' :
if (head.indexOf("&C") >= 0) {
pos = Math.min(pos, head.indexOf("&C"));
}
if (head.indexOf("&R") >= 0) {
pos = Math.min(pos, head.indexOf("&R"));
}
left = head.substring(2, pos);
head = head.substring(pos);
break;
case 'C' :
if (head.indexOf("&L") >= 0) {
pos = Math.min(pos, head.indexOf("&L"));
}
if (head.indexOf("&R") >= 0) {
pos = Math.min(pos, head.indexOf("&R"));
}
center = head.substring(2, pos);
head = head.substring(pos);
break;
case 'R' :
if (head.indexOf("&C") >= 0) {
pos = Math.min(pos, head.indexOf("&C"));
}
if (head.indexOf("&L") >= 0) {
pos = Math.min(pos, head.indexOf("&L"));
}
right = head.substring(2, pos);
head = head.substring(pos);
break;
default : head = null;
}
}
}
/**