From: Andreas Beeker Date: Thu, 28 Aug 2014 00:20:22 +0000 (+0000) Subject: Bug 56864 - XWPFLatentStyles.isLatentStyle always returns true if there is at least... X-Git-Tag: REL_3_11_BETA3~90 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c20a2b97e8d175fa5efa5cc6c4c6ad5b17bfc8b2;p=poi.git Bug 56864 - XWPFLatentStyles.isLatentStyle always returns true if there is at least 1 lsdException git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1620999 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java index 85bf7f6b6c..83b898c1be 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java @@ -41,8 +41,9 @@ public class XWPFLatentStyles { @SuppressWarnings("deprecation") protected boolean isLatentStyle(String latentStyleID){ for ( CTLsdException lsd: latentStyles.getLsdExceptionArray()) { - if(lsd.getName().equals(latentStyleID)); + if(lsd.getName().equals(latentStyleID)) { return true; + } } return false; } diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java index 5d13185cfc..fc2c3a28e6 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java @@ -116,6 +116,6 @@ public class TestXWPFStyles extends TestCase { ex.setName("ex1"); XWPFLatentStyles ls = new XWPFLatentStyles(latentStyles); assertEquals(true, ls.isLatentStyle("ex1")); - + assertEquals(false, ls.isLatentStyle("notex1")); } }