poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1614930 - /poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
Date Thu, 31 Jul 2014 16:11:35 GMT
Author: nick
Date: Thu Jul 31 16:11:35 2014
New Revision: 1614930

URL: http://svn.apache.org/r1614930
Log:
Fix bug #55196 - Correct XWPF createTOC handling of short style names

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java?rev=1614930&r1=1614929&r2=1614930&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java Thu Jul 31 16:11:35
2014
@@ -892,7 +892,7 @@ public class XWPFDocument extends POIXML
         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");



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


Mime
View raw message