Author: kiwiwings
Date: Tue May 22 22:39:22 2018
New Revision: 1832067
URL: http://svn.apache.org/viewvc?rev=1832067&view=rev
Log:
sonar fixes
Modified:
poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java
Modified:
poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java?rev=1832067&r1=1832066&r2=1832067&view=diff
==============================================================================
---
poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
(original)
+++
poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
Tue May 22 22:39:22 2018
@@ -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
Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java?rev=1832067&r1=1832066&r2=1832067&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java Tue May 22
22:39:22 2018
@@ -56,7 +56,7 @@ public class DrawShape implements Drawab
*/
@Override
public void applyTransform(Graphics2D graphics) {
- if (!(shape instanceof PlaceableShape)) {
+ if (!(shape instanceof PlaceableShape) || graphics == null) {
return;
}
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java?rev=1832067&r1=1832066&r2=1832067&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java Tue May 22
22:39:22 2018
@@ -1711,10 +1711,11 @@ public final class FormulaParser {
private int parseErrorLiteral() {
Match('#');
- String part1 = parseUnquotedIdentifier().toUpperCase(Locale.ROOT);
+ String part1 = parseUnquotedIdentifier();
if (part1 == null) {
throw expected("remainder of error constant literal");
}
+ part1 = part1.toUpperCase(Locale.ROOT);
switch(part1.charAt(0)) {
case 'V': {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]