Dépôt officiel du code source de l'ERP OpenConcerto
/trunk/OpenConcerto/src/org/openconcerto/openoffice/spreadsheet/MutableCell.java |
---|
182,6 → 182,8 |
} |
private void setValue(ODValueType type, Object value, String textP) { |
// as in LO, setting a cell value clears the formula |
this.setFormula(null); |
this.setValueAttributes(type, value); |
this.setTextP(textP); |
} |
343,7 → 345,7 |
// from 19.642 table:formula of OpenDocument-v1.2 : Whenever the initial text of a formula |
// has the appearance of an NCName followed by ":", an OpenDocument producer shall provide a |
// valid namespace prefix in order to eliminate any ambiguity. |
final String nsPrefix = getFormulaNSPrefix(formula).get0(); |
final String nsPrefix = formula == null ? null : getFormulaNSPrefix(formula).get0(); |
if (nsPrefix != null && this.getElement().getNamespace(nsPrefix) == null) { |
throw new IllegalArgumentException("Unknown namespace prefix : " + nsPrefix); |
} |
351,6 → 353,9 |
} |
private final void setFormulaNoCheck(final String formula) { |
if (formula == null) |
this.getElement().removeAttribute("formula", getTABLE()); |
else |
this.getElement().setAttribute("formula", formula, getTABLE()); |
} |
363,7 → 368,9 |
} |
public final void setFormulaAndNamespace(final Namespace ns, final String formula) { |
if (getODDocument().getVersion() == XMLVersion.OOo) { |
if (formula == null) { |
this.setFormulaNoCheck(formula); |
} else if (getODDocument().getVersion() == XMLVersion.OOo) { |
if (ns != null) |
throw new IllegalArgumentException("Namespaces not supported by this version : " + ns); |
this.setFormulaNoCheck(formula); |