summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Barfurth <jb@openoffice.org>2001-08-06 14:25:20 +0000
committerJörg Barfurth <jb@openoffice.org>2001-08-06 14:25:20 +0000
commitc477881853ebf1d595e2379633fb56fcec3e05ed (patch)
treebd4c6dc2d32d419f258569d560f284d0e6c9f0c7
parente3a964f496bdf053ce00a52ab60b8e6da179e4fc (diff)
#90546# 'User'-instances must keep ownership of their INode tree afetr being added
-rw-r--r--configmgr/source/inc/configset.hxx8
-rw-r--r--configmgr/source/treemgr/configset.cxx13
-rw-r--r--configmgr/source/treemgr/noderef.cxx6
3 files changed, 19 insertions, 8 deletions
diff --git a/configmgr/source/inc/configset.hxx b/configmgr/source/inc/configset.hxx
index 8b44436559ac..a5506b2e2d01 100644
--- a/configmgr/source/inc/configset.hxx
+++ b/configmgr/source/inc/configset.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configset.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: jb $ $Date: 2001-07-05 17:05:45 $
+ * last change: $Author: jb $ $Date: 2001-08-06 15:25:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -145,6 +145,10 @@ namespace configmgr
ISynchronizedData* getTreeLock() const;
static ElementTree extract(Tree const& aTree);
+ /** gives ownership of the node tree to the element tree.
+ <p>WARNING: The INode passed must correspond to the root of the element tree</p>
+ */
+ static void takeElementOwnership(std::auto_ptr<INode>& rOldOwner, ElementTree const& aElementTree);
/** if the element tree owns it's node tree, ownership is given to the caller.
<p>WARNING: Irresponsible use of this feature produces crashes</p>
*/
diff --git a/configmgr/source/treemgr/configset.cxx b/configmgr/source/treemgr/configset.cxx
index 7697295ff9a4..ee7b9b360234 100644
--- a/configmgr/source/treemgr/configset.cxx
+++ b/configmgr/source/treemgr/configset.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configset.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: jb $ $Date: 2001-07-05 17:05:51 $
+ * last change: $Author: jb $ $Date: 2001-08-06 15:25:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -231,6 +231,15 @@ ElementTree ElementTree::extract(Tree const& aTree)
}
//-----------------------------------------------------------------------------
+void ElementTree::takeElementOwnership(std::auto_ptr<INode>& rOldOwner, ElementTree const& aElementTree)
+{
+ OSL_PRECOND(aElementTree.isValid(),"ERROR: Trying to transfer ownership to a NULL element tree");
+ OSL_PRECOND(!aElementTree->isFree(),"Trying to give ownership to an element tree that is not free");
+
+ aElementTree->takeNodeFrom(rOldOwner);
+}
+//-----------------------------------------------------------------------------
+
void ElementTree::releaseOwnedElement(std::auto_ptr<INode>& rNewOwner, ElementTree const& aElementTree)
{
OSL_PRECOND(aElementTree.isValid(),"ERROR: Trying to take over the content of a NULL element tree");
diff --git a/configmgr/source/treemgr/noderef.cxx b/configmgr/source/treemgr/noderef.cxx
index 80b387207ac1..34a0b5c561b8 100644
--- a/configmgr/source/treemgr/noderef.cxx
+++ b/configmgr/source/treemgr/noderef.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: noderef.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: jb $ $Date: 2001-07-05 17:05:51 $
+ * last change: $Author: jb $ $Date: 2001-08-06 15:25:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -319,8 +319,6 @@ namespace
Name aValueName = aValue.getNodeName();
- SubNodeID( m_aParentID, aValueName);
-
m_rValueList.push_back(SubNodeID( m_aParentID, aValueName));
return CONTINUE;