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

(-)src/java/org/apache/poi/hssf/usermodel/HeaderFooter.java (-1 / +9 lines)
Lines 40-46 Link Here
40
		String _center = "";
40
		String _center = "";
41
		String _right = "";
41
		String _right = "";
42
42
43
outer:
43
		while (text.length() > 1) {
44
		while (text.length() > 1) {
45
			if (text.charAt(0) != '&') {
46
				// Mimics the behaviour of Excel, which would put it in the center.
47
				_center = text;
48
				break;
49
			}
44
			int pos = text.length();
50
			int pos = text.length();
45
			switch (text.charAt(1)) {
51
			switch (text.charAt(1)) {
46
			case 'L':
52
			case 'L':
Lines 74-80 Link Here
74
				text = text.substring(pos);
80
				text = text.substring(pos);
75
				break;
81
				break;
76
			default:
82
			default:
77
				throw new IllegalStateException("bad text '" + getRawText() + "'.");
83
				// Mimics the behaviour of Excel, which would put it in the center.
84
				_center = text;
85
				break outer;
78
			}
86
			}
79
		}
87
		}
80
		return new String[] { _left, _center, _right, };
88
		return new String[] { _left, _center, _right, };

Return to bug 48325