if (simpleVariableElements == null) {
simpleVariableElements = ((OdfFileDom) containerElement.getOwnerDocument())
.newOdfElement(TextVariableDeclsElement.class);
containerElement.insertBefore(simpleVariableElements, containerElement.getFirstChild());
} else {
TextVariableDeclElement simpleVariableElementTmp = (TextVariableDeclElement) simpleVariableElements
.getFirstChild();
while (simpleVariableElementTmp != null) {
if (name.equals(simpleVariableElementTmp.getTextNameAttribute())) {
simpleVariableElement = simpleVariableElementTmp;
break;
} else {
simpleVariableElementTmp = (TextVariableDeclElement) simpleVariableElementTmp.getNextSibling();
}
}
}
if (simpleVariableElement == null) {
simpleVariableElement = simpleVariableElements.newTextVariableDeclElement("string", name);