*
* The various attributes of a Cell are constrained, and are better defined in
* the XSD 1.1 visio schema
- *
+ *
* Values of a cell are often the result of a formula computation. Luckily for
* you, Visio seems to always write the result to the document file, so unless
* the values change we don't need to recompute the values.
public class XDGFCell {
public static Boolean maybeGetBoolean(Map<String, XDGFCell> cells,
- String name) {
+ String name) {
XDGFCell cell = cells.get(name);
- if (cell == null)
+ if (cell == null || cell.getValue() == null)
return null;
if (cell.getValue().equals("0"))
}
public static Integer maybeGetInteger(Map<String, XDGFCell> cells,
- String name) {
+ String name) {
XDGFCell cell = cells.get(name);
if (cell != null)
return parseIntegerValue(cell._cell);
XDGFCell cell = cells.get(name);
if (cell != null) {
String v = cell._cell.getV();
- if (v.equals("Themed"))
+ if (v == null || v.equals("Themed"))
return null;
return v;
}
}
public static Double parseDoubleValue(CellType cell) {
+ if (cell.getV() == null) {
+ return null;
+ }
try {
return Double.parseDouble(cell.getV());
} catch (NumberFormatException e) {
}
public static Integer parseIntegerValue(CellType cell) {
+ if (cell.getV() == null) {
+ return null;
+ }
try {
return Integer.parseInt(cell.getV());
} catch (NumberFormatException e) {
* @return A value converted to inches
*/
public static Double parseVLength(CellType cell) {
+ if (cell.getV() == null) {
+ return null;
+ }
try {
return Double.parseDouble(cell.getV());
} catch (NumberFormatException e) {