diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 12:28:29 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 12:28:29 +0000 |
commit | c2d2e4261ed52ffec5a06f63ca5b135961ac4722 (patch) | |
tree | cdeab0daa3d3160a977db2aa07d957dd55844b9e | |
parent | 93d89bfbc1e47f3663582ddc38d3c9904925b085 (diff) |
CWS-TOOLING: integrate CWS dba31b
-rw-r--r-- | forms/qa/integration/forms/XMLFormSettings.java | 8 | ||||
-rw-r--r-- | forms/qa/org/openoffice/xforms/Instance.java | 34 | ||||
-rw-r--r-- | forms/source/component/FormComponent.cxx | 8 | ||||
-rw-r--r-- | forms/source/inc/componenttools.hxx | 8 | ||||
-rw-r--r-- | forms/source/misc/componenttools.cxx | 12 |
5 files changed, 47 insertions, 23 deletions
diff --git a/forms/qa/integration/forms/XMLFormSettings.java b/forms/qa/integration/forms/XMLFormSettings.java index fd7e393f039c..edb4fb07c45d 100644 --- a/forms/qa/integration/forms/XMLFormSettings.java +++ b/forms/qa/integration/forms/XMLFormSettings.java @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: XMLFormSettings.java,v $ - * $Revision: 1.2 $ + * $Revision: 1.2.24.1 $ * * This file is part of OpenOffice.org. * @@ -93,6 +93,12 @@ public class XMLFormSettings extends complexlib.ComplexTestCase XNode booleanAttrib = defaultInstance.createAttribute( stringElement, "booleanAttribute", "true" ); 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", UnoRuntime.areSame( stringElement, booleanAttrib.getParentNode() ) ); assure( "dateAttrib's parent is wrong", diff --git a/forms/qa/org/openoffice/xforms/Instance.java b/forms/qa/org/openoffice/xforms/Instance.java index d068560c5da1..5e4e04741995 100644 --- a/forms/qa/org/openoffice/xforms/Instance.java +++ b/forms/qa/org/openoffice/xforms/Instance.java @@ -8,6 +8,8 @@ package org.openoffice.xforms; import com.sun.star.xml.dom.DOMException; import com.sun.star.xml.dom.XDocument; import com.sun.star.xml.dom.XNode; +import com.sun.star.xml.dom.XNodeList; +import java.util.NoSuchElementException; /** * @@ -97,6 +99,38 @@ public class Instance return node; } + /** removes a child of the root-level node from the instance + * + * @param _elementName + * the name of the to-be-removed child + */ + public XNode removeNode( String _elementName ) throws DOMException + { + return removeNode( m_domInstance, _elementName ); + } + + /** removes a node from the instance + * + * @param _parentElement + * the node whose child is to be removed + * @param _elementName + * the name of the to-be-removed child + */ + public XNode removeNode( XNode _parentElement, String _elementName ) throws DOMException + { + XNodeList nodes = _parentElement.getChildNodes(); + for ( int i=0; i<nodes.getLength(); ++i ) + { + XNode node = nodes.item(i); + if ( node.getLocalName().equals( _elementName ) ) + { + _parentElement.removeChild( node ); + return node; + } + } + throw new NoSuchElementException(); + } + /** creates an attribute for the root node of the instance * * @param _attribName diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index eac296badc39..e1447853c4bd 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormComponent.cxx,v $ - * $Revision: 1.63 $ + * $Revision: 1.62.8.2 $ * * This file is part of OpenOffice.org. * @@ -2456,6 +2456,9 @@ void OBoundControlModel::connectExternalValueBinding( // remember this new binding m_xExternalBinding = _rxBinding; + // tell the derivee + onConnectedExternalValue(); + try { // add as value listener so we get notified when the value changes @@ -2486,9 +2489,6 @@ void OBoundControlModel::connectExternalValueBinding( DBG_UNHANDLED_EXCEPTION(); } - // tell the derivee - onConnectedExternalValue(); - // propagate our new value transferExternalValueToControl( _rInstanceLock ); diff --git a/forms/source/inc/componenttools.hxx b/forms/source/inc/componenttools.hxx index 049fdc7ffbaa..b766480de243 100644 --- a/forms/source/inc/componenttools.hxx +++ b/forms/source/inc/componenttools.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: componenttools.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.42.1 $ * * This file is part of OpenOffice.org. * @@ -86,12 +86,6 @@ namespace frm const TypeSequence& _rTypes2, const TypeSequence& _rTypes3 ); - TypeBag( - const TypeSequence& _rTypes1, - const TypeSequence& _rTypes2, - const TypeSequence& _rTypes3, - const TypeSequence& _rTypes4 - ); void addTypes( const TypeSequence& _rTypes ); diff --git a/forms/source/misc/componenttools.cxx b/forms/source/misc/componenttools.cxx index ce8592fa5a46..2859f0dd2802 100644 --- a/forms/source/misc/componenttools.cxx +++ b/forms/source/misc/componenttools.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: componenttools.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.42.1 $ * * This file is part of OpenOffice.org. * @@ -68,16 +68,6 @@ namespace frm } //-------------------------------------------------------------------- - TypeBag::TypeBag( const TypeSequence& _rTypes1, const TypeSequence& _rTypes2, const TypeSequence& _rTypes3, - const TypeSequence& _rTypes4 ) - { - addTypes( _rTypes1 ); - addTypes( _rTypes2 ); - addTypes( _rTypes3 ); - addTypes( _rTypes4 ); - } - - //-------------------------------------------------------------------- void TypeBag::addTypes( const TypeSequence& _rTypes ) { ::std::copy( |