aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-09-24 16:43:44 +0000
committerPJ Fanning <fanningpj@apache.org>2021-09-24 16:43:44 +0000
commit5fc9d20be752046e4540c8cf05ef2b8f653c0bf8 (patch)
treed0cc05e35f92506cd4f0df8e9b0953461ae417dc /poi/src
parentcabc8a425cb5b2528771fefbd9d4ace87f229a20 (diff)
downloadpoi-5fc9d20be752046e4540c8cf05ef2b8f653c0bf8.tar.gz
poi-5fc9d20be752046e4540c8cf05ef2b8f653c0bf8.zip
put back the goto - it is terrible but poi-integration tests hang without it
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893604 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/main/java/org/apache/poi/hssf/usermodel/HeaderFooter.java8
1 files changed, 6 insertions, 2 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 7c9792d9cc..9d369ad378 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,6 +40,10 @@ public abstract class HeaderFooter implements org.apache.poi.ss.usermodel.Header
String _center = "";
String _right = "";
+// FIXME: replace outer goto. just eww.
+// no unit tests test the goto loop but poi-integration tests hangs if you remove it
+// (some file has an edge case header or footer)
+ outer:
while (text.length() > 1) {
if (text.charAt(0) != '&') {
// Mimics the behaviour of Excel, which would put it in the center.
@@ -81,7 +85,7 @@ public abstract class HeaderFooter implements org.apache.poi.ss.usermodel.Header
default:
// Mimics the behaviour of Excel, which would put it in the center.
_center = text;
- break;
+ break outer;
}
}
return new String[] { _left, _center, _right, };
@@ -344,4 +348,4 @@ public abstract class HeaderFooter implements org.apache.poi.ss.usermodel.Header
return _occursInPairs;
}
}
-} \ No newline at end of file
+}