aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2018-05-22 22:39:22 +0000
committerAndreas Beeker <kiwiwings@apache.org>2018-05-22 22:39:22 +0000
commit8c5c92761d32c040a933ba348161bad9e0e204db (patch)
tree37a2044fc9844f8426bbb778c21ca59900591aa7 /src/examples
parentd136eaa77889159fb88f9761aaeb469f45398735 (diff)
downloadpoi-8c5c92761d32c040a933ba348161bad9e0e204db.tar.gz
poi-8c5c92761d32c040a933ba348161bad9e0e204db.zip
sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
index b36c425f8c..f85fd0ab2a 100644
--- a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
+++ b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
@@ -365,12 +365,16 @@ public class AddDimensionedImage {
anchor.setDx1(0);
anchor.setDy1(0);
- anchor.setDx2(colClientAnchorDetail.getInset());
- anchor.setDy2(rowClientAnchorDetail.getInset());
- anchor.setCol1(colClientAnchorDetail.getFromIndex());
- anchor.setRow1(rowClientAnchorDetail.getFromIndex());
- anchor.setCol2(colClientAnchorDetail.getToIndex());
- anchor.setRow2(rowClientAnchorDetail.getToIndex());
+ if (colClientAnchorDetail != null) {
+ anchor.setDx2(colClientAnchorDetail.getInset());
+ anchor.setCol1(colClientAnchorDetail.getFromIndex());
+ anchor.setCol2(colClientAnchorDetail.getToIndex());
+ }
+ if (rowClientAnchorDetail != null) {
+ anchor.setDy2(rowClientAnchorDetail.getInset());
+ anchor.setRow1(rowClientAnchorDetail.getFromIndex());
+ anchor.setRow2(rowClientAnchorDetail.getToIndex());
+ }
// For now, set the anchor type to do not move or resize the
// image as the size of the row/column is adjusted. This could easily