diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-09-24 14:32:26 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-09-24 14:32:26 +0000 |
commit | d457298316a4da0141ba4eebacc279fff152269d (patch) | |
tree | 710d7e48686f9474aafd657d6fdade391881685c /poi/src | |
parent | 3f6a7285fb9729d6e3d4449fc47d06a13ce635e7 (diff) | |
download | poi-d457298316a4da0141ba4eebacc279fff152269d.tar.gz poi-d457298316a4da0141ba4eebacc279fff152269d.zip |
try to remove goto
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893596 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r-- | poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java | 12 |
1 files changed, 5 insertions, 7 deletions
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 1119c6c211..44f1c6c68d 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 @@ -40,8 +40,6 @@ public abstract class HeaderFooter implements org.apache.poi.ss.usermodel.Header 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; } /** |