#98489# Add missing member functions for builders
This commit is contained in:
parent
ff6bc333b1
commit
c8e48fd20b
3 changed files with 72 additions and 6 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: componentdatahelper.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: jb $ $Date: 2002-05-16 10:56:07 $
|
||||
* last change: $Author: jb $ $Date: 2002-05-17 13:21:22 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -121,6 +121,22 @@ void DataBuilderContext::raiseMalformedDataException(sal_Char const * _pText) co
|
|||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void DataBuilderContext::raiseIllegalAccessException(sal_Char const * _pText) const
|
||||
CFG_UNO_THROW1( lang::IllegalAccessException )
|
||||
{
|
||||
OUString sMessage = OUString::createFromAscii(_pText);
|
||||
throw lang::IllegalAccessException(sMessage, m_pContext);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void DataBuilderContext::raiseIllegalTypeException(sal_Char const * _pText) const
|
||||
CFG_UNO_THROW1( beans::IllegalTypeException )
|
||||
{
|
||||
OUString sMessage = OUString::createFromAscii(_pText);
|
||||
throw beans::IllegalTypeException(sMessage, m_pContext);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void DataBuilderContext::raiseNoSupportException(sal_Char const * _pText) const
|
||||
CFG_UNO_THROW1( lang::NoSupportException )
|
||||
{
|
||||
|
@ -250,6 +266,42 @@ TemplateIdentifier DataBuilderContext::completeComponent( const TemplateIdentifi
|
|||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
TemplateIdentifier DataBuilderContext::getCurrentItemType() const
|
||||
CFG_THROW2( MalformedDataException, uno::RuntimeException )
|
||||
{
|
||||
ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
|
||||
if (!pCurrentSet || !pCurrentSet->isSetNode())
|
||||
raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
|
||||
|
||||
TemplateIdentifier aCompleteType;
|
||||
|
||||
aCompleteType.Name = pCurrentSet->getElementTemplateName();
|
||||
aCompleteType.Component = pCurrentSet->getElementTemplateModule();
|
||||
|
||||
return aCompleteType;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
TemplateIdentifier DataBuilderContext::getValidItemType(TemplateIdentifier const & aItemType) const
|
||||
CFG_THROW3( MalformedDataException, beans::IllegalTypeException, uno::RuntimeException )
|
||||
{
|
||||
ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
|
||||
if (!pCurrentSet || !pCurrentSet->isSetNode())
|
||||
raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
|
||||
|
||||
TemplateIdentifier aCompleteType = completeComponent( aItemType );
|
||||
|
||||
// for now only a single item-type is supported
|
||||
if (aCompleteType.Name != pCurrentSet->getElementTemplateName())
|
||||
raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set");
|
||||
|
||||
if (aCompleteType.Component != pCurrentSet->getElementTemplateModule())
|
||||
raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set (component mismatch)");
|
||||
|
||||
return aCompleteType;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ISubtree * DataBuilderContext::addNodeToCurrent(std::auto_ptr<ISubtree> _aNode)
|
||||
CFG_THROW3( MalformedDataException, container::ElementExistException, uno::RuntimeException )
|
||||
{
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: mergedcomponentdata.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: jb $ $Date: 2002-05-16 10:56:07 $
|
||||
* last change: $Author: jb $ $Date: 2002-05-17 13:21:22 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -106,6 +106,12 @@ bool MergedComponentData::hasTemplates() const
|
|||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
OUString MergedComponentData::getTemplateAccessor (TemplateIdentifier const & _aTemplateName) const
|
||||
{
|
||||
return _aTemplateName.Name;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MergedComponentData::hasTemplate(TemplateIdentifier const & _aTemplateName) const
|
||||
{
|
||||
return m_pTemplatesTree.get() != NULL &&
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: schemabuilder.cxx,v $
|
||||
*
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
*
|
||||
* last change: $Author: jb $ $Date: 2002-05-17 11:59:50 $
|
||||
* last change: $Author: jb $ $Date: 2002-05-17 13:21:22 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -157,6 +157,14 @@ void SAL_CALL SchemaBuilder::endSchema( )
|
|||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void SAL_CALL SchemaBuilder::importComponent( const OUString& aName )
|
||||
throw (MalformedDataException, container::NoSuchElementException, lang::IllegalArgumentException, uno::RuntimeException)
|
||||
{
|
||||
OSL_ENSURE(false, "Cross-componnet references are not yet supported");
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
void SAL_CALL SchemaBuilder::startComponent( const OUString& aName )
|
||||
throw (MalformedDataException, container::ElementExistException, lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue