aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xwpf
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2014-07-31 16:11:35 +0000
committerNick Burch <nick@apache.org>2014-07-31 16:11:35 +0000
commit664e6b44f2625b434b3595dd466a9b53ede0fb5f (patch)
tree308c081eb578fb4c0376b7da2099d71502a76a72 /src/ooxml/java/org/apache/poi/xwpf
parent17de55241feb86342885cf7c94b0f32bdc4439e7 (diff)
downloadpoi-664e6b44f2625b434b3595dd466a9b53ede0fb5f.tar.gz
poi-664e6b44f2625b434b3595dd466a9b53ede0fb5f.zip
Fix bug #55196 - Correct XWPF createTOC handling of short style names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1614930 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf')
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
index be2348ee0e..568681dee4 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
@@ -892,7 +892,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
TOC toc = new TOC(block);
for (XWPFParagraph par : paragraphs) {
String parStyle = par.getStyle();
- if (parStyle != null && parStyle.substring(0, 7).equals("Heading")) {
+ if (parStyle != null && parStyle.startsWith("Heading")) {
try {
int level = Integer.valueOf(parStyle.substring("Heading".length())).intValue();
toc.addRow(level, par.getText(), 1, "112723803");