OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 66 → Rev 67

/trunk/OpenConcerto/src/org/openconcerto/openoffice/spreadsheet/MutableCell.java
112,11 → 112,19
// *** setValue
 
private void setValueAttributes(ODValueType type, Object val) {
final Attribute valueTypeAttr = this.getElement().getAttribute("value-type", getValueNS());
// e.g. DATE
final ODValueType currentType = valueTypeAttr == null ? null : ODValueType.get(valueTypeAttr.getValue());
// remove old value attribute (assume Element is valid, otherwise we would need to remove
// all possible value attributes)
if (currentType != null && !currentType.equals(type)) {
// e.g. @date-value
this.getElement().removeAttribute(currentType.getValueAttribute(), getValueNS());
}
 
if (type == null) {
final Attribute valueTypeAttr = this.getElement().getAttribute("value-type", getValueNS());
if (valueTypeAttr != null) {
valueTypeAttr.detach();
this.getElement().removeAttribute(ODValueType.get(valueTypeAttr.getValue()).getValueAttribute(), getValueNS());
}
} else {
this.getElement().setAttribute("value-type", type.getName(), getValueNS());