put back the goto - it is terrible but I don't have time work out why it is needed

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893597 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java
index 44f1c6c..90b9556 100644
--- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java
+++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java
@@ -26,13 +26,13 @@
     protected HeaderFooter() {
         //
     }
-    
+
     /**
      * @return the internal text representation (combining center, left and right parts).
      * Possibly empty string if no header or footer is set.  Never <code>null</code>.
      */
-    protected abstract String getRawText(); 
-    
+    protected abstract String getRawText();
+
     private String[] splitParts() {
         String text = getRawText();
         // default values
@@ -40,6 +40,8 @@
         String _center = "";
         String _right = "";
 
+// FIXME: replace outer goto. just eww.
+        outer:
         while (text.length() > 1) {
             if (text.charAt(0) != '&') {
                 // Mimics the behaviour of Excel, which would put it in the center.
@@ -48,43 +50,43 @@
             }
             int pos = text.length();
             switch (text.charAt(1)) {
-            case 'L':
-                if (text.contains("&C")) {
-                    pos = Math.min(pos, text.indexOf("&C"));
-                }
-                if (text.contains("&R")) {
-                    pos = Math.min(pos, text.indexOf("&R"));
-                }
-                _left = text.substring(2, pos);
-                text = text.substring(pos);
-                return new String[] { _left, _center, _right, };
-            case 'C':
-                if (text.contains("&L")) {
-                    pos = Math.min(pos, text.indexOf("&L"));
-                }
-                if (text.contains("&R")) {
-                    pos = Math.min(pos, text.indexOf("&R"));
-                }
-                _center = text.substring(2, pos);
-                text = text.substring(pos);
-                return new String[] { _left, _center, _right, };
-            case 'R':
-                if (text.contains("&C")) {
-                    pos = Math.min(pos, text.indexOf("&C"));
-                }
-                if (text.contains("&L")) {
-                    pos = Math.min(pos, text.indexOf("&L"));
-                }
-                _right = text.substring(2, pos);
-                text = text.substring(pos);
-                return new String[] { _left, _center, _right, };
-            default:
-                // Mimics the behaviour of Excel, which would put it in the center.
-                _center = text;
-                break;
+                case 'L':
+                    if (text.contains("&C")) {
+                        pos = Math.min(pos, text.indexOf("&C"));
+                    }
+                    if (text.contains("&R")) {
+                        pos = Math.min(pos, text.indexOf("&R"));
+                    }
+                    _left = text.substring(2, pos);
+                    text = text.substring(pos);
+                    break;
+                case 'C':
+                    if (text.contains("&L")) {
+                        pos = Math.min(pos, text.indexOf("&L"));
+                    }
+                    if (text.contains("&R")) {
+                        pos = Math.min(pos, text.indexOf("&R"));
+                    }
+                    _center = text.substring(2, pos);
+                    text = text.substring(pos);
+                    break;
+                case 'R':
+                    if (text.contains("&C")) {
+                        pos = Math.min(pos, text.indexOf("&C"));
+                    }
+                    if (text.contains("&L")) {
+                        pos = Math.min(pos, text.indexOf("&L"));
+                    }
+                    _right = text.substring(2, pos);
+                    text = text.substring(pos);
+                    break;
+                default:
+                    // Mimics the behaviour of Excel, which would put it in the center.
+                    _center = text;
+                    break outer;
             }
         }
-        return null;
+        return new String[] { _left, _center, _right, };
     }
 
     /**
@@ -98,7 +100,7 @@
      * @param newLeft The string to set as the left side.
      */
     public final void setLeft(String newLeft) {
-        updatePart(0, newLeft); 
+        updatePart(0, newLeft);
     }
 
     /**
@@ -112,7 +114,7 @@
      * @param newCenter The string to set as the center.
      */
     public final void setCenter(String newCenter) {
-        updatePart(1, newCenter); 
+        updatePart(1, newCenter);
     }
 
     /**
@@ -126,9 +128,9 @@
      * @param newRight The string to set as the right side.
      */
     public final void setRight(String newRight) {
-        updatePart(2, newRight); 
+        updatePart(2, newRight);
     }
-    
+
     private void updatePart(int partIndex, String newValue) {
         String[] parts = splitParts();
         parts[partIndex] = newValue == null ? "" : newValue;
@@ -142,7 +144,7 @@
         String _left = parts[0];
         String _center = parts[1];
         String _right = parts[2];
-        
+
         if (_center.length() < 1 && _left.length() < 1 && _right.length() < 1) {
             setHeaderFooterText("");
             return;
@@ -320,7 +322,7 @@
         UNDERLINE_FIELD        ("&U", true),
         DOUBLE_UNDERLINE_FIELD ("&E", true),
         ;
-        
+
         private final String _representation;
         private final boolean _occursInPairs;
         private MarkupTag(String sequence, boolean occursInPairs) {
@@ -342,4 +344,4 @@
             return _occursInPairs;
         }
     }
-}
+}
\ No newline at end of file