diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-07-16 20:21:22 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-07-16 20:21:22 +0000 |
commit | 773ad5e8251a43b822793cb265a04a80793be4c7 (patch) | |
tree | 4b8f2a17a0784c1b57949c5e79481b8d406e01dd /poi-ooxml | |
parent | 46b14041bf1fd3eaf298bac69bf1927b65459d1e (diff) | |
download | poi-773ad5e8251a43b822793cb265a04a80793be4c7.tar.gz poi-773ad5e8251a43b822793cb265a04a80793be4c7.zip |
[github-356] accept some of the changes in this PR (not all)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902784 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java | 4 | ||||
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java index 368f813b47..b446473f9d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java @@ -110,7 +110,7 @@ public class XWPFHeaderFooterPolicy { CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i); POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId()); XWPFHeader hdr = null; - if (relatedPart != null && relatedPart instanceof XWPFHeader) { + if (relatedPart instanceof XWPFHeader) { hdr = (XWPFHeader) relatedPart; } // Assign it; treat invalid options as "default" POI-60293 @@ -128,7 +128,7 @@ public class XWPFHeaderFooterPolicy { CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i); POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId()); XWPFFooter ftr = null; - if (relatedPart != null && relatedPart instanceof XWPFFooter) { + if (relatedPart instanceof XWPFFooter) { ftr = (XWPFFooter) relatedPart; } // Assign it; treat invalid options as "default" POI-60293 diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java index f9b2773de9..131c7d3d52 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java @@ -290,7 +290,7 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo */ public XWPFPictureData getPictureDataByID(String blipID) { POIXMLDocumentPart relatedPart = getRelationById(blipID); - if (relatedPart != null && relatedPart instanceof XWPFPictureData) { + if (relatedPart instanceof XWPFPictureData) { return (XWPFPictureData) relatedPart; } return null; |