fs34b: #i117459# fixed the test - do not create multiple children of a document, this (rightfully) throws nowadays
This commit is contained in:
committed by
Michael Meeks
parent
fc61f0dbb9
commit
0c696c1628
@@ -85,17 +85,14 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
|
|||||||
// create a simple structure in the DOM tree: an element with two attributes
|
// create a simple structure in the DOM tree: an element with two attributes
|
||||||
String[] modelNames = m_document.getXFormModelNames();
|
String[] modelNames = m_document.getXFormModelNames();
|
||||||
m_defaultModel = m_document.getXFormModel( modelNames[0] );
|
m_defaultModel = m_document.getXFormModel( modelNames[0] );
|
||||||
Instance defaultInstance = m_defaultModel.getDefaultInstance();
|
final Instance defaultInstance = m_defaultModel.getDefaultInstance();
|
||||||
|
// remove the default root node
|
||||||
|
defaultInstance.removeNode( "instanceData" );
|
||||||
|
// create test structures
|
||||||
XNode stringElement = defaultInstance.createElement( "stringElement" );
|
XNode stringElement = defaultInstance.createElement( "stringElement" );
|
||||||
XNode booleanAttrib = defaultInstance.createAttribute( stringElement, "booleanAttribute", "true" );
|
XNode booleanAttrib = defaultInstance.createAttribute( stringElement, "booleanAttribute", "true" );
|
||||||
XNode dateAttrib = defaultInstance.createAttribute( stringElement, "dateAttribute" );
|
XNode dateAttrib = defaultInstance.createAttribute( stringElement, "dateAttribute" );
|
||||||
|
|
||||||
// when it comes to saving and loading, only one child of the root element of the instance
|
|
||||||
// is handled (is this a bug? see xmloff/source/xforms/XFormsInstanceContext.cxx, method
|
|
||||||
// CreateChildContext).
|
|
||||||
// So, we remove the default node of the instance which it has all the time
|
|
||||||
defaultInstance.removeNode( "instanceData" );
|
|
||||||
|
|
||||||
assure( "booleanAttrib's parent is wrong",
|
assure( "booleanAttrib's parent is wrong",
|
||||||
UnoRuntime.areSame( stringElement, booleanAttrib.getParentNode() ) );
|
UnoRuntime.areSame( stringElement, booleanAttrib.getParentNode() ) );
|
||||||
assure( "dateAttrib's parent is wrong",
|
assure( "dateAttrib's parent is wrong",
|
||||||
|
@@ -32,23 +32,6 @@ public class Instance
|
|||||||
return createElement( m_domInstance, _elementName, null );
|
return createElement( m_domInstance, _elementName, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** creates a new element in the instance
|
|
||||||
*
|
|
||||||
* The element will be inserted immediately below the root node of the instance.
|
|
||||||
*
|
|
||||||
* @param _elementName
|
|
||||||
* the name of the to-be-created element
|
|
||||||
* @param _initialNodeValue
|
|
||||||
* the initial value to set at the node. Might be null, in this case no value is set.
|
|
||||||
* @return
|
|
||||||
* the node of the newly created element
|
|
||||||
* @throws com.sun.star.xml.dom.DOMException
|
|
||||||
*/
|
|
||||||
public XNode createElement( String _elementName, String _initialNodeValue ) throws DOMException
|
|
||||||
{
|
|
||||||
return createElement( m_domInstance, _elementName, _initialNodeValue );
|
|
||||||
}
|
|
||||||
|
|
||||||
/** creates a new element in the instance
|
/** creates a new element in the instance
|
||||||
*
|
*
|
||||||
* The element will be inserted immediately below a given XNode.
|
* The element will be inserted immediately below a given XNode.
|
||||||
|
Reference in New Issue
Block a user