summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--forms/qa/integration/forms/XMLFormSettings.java8
-rw-r--r--forms/qa/org/openoffice/xforms/Instance.java34
-rw-r--r--forms/source/component/FormComponent.cxx8
-rw-r--r--forms/source/inc/componenttools.hxx8
-rw-r--r--forms/source/misc/componenttools.cxx12
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(