View | Details | Raw Unified | Return to bug 9085
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java (+36 lines)
Lines 83-88 Link Here
83
  protected HSSFFooter(FooterRecord footerRecord) {
83
  protected HSSFFooter(FooterRecord footerRecord) {
84
    this.footerRecord = footerRecord;
84
    this.footerRecord = footerRecord;
85
    String foot = footerRecord.getFooter();
85
    String foot = footerRecord.getFooter();
86
    while (foot != null && foot.length() > 1) {
87
	int pos = foot.length();
88
	switch (foot.substring(1, 2).charAt(0)) {
89
	case 'L' :
90
 	    if (foot.indexOf("&C") >= 0) {
91
		pos = Math.min(pos, foot.indexOf("&C"));
92
	    } 
93
	    if (foot.indexOf("&R") >= 0) {
94
		pos = Math.min(pos, foot.indexOf("&R"));
95
	    } 
96
	    left = foot.substring(2, pos);
97
	    foot = foot.substring(pos);
98
	    break;
99
	case 'C' : 
100
	    if (foot.indexOf("&L") >= 0) {
101
		pos = Math.min(pos, foot.indexOf("&L"));
102
	    } 
103
	    if (foot.indexOf("&R") >= 0) {
104
		pos = Math.min(pos, foot.indexOf("&R"));
105
	    } 
106
	    center = foot.substring(2, pos);
107
	    foot = foot.substring(pos);
108
	    break;
109
	case 'R' : 
110
 	    if (foot.indexOf("&C") >= 0) {
111
		pos = Math.min(pos, foot.indexOf("&C"));
112
	    } 
113
	    if (foot.indexOf("&L") >= 0) {
114
		pos = Math.min(pos, foot.indexOf("&L"));
115
	    } 
116
	    right = foot.substring(2, pos);
117
	    foot = foot.substring(pos);
118
	    break;
119
	default : foot = null;
120
	}
121
    }
86
  }
122
  }
87
123
88
  /**
124
  /**
(-)src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java (+36 lines)
Lines 82-87 Link Here
82
  protected HSSFHeader(HeaderRecord headerRecord) {
82
  protected HSSFHeader(HeaderRecord headerRecord) {
83
    this.headerRecord = headerRecord;
83
    this.headerRecord = headerRecord;
84
    String head = headerRecord.getHeader();
84
    String head = headerRecord.getHeader();
85
    while (head != null && head.length() > 1) {
86
	int pos = head.length();
87
	switch (head.substring(1, 2).charAt(0)) {
88
	case 'L' :
89
 	    if (head.indexOf("&C") >= 0) {
90
		pos = Math.min(pos, head.indexOf("&C"));
91
	    } 
92
	    if (head.indexOf("&R") >= 0) {
93
		pos = Math.min(pos, head.indexOf("&R"));
94
	    } 
95
	    left = head.substring(2, pos);
96
	    head = head.substring(pos);
97
	    break;
98
	case 'C' : 
99
	    if (head.indexOf("&L") >= 0) {
100
		pos = Math.min(pos, head.indexOf("&L"));
101
	    } 
102
	    if (head.indexOf("&R") >= 0) {
103
		pos = Math.min(pos, head.indexOf("&R"));
104
	    } 
105
	    center = head.substring(2, pos);
106
	    head = head.substring(pos);
107
	    break;
108
	case 'R' : 
109
 	    if (head.indexOf("&C") >= 0) {
110
		pos = Math.min(pos, head.indexOf("&C"));
111
	    } 
112
	    if (head.indexOf("&L") >= 0) {
113
		pos = Math.min(pos, head.indexOf("&L"));
114
	    } 
115
	    right = head.substring(2, pos);
116
	    head = head.substring(pos);
117
	    break;
118
	default : head = null;
119
	}
120
    }
85
  }
121
  }
86
122
87
  /**
123
  /**

Return to bug 9085