]> source.dussan.org Git - poi.git/commitdiff
Fix some warnings
authorDominik Stadler <centic@apache.org>
Sat, 16 Sep 2017 08:28:50 +0000 (08:28 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 16 Sep 2017 08:28:50 +0000 (08:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808519 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java

index c103a40678fb7006cf182388fb65897a116a2ce0..c55d936ae5b02999f74ba172e118d9e46c873c5f 100644 (file)
@@ -417,7 +417,7 @@ public class PropertyIDMap implements Map<Long,String> {
     /**
      * Creates a {@link PropertyIDMap} backed by another map.
      *
-     * @param map The instance to be created is backed by this map.
+     * @param idValues an array of key/value pairs via nested Object[2] arrays
      */
     private PropertyIDMap(Object[][] idValues) {
         Map<Long,String> m = new HashMap<>(idValues.length);
index 65d23f01c897df9bf79f84a947c05aa35514d33b..c561499d7804c182525799544054af8cffb4e6e4 100644 (file)
@@ -550,10 +550,7 @@ public class XSSFCellStyle implements CellStyle {
      */
     @Override
     public boolean getHidden() {
-        if (!_cellXf.isSetProtection() || !_cellXf.getProtection().isSetHidden()) {
-            return false;
-        }
-        return _cellXf.getProtection().getHidden();
+        return _cellXf.isSetProtection() && _cellXf.getProtection().isSetHidden() && _cellXf.getProtection().getHidden();
     }
 
     /**
@@ -622,10 +619,7 @@ public class XSSFCellStyle implements CellStyle {
      */
     @Override
     public boolean getLocked() {
-        if (!_cellXf.isSetProtection() || !_cellXf.getProtection().isSetLocked()) {
-            return true;
-        }
-        return _cellXf.getProtection().getLocked();
+        return !_cellXf.isSetProtection() || !_cellXf.getProtection().isSetLocked() || _cellXf.getProtection().getLocked();
     }
 
     /**