]> source.dussan.org Git - poi.git/commitdiff
Bug 56864 - XWPFLatentStyles.isLatentStyle always returns true if there is at least...
authorAndreas Beeker <kiwiwings@apache.org>
Thu, 28 Aug 2014 00:20:22 +0000 (00:20 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Thu, 28 Aug 2014 00:20:22 +0000 (00:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1620999 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java
src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java

index 85bf7f6b6c31afcc947f754cc9ec71685df4ae13..83b898c1be295e4fab1388deb315f87dbf065ff6 100644 (file)
@@ -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;           
        }
index 5d13185cfcfbdf73ac2fb29a757287633837c35b..fc2c3a28e66ade4a4e054a26b1a60950b72903da 100644 (file)
@@ -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"));
     }
 }