You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/09/24 14:32:26 UTC

svn commit: r1893596 - /poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java

Author: fanningpj
Date: Fri Sep 24 14:32:26 2021
New Revision: 1893596

URL: http://svn.apache.org/viewvc?rev=1893596&view=rev
Log:
try to remove goto

Modified:
    poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java

Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java?rev=1893596&r1=1893595&r2=1893596&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java Fri Sep 24 14:32:26 2021
@@ -40,8 +40,6 @@ public abstract class HeaderFooter imple
         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.
@@ -59,7 +57,7 @@ outer:
                 }
                 _left = text.substring(2, pos);
                 text = text.substring(pos);
-                break;
+                return new String[] { _left, _center, _right, };
             case 'C':
                 if (text.contains("&L")) {
                     pos = Math.min(pos, text.indexOf("&L"));
@@ -69,7 +67,7 @@ outer:
                 }
                 _center = text.substring(2, pos);
                 text = text.substring(pos);
-                break;
+                return new String[] { _left, _center, _right, };
             case 'R':
                 if (text.contains("&C")) {
                     pos = Math.min(pos, text.indexOf("&C"));
@@ -79,14 +77,14 @@ outer:
                 }
                 _right = text.substring(2, pos);
                 text = text.substring(pos);
-                break;
+                return new String[] { _left, _center, _right, };
             default:
                 // Mimics the behaviour of Excel, which would put it in the center.
                 _center = text;
-                break outer;
+                break;
             }
         }
-        return new String[] { _left, _center, _right, };
+        return null;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org