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
This commit is contained in:
Andreas Beeker 2014-08-28 00:20:22 +00:00
parent a82d67a2dd
commit 3be80a5b03
2 changed files with 3 additions and 2 deletions

View 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;
}

View 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"));
}
}