lgtm issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842302 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e7b1969f9
commit
4833c25d32
@ -348,11 +348,13 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
|
|||||||
|
|
||||||
// if there are borders on the west or east then
|
// if there are borders on the west or east then
|
||||||
// the second line shouldn't cross them
|
// the second line shouldn't cross them
|
||||||
if (westBorder)
|
if (westBorder) {
|
||||||
leftx = x + 3;
|
leftx = x + 3;
|
||||||
|
}
|
||||||
|
|
||||||
if (eastBorder)
|
if (eastBorder) {
|
||||||
rightx = width - 3;
|
rightx = width - 3;
|
||||||
|
}
|
||||||
|
|
||||||
g.drawLine(x,y,width,y);
|
g.drawLine(x,y,width,y);
|
||||||
g.drawLine(leftx,y+2,rightx,y+2);
|
g.drawLine(leftx,y+2,rightx,y+2);
|
||||||
@ -370,11 +372,13 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
|
|||||||
int topy=y;
|
int topy=y;
|
||||||
int bottomy=height;
|
int bottomy=height;
|
||||||
|
|
||||||
if (northBorder)
|
if (northBorder) {
|
||||||
topy = y + 3;
|
topy = y + 3;
|
||||||
|
}
|
||||||
|
|
||||||
if (southBorder)
|
if (southBorder) {
|
||||||
bottomy = height - 3;
|
bottomy = height - 3;
|
||||||
|
}
|
||||||
|
|
||||||
g.drawLine(width-1,y,width-1,height);
|
g.drawLine(width-1,y,width-1,height);
|
||||||
g.drawLine(width-3,topy,width-3,bottomy);
|
g.drawLine(width-3,topy,width-3,bottomy);
|
||||||
|
@ -336,7 +336,7 @@ public abstract class EscherRecord implements Cloneable {
|
|||||||
String tagName = capitalizeAndTrim((String)attrs[0]);
|
String tagName = capitalizeAndTrim((String)attrs[0]);
|
||||||
boolean hasValue = false;
|
boolean hasValue = false;
|
||||||
boolean lastChildComplex = false;
|
boolean lastChildComplex = false;
|
||||||
for (int i=0; i<attrs.length; i+=2) {
|
for (int i=0; i<attrs.length-1; i+=2) {
|
||||||
Object value = attrs[i+1];
|
Object value = attrs[i+1];
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
// ignore null values
|
// ignore null values
|
||||||
@ -384,7 +384,7 @@ public abstract class EscherRecord implements Cloneable {
|
|||||||
if (attrList != null && attrList.length > 0) {
|
if (attrList != null && attrList.length > 0) {
|
||||||
String childTab = " ";
|
String childTab = " ";
|
||||||
for (Object[] attrs : attrList) {
|
for (Object[] attrs : attrList) {
|
||||||
for (int i=0; i<attrs.length; i+=2) {
|
for (int i=0; i<attrs.length-1; i+=2) {
|
||||||
Object value = attrs[i+1];
|
Object value = attrs[i+1];
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
// ignore null values
|
// ignore null values
|
||||||
|
@ -21,15 +21,7 @@ import java.text.CollationKey;
|
|||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.apache.poi.ss.formula.eval.BlankEval;
|
import org.apache.poi.ss.formula.eval.BlankEval;
|
||||||
import org.apache.poi.ss.formula.eval.BoolEval;
|
import org.apache.poi.ss.formula.eval.BoolEval;
|
||||||
@ -900,9 +892,9 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ValueAndFormat o = (ValueAndFormat) obj;
|
ValueAndFormat o = (ValueAndFormat) obj;
|
||||||
return ( value == o.value || value.equals(o.value))
|
return (Objects.equals(value, o.value)
|
||||||
&& ( format == o.format || format.equals(o.format))
|
&& Objects.equals(format, o.format)
|
||||||
&& (string == o.string || string.equals(o.string));
|
&& Objects.equals(string, o.string));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -382,9 +382,6 @@ public final class FormulaParser {
|
|||||||
if (token instanceof OperandPtg) {
|
if (token instanceof OperandPtg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (token instanceof OperationPtg) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ public class TextSpecInfoRun {
|
|||||||
smartTagFld, smartTagsBytes, "smart tags"
|
smartTagFld, smartTagsBytes, "smart tags"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i=0; i<flds.length; i+=3) {
|
for (int i=0; i<flds.length-1; i+=3) {
|
||||||
BitField fld = (BitField)flds[i+0];
|
BitField fld = (BitField)flds[i+0];
|
||||||
Object valO = flds[i+1];
|
Object valO = flds[i+1];
|
||||||
if (!fld.isSet(mask)) continue;
|
if (!fld.isSet(mask)) continue;
|
||||||
@ -210,7 +210,8 @@ public class TextSpecInfoRun {
|
|||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
throw new IOException(flds[i+2]+" is activated, but its value is invalid");
|
Object fval = (i + 2) < flds.length ? flds[i + 2] : null;
|
||||||
|
throw new IOException(fval + " is activated, but its value is invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user