#86095# TemplateProvider for SetElementFactory is now fetched from the set node

This commit is contained in:
Jörg Barfurth 2001-04-19 14:15:30 +00:00
parent a52cdd5388
commit 57596ca86c
2 changed files with 22 additions and 4 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: configset.hxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: mh $ $Date: 2001-02-02 18:06:26 $
* last change: $Author: jb $ $Date: 2001-04-19 15:15:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -167,6 +167,8 @@ namespace configmgr
ElementTree instantiateTemplate(TemplateHolder const& aTemplate);
ElementTree instantiateOnDefault(std::auto_ptr<INode> aTree, TemplateHolder const& aDummyTemplate);
static TemplateProvider findTemplateProvider(Tree const& aTree, NodeRef const& aNode);
};
//-----------------------------------------------------------------------------

View file

@ -2,9 +2,9 @@
*
* $RCSfile: configset.cxx,v $
*
* $Revision: 1.10 $
* $Revision: 1.11 $
*
* last change: $Author: jb $ $Date: 2001-03-12 15:04:12 $
* last change: $Author: jb $ $Date: 2001-04-19 15:15:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -320,6 +320,22 @@ ElementTree SetElementFactory::instantiateOnDefault(std::auto_ptr<INode> aTree,
return aRet;
}
//-----------------------------------------------------------------------------
TemplateProvider SetElementFactory::findTemplateProvider(Tree const& aTree, NodeRef const& aNode)
{
OSL_ENSURE(!aTree.isEmpty(), "ERROR: Getting Element Factory requires a valid tree");
OSL_ENSURE(aNode.isValid(), "ERROR: Getting Element Factory requires a valid node");
OSL_ENSURE(aTree.isValidNode(aNode), "ERROR: Tree/Node mismatch");
if (aNode.isValid() )
{
Node* pNode = TreeImplHelper::node(aNode);
OSL_ENSURE (pNode->isSetNode(), "WARNING: Getting Element Factory requires a SET node");
if (pNode->isSetNode())
return pNode->setImpl().getTemplateProvider();
}
return TemplateProvider();
}
//-----------------------------------------------------------------------------