diff options
author | Lars Oppermann <lo@openoffice.org> | 2004-02-26 13:43:17 +0000 |
---|---|---|
committer | Lars Oppermann <lo@openoffice.org> | 2004-02-26 13:43:17 +0000 |
commit | 14ff87d59b11833156b0992ee373b14d40ea368c (patch) | |
tree | b3af06ba49719f5dc37dc7893532379e3f551782 /unoxml | |
parent | 4b26e619b71d56c4f1e91c61cb0bbcd138a77d05 (diff) |
#i25594# exceptions
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/dom/attr.cxx | 6 | ||||
-rw-r--r-- | unoxml/source/dom/attr.hxx | 18 | ||||
-rw-r--r-- | unoxml/source/dom/cdatasection.hxx | 28 | ||||
-rw-r--r-- | unoxml/source/dom/characterdata.cxx | 42 | ||||
-rw-r--r-- | unoxml/source/dom/characterdata.hxx | 28 | ||||
-rw-r--r-- | unoxml/source/dom/comment.hxx | 74 | ||||
-rw-r--r-- | unoxml/source/dom/document.cxx | 18 | ||||
-rw-r--r-- | unoxml/source/dom/document.hxx | 30 | ||||
-rw-r--r-- | unoxml/source/dom/documentfragment.hxx | 16 | ||||
-rw-r--r-- | unoxml/source/dom/documenttype.hxx | 16 | ||||
-rw-r--r-- | unoxml/source/dom/element.cxx | 18 | ||||
-rw-r--r-- | unoxml/source/dom/element.hxx | 30 | ||||
-rw-r--r-- | unoxml/source/dom/entity.hxx | 16 | ||||
-rw-r--r-- | unoxml/source/dom/entityreference.hxx | 16 | ||||
-rw-r--r-- | unoxml/source/dom/node.cxx | 80 | ||||
-rw-r--r-- | unoxml/source/dom/node.hxx | 17 | ||||
-rw-r--r-- | unoxml/source/dom/notation.hxx | 16 | ||||
-rw-r--r-- | unoxml/source/dom/processinginstruction.cxx | 6 | ||||
-rw-r--r-- | unoxml/source/dom/processinginstruction.hxx | 18 | ||||
-rw-r--r-- | unoxml/source/dom/text.hxx | 28 |
20 files changed, 283 insertions, 238 deletions
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx index 93bea1a90e12..e6bfdad00ab8 100644 --- a/unoxml/source/dom/attr.cxx +++ b/unoxml/source/dom/attr.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: attr.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:30:50 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,7 +142,7 @@ namespace DOM Sets the value of the attribute from a string.
*/
void SAL_CALL CAttr::setValue(const OUString& value)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
xmlChar* xValue = (xmlChar*)o1.getStr();
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx index f53aeb259f15..2adedaf2d520 100644 --- a/unoxml/source/dom/attr.hxx +++ b/unoxml/source/dom/attr.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: attr.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:46 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -114,7 +114,7 @@ namespace DOM Sets the value of the attribute from a string.
*/
- virtual void SAL_CALL setValue(const OUString& value) throw (RuntimeException);
+ virtual void SAL_CALL setValue(const OUString& value) throw (DOMException);
// resolve uno inheritance problems...
// overrides for XNode base
@@ -125,7 +125,7 @@ namespace DOM // --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -206,7 +206,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -221,23 +221,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return setValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/cdatasection.hxx b/unoxml/source/dom/cdatasection.hxx index 723dc493b15c..0c1df29ef178 100644 --- a/unoxml/source/dom/cdatasection.hxx +++ b/unoxml/source/dom/cdatasection.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: cdatasection.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:00 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,12 +90,12 @@ namespace DOM // --- delegations for XCharacterData
virtual void SAL_CALL appendData(const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::appendData(arg);
}
virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::deleteData(offset, count);
}
@@ -108,22 +108,22 @@ namespace DOM return CCharacterData::getLength();
}
virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::insertData(offset, arg);
}
virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::replaceData(offset, count, arg);
}
virtual void SAL_CALL setData(const OUString& data)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::setData(data);
}
virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::subStringData(offset, count);
}
@@ -137,7 +137,7 @@ namespace DOM // --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -218,7 +218,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -233,23 +233,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index 9c17464f4c1d..f8c645049575 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: characterdata.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:46 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -88,7 +88,7 @@ namespace DOM Append the string to the end of the character data of the node.
*/
void SAL_CALL CCharacterData::appendData(const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
if (m_aNodePtr != NULL)
{
@@ -103,15 +103,18 @@ namespace DOM Remove a range of 16-bit units from the node.
*/
void SAL_CALL CCharacterData::deleteData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
if (m_aNodePtr != NULL)
{
// get current data
OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
- if (offset > tmp.getLength() || offset < 0 || count < 0)
- return;
+ if (offset > tmp.getLength() || offset < 0 || count < 0) {
+ DOMException e;
+ e.Code = DOMExceptionType_INDEX_SIZE_ERR;
+ throw e;
+ }
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
@@ -158,15 +161,18 @@ namespace DOM Insert a string at the specified 16-bit unit offset.
*/
void SAL_CALL CCharacterData::insertData(sal_Int32 offset, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
if (m_aNodePtr != NULL)
{
// get current data
OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
- if (offset > tmp.getLength() || offset < 0)
- return;
+ if (offset > tmp.getLength() || offset < 0) {
+ DOMException e;
+ e.Code = DOMExceptionType_INDEX_SIZE_ERR;
+ throw e;
+ }
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
@@ -185,15 +191,18 @@ namespace DOM with the specified string.
*/
void SAL_CALL CCharacterData::replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
if (m_aNodePtr != NULL)
{
// get current data
OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
- if (offset > tmp.getLength() || offset < 0 || count < 0)
- return;
+ if (offset > tmp.getLength() || offset < 0 || count < 0){
+ DOMException e;
+ e.Code = DOMExceptionType_INDEX_SIZE_ERR;
+ throw e;
+ }
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
@@ -211,7 +220,7 @@ namespace DOM Set the character data of the node that implements this interface.
*/
void SAL_CALL CCharacterData::setData(const OUString& data)
- throw (RuntimeException)
+ throw (DOMException)
{
if (m_aNodePtr != NULL)
{
@@ -227,7 +236,7 @@ namespace DOM Extracts a range of data from the node.
*/
OUString SAL_CALL CCharacterData::subStringData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
OUString aStr;
if (m_aNodePtr != NULL)
@@ -235,6 +244,11 @@ namespace DOM // get current data
OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr));
OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
+ if (offset > tmp.getLength() || offset < 0 || count < 0) {
+ DOMException e;
+ e.Code = DOMExceptionType_INDEX_SIZE_ERR;
+ throw e;
+ }
aStr = tmp.copy(offset, count);
}
return aStr;
diff --git a/unoxml/source/dom/characterdata.hxx b/unoxml/source/dom/characterdata.hxx index 84f2510da5c8..433b33d3e86f 100644 --- a/unoxml/source/dom/characterdata.hxx +++ b/unoxml/source/dom/characterdata.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: characterdata.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: lo $ $Date: 2004-02-19 13:24:04 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,13 +94,13 @@ namespace DOM Append the string to the end of the character data of the node.
*/
virtual void SAL_CALL appendData(const OUString& arg)
- throw (RuntimeException);
+ throw (DOMException);
/**
Remove a range of 16-bit units from the node.
*/
virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException);
+ throw (DOMException);
/**
Return the character data of the node that implements this interface.
@@ -117,30 +117,30 @@ namespace DOM Insert a string at the specified 16-bit unit offset.
*/
virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
- throw (RuntimeException);
+ throw (DOMException);
/**
Replace the characters starting at the specified 16-bit unit offset
with the specified string.
*/
virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
- throw (RuntimeException);
+ throw (DOMException);
/**
Set the character data of the node that implements this interface.
*/
virtual void SAL_CALL setData(const OUString& data)
- throw (RuntimeException);
+ throw (DOMException);
/**
Extracts a range of data from the node.
*/
virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException);
+ throw (DOMException);
// --- delegation for XNode base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -231,7 +231,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -246,23 +246,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return setData(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/comment.hxx b/unoxml/source/dom/comment.hxx index 8f3f90db9d85..cd2fff4eb2bd 100644 --- a/unoxml/source/dom/comment.hxx +++ b/unoxml/source/dom/comment.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: comment.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:07 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,12 +84,12 @@ namespace DOM // --- delegations for XCharacterData
virtual void SAL_CALL appendData(const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::appendData(arg);
}
virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::deleteData(offset, count);
}
@@ -102,22 +102,22 @@ namespace DOM return CCharacterData::getLength();
}
virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::insertData(offset, arg);
}
virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::replaceData(offset, count, arg);
}
virtual void SAL_CALL setData(const OUString& data)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::setData(data);
}
virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::subStringData(offset, count);
}
@@ -131,121 +131,121 @@ namespace DOM // --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::appendChild(newChild);
+ return CCharacterData::appendChild(newChild);
}
virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
throw (RuntimeException)
{
- return CNode::cloneNode(deep);
+ return CCharacterData::cloneNode(deep);
}
virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
throw (RuntimeException)
{
- return CNode::getAttributes();
+ return CCharacterData::getAttributes();
}
virtual Reference< XNodeList > SAL_CALL getChildNodes()
throw (RuntimeException)
{
- return CNode::getChildNodes();
+ return CCharacterData::getChildNodes();
}
virtual Reference< XNode > SAL_CALL getFirstChild()
throw (RuntimeException)
{
- return CNode::getFirstChild();
+ return CCharacterData::getFirstChild();
}
virtual Reference< XNode > SAL_CALL getLastChild()
throw (RuntimeException)
{
- return CNode::getLastChild();
+ return CCharacterData::getLastChild();
}
virtual OUString SAL_CALL getLocalName()
throw (RuntimeException)
{
- return CNode::getLocalName();
+ return CCharacterData::getLocalName();
}
virtual OUString SAL_CALL getNamespaceURI()
throw (RuntimeException)
{
- return CNode::getNamespaceURI();
+ return CCharacterData::getNamespaceURI();
}
virtual Reference< XNode > SAL_CALL getNextSibling()
throw (RuntimeException)
{
- return CNode::getNextSibling();
+ return CCharacterData::getNextSibling();
}
virtual NodeType SAL_CALL getNodeType()
throw (RuntimeException)
{
- return CNode::getNodeType();
+ return CCharacterData::getNodeType();
}
virtual Reference< XDocument > SAL_CALL getOwnerDocument()
throw (RuntimeException)
{
- return CNode::getOwnerDocument();
+ return CCharacterData::getOwnerDocument();
}
virtual Reference< XNode > SAL_CALL getParentNode()
throw (RuntimeException)
{
- return CNode::getParentNode();
+ return CCharacterData::getParentNode();
}
virtual OUString SAL_CALL getPrefix()
throw (RuntimeException)
{
- return CNode::getPrefix();
+ return CCharacterData::getPrefix();
}
virtual Reference< XNode > SAL_CALL getPreviousSibling()
throw (RuntimeException)
{
- return CNode::getPreviousSibling();
+ return CCharacterData::getPreviousSibling();
}
virtual sal_Bool SAL_CALL hasAttributes()
throw (RuntimeException)
{
- return CNode::hasAttributes();
+ return CCharacterData::hasAttributes();
}
virtual sal_Bool SAL_CALL hasChildNodes()
throw (RuntimeException)
{
- return CNode::hasChildNodes();
+ return CCharacterData::hasChildNodes();
}
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::insertBefore(newChild, refChild);
+ return CCharacterData::insertBefore(newChild, refChild);
}
virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
throw (RuntimeException)
{
- return CNode::isSupported(feature, ver);
+ return CCharacterData::isSupported(feature, ver);
}
virtual void SAL_CALL normalize()
throw (RuntimeException)
{
- CNode::normalize();
+ CCharacterData::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::removeChild(oldChild);
+ return CCharacterData::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::replaceChild(newChild, oldChild);
+ return CCharacterData::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::setNodeValue(nodeValue);
+ return CCharacterData::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
- return CNode::setPrefix(prefix);
+ return CCharacterData::setPrefix(prefix);
}
};
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 5b32b54f75f5..177c96331b78 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: document.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:47 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,7 +131,7 @@ namespace DOM // Creates an Attr of the given name.
Reference< XAttr > SAL_CALL CDocument::createAttribute(const OUString& name)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
@@ -142,7 +142,7 @@ namespace DOM // Creates an attribute of the given qualified name and namespace URI.
Reference< XAttr > SAL_CALL CDocument::createAttributeNS(
const OUString& ns, const OUString& qname)
- throw (RuntimeException)
+ throw (DOMException)
{
// libxml does not allow a NS definition to be attached to an
@@ -205,7 +205,7 @@ namespace DOM // Creates an element of the type specified.
Reference< XElement > SAL_CALL CDocument::createElement(const OUString& tagName)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
@@ -216,7 +216,7 @@ namespace DOM // Creates an element of the given qualified name and namespace URI.
Reference< XElement > SAL_CALL CDocument::createElementNS(
const OUString& ns, const OUString& qname)
- throw (RuntimeException)
+ throw (DOMException)
{
sal_Int32 i = qname.indexOf(':');
if (ns.getLength() == 0) throw RuntimeException();
@@ -247,7 +247,7 @@ namespace DOM //Creates an EntityReference object.
Reference< XEntityReference > SAL_CALL CDocument::createEntityReference(const OUString& name)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
@@ -259,7 +259,7 @@ namespace DOM // data strings.
Reference< XProcessingInstruction > SAL_CALL CDocument::createProcessingInstruction(
const OUString& target, const OUString& data)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(target, RTL_TEXTENCODING_UTF8);
xmlChar *xTarget = (xmlChar*)o1.getStr();
@@ -396,7 +396,7 @@ namespace DOM Reference< XNode > SAL_CALL CDocument::importNode(
const Reference< XNode >& importedNode, sal_Bool deep)
- throw (RuntimeException)
+ throw (DOMException)
{
// this node could be from another memory model
// only use uno interfaces to access is!!!
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index 944c756fe39a..73a5a770680f 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: document.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:11 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,13 +109,13 @@ namespace DOM Creates an Attr of the given name.
*/
virtual Reference< XAttr > SAL_CALL createAttribute(const OUString& name)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates an attribute of the given qualified name and namespace URI.
*/
virtual Reference< XAttr > SAL_CALL createAttributeNS(const OUString& namespaceURI, const OUString& qualifiedName)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates a CDATASection node whose value is the specified string.
@@ -139,19 +139,19 @@ namespace DOM Creates an element of the type specified.
*/
virtual Reference< XElement > SAL_CALL createElement(const OUString& tagName)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates an element of the given qualified name and namespace URI.
*/
virtual Reference< XElement > SAL_CALL createElementNS(const OUString& namespaceURI, const OUString& qualifiedName)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates an EntityReference object.
*/
virtual Reference< XEntityReference > SAL_CALL createEntityReference(const OUString& name)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates a ProcessingInstruction node given the specified name and
@@ -159,7 +159,7 @@ namespace DOM */
virtual Reference< XProcessingInstruction > SAL_CALL createProcessingInstruction(
const OUString& target, const OUString& data)
- throw (RuntimeException);
+ throw (DOMException);
/**
Creates a Text node given the specified string.
@@ -213,7 +213,7 @@ namespace DOM Imports a node from another document to this document.
*/
virtual Reference< XNode > SAL_CALL importNode(const Reference< XNode >& importedNode, sal_Bool deep)
- throw (RuntimeException);
+ throw (DOMException);
// ---- resolve uno inheritance problems...
// overrides for XNode base
@@ -223,7 +223,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -304,7 +304,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -319,23 +319,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/documentfragment.hxx b/unoxml/source/dom/documentfragment.hxx index cde84989f1f9..c4f31e481c6a 100644 --- a/unoxml/source/dom/documentfragment.hxx +++ b/unoxml/source/dom/documentfragment.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: documentfragment.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:15 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,7 +90,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -171,7 +171,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -186,23 +186,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/documenttype.hxx b/unoxml/source/dom/documenttype.hxx index ebab5389ea3e..c236bc9a16db 100644 --- a/unoxml/source/dom/documenttype.hxx +++ b/unoxml/source/dom/documenttype.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: documenttype.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:21 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -130,7 +130,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -211,7 +211,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -226,23 +226,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 04163df76d45..30389588a73b 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: element.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:47 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -218,7 +218,7 @@ namespace DOM Removes an attribute by name.
*/
void CElement::removeAttribute(const OUString& name)
- throw (RuntimeException)
+ throw (DOMException)
{
xmlChar *xName = (xmlChar*)OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr();
if (m_aNodePtr != NULL) {
@@ -230,7 +230,7 @@ namespace DOM Removes an attribute by local name and namespace URI.
*/
void CElement::removeAttributeNS(const OUString& namespaceURI, const OUString& localName)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
@@ -247,7 +247,7 @@ namespace DOM Removes the specified attribute node.
*/
Reference< XAttr > CElement::removeAttributeNode(const Reference< XAttr >& oldAttr)
- throw (RuntimeException)
+ throw (DOMException)
{
Reference< XAttr > aAttr;
if(m_aNodePtr != NULL)
@@ -325,7 +325,7 @@ namespace DOM }
Reference< XAttr > CElement::setAttributeNode(const Reference< XAttr >& newAttr)
- throw (RuntimeException)
+ throw (DOMException)
{
return _setAttributeNode(newAttr, sal_False);
}
@@ -334,7 +334,7 @@ namespace DOM Adds a new attribute.
*/
Reference< XAttr > CElement::setAttributeNodeNS(const Reference< XAttr >& newAttr)
- throw (RuntimeException)
+ throw (DOMException)
{
return _setAttributeNode(newAttr, sal_True);
}
@@ -343,7 +343,7 @@ namespace DOM Adds a new attribute.
*/
void CElement::setAttribute(const OUString& name, const OUString& value)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xName = (xmlChar*)o1.getStr();
@@ -382,7 +382,7 @@ namespace DOM */
void CElement::setAttributeNS(
const OUString& namespaceURI, const OUString& qualifiedName, const OUString& value)
- throw (RuntimeException)
+ throw (DOMException)
{
if (namespaceURI.getLength() == 0) throw RuntimeException();
diff --git a/unoxml/source/dom/element.hxx b/unoxml/source/dom/element.hxx index 70ff94447268..dd6c1a5135f2 100644 --- a/unoxml/source/dom/element.hxx +++ b/unoxml/source/dom/element.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: element.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:25 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -154,44 +154,44 @@ namespace DOM Removes an attribute by name.
*/
virtual void SAL_CALL removeAttribute(const OUString& name)
- throw (RuntimeException);
+ throw (DOMException);
/**
Removes the specified attribute node.
*/
virtual Reference< XAttr > SAL_CALL removeAttributeNode(const Reference< XAttr >& oldAttr)
- throw (RuntimeException);
+ throw (DOMException);
/**
Removes an attribute by local name and namespace URI.
*/
virtual void SAL_CALL removeAttributeNS(const OUString& namespaceURI, const OUString& localName)
- throw (RuntimeException);
+ throw (DOMException);
/**
Adds a new attribute.
*/
virtual void SAL_CALL setAttribute(const OUString& name, const OUString& value)
- throw (RuntimeException);
+ throw (DOMException);
/**
Adds a new attribute node.
*/
virtual Reference< XAttr > SAL_CALL setAttributeNode(const Reference< XAttr >& newAttr)
- throw (RuntimeException);
+ throw (DOMException);
/**
Adds a new attribute.
*/
virtual Reference< XAttr > SAL_CALL setAttributeNodeNS(const Reference< XAttr >& newAttr)
- throw (RuntimeException);
+ throw (DOMException);
/**
Adds a new attribute.
*/
virtual void SAL_CALL setAttributeNS(
const OUString& namespaceURI, const OUString& qualifiedName, const OUString& value)
- throw (RuntimeException);
+ throw (DOMException);
// overrides for XNode base
virtual OUString SAL_CALL getNodeName()
@@ -204,7 +204,7 @@ namespace DOM // resolve uno inheritance problems...
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -280,7 +280,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -295,23 +295,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/entity.hxx b/unoxml/source/dom/entity.hxx index a285c0ed6b75..7640d67eaf40 100644 --- a/unoxml/source/dom/entity.hxx +++ b/unoxml/source/dom/entity.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: entity.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:30 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -111,7 +111,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -192,7 +192,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -207,23 +207,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/entityreference.hxx b/unoxml/source/dom/entityreference.hxx index 561eed88058f..eb86b77a36f9 100644 --- a/unoxml/source/dom/entityreference.hxx +++ b/unoxml/source/dom/entityreference.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: entityreference.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:34 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,7 +89,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -170,7 +170,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -185,23 +185,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 065c5a3a447d..0dbcd4dcd0dd 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: node.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:47 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -271,7 +271,7 @@ namespace DOM Adds the node newChild to the end of the list of children of this node.
*/
Reference< XNode > CNode::appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
Reference< XNode> aNode;
if (m_aNodePtr != NULL) {
@@ -280,17 +280,23 @@ namespace DOM // error checks:
// from other document
- if (cur->doc != m_aNodePtr->doc)
- throw (RuntimeException(OUString::createFromAscii(
- "appended node belongs to other document"), Reference<XInterface>()));
+ if (cur->doc != m_aNodePtr->doc) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
// same node
- if (cur == m_aNodePtr)
- throw (RuntimeException(OUString::createFromAscii(
- "appended node is same as parent"), Reference<XInterface>()));
+ if (cur == m_aNodePtr) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
// already has parant and is not attribute
- if (cur->parent != NULL && cur->type != XML_ATTRIBUTE_NODE)
- throw (RuntimeException(OUString::createFromAscii(
- "appended node has other parent"), Reference<XInterface>()));
+ if (cur->parent != NULL && cur->type != XML_ATTRIBUTE_NODE) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
// check whether this is an attribute node so we remove it's
// carrier node
@@ -299,7 +305,11 @@ namespace DOM {
if (m_aNodePtr->type != XML_ELEMENT_NODE || cur->parent == NULL
|| strcmp((char*)cur->parent->name, "__private") != NULL)
- throw RuntimeException();
+ {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
xmlNsPtr pAttrNs = cur->ns;
xmlNsPtr pParentNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, pAttrNs->prefix);
@@ -598,9 +608,19 @@ namespace DOM */
Reference< XNode > SAL_CALL CNode::insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
- // XXX check node types
+
+ if (newChild->getOwnerDocument() != getOwnerDocument()) {
+ DOMException e;
+ e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR;
+ throw e;
+ }
+ if (refChild->getParentNode() != Reference< XNode >(this)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
Reference< XUnoTunnel > tref(refChild, UNO_QUERY);
Reference< XUnoTunnel > tnew(newChild, UNO_QUERY);
@@ -653,8 +673,15 @@ namespace DOM and returns it.
*/
Reference< XNode > SAL_CALL CNode::removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
+
+ if (oldChild->getParentNode() != Reference< XNode >(this)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
+
Reference< XUnoTunnel > told(oldChild, UNO_QUERY);
xmlNodePtr old = (xmlNodePtr)told->getSomething(Sequence< sal_Int8>());
xmlNodePtr cur = m_aNodePtr->children;
@@ -700,10 +727,15 @@ namespace DOM */
Reference< XNode > SAL_CALL CNode::replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
// XXX check node types
+ if (oldChild->getParentNode() != Reference< XNode >(this)) {
+ DOMException e;
+ e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
+ throw e;
+ }
Reference< XNode > aNode = removeChild(oldChild);
appendChild(newChild);
@@ -747,22 +779,20 @@ namespace DOM The value of this node, depending on its type; see the table above.
*/
void SAL_CALL CNode::setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
// use specific node implememntation
- /*
- xmlChar *pBuf = OUString2OString(nodeValue, RTL_TEXTENCODING_UTF8).getStr();
- // XXX how to free the old content?
- m_aNodePtr->content = pBuf;
- */
-
+ // if we end up down here, something went wrong
+ DOMException e;
+ e.Code = DOMExceptionType_NO_MODIFICATION_ALLOWED_ERR;
+ throw e;
}
/**
The namespace prefix of this node, or null if it is unspecified.
*/
void SAL_CALL CNode::setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
OString o1 = OUStringToOString(prefix, RTL_TEXTENCODING_UTF8);
xmlChar *pBuf = (xmlChar*)o1.getStr();
diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx index 06edfece7e09..fe765afa98dc 100644 --- a/unoxml/source/dom/node.hxx +++ b/unoxml/source/dom/node.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: node.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-16 16:41:47 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/xml/dom/events/XEventTarget.hpp>
+#include <com/sun/star/xml/dom/DOMException.hpp>
#include <libxml/tree.h>
using namespace rtl;
@@ -130,7 +131,7 @@ namespace DOM Adds the node newChild to the end of the list of children of this node.
*/
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException);
+ throw (DOMException);
/**
Returns a duplicate of this node, i.e., serves as a generic copy
@@ -243,7 +244,7 @@ namespace DOM */
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException);
+ throw (DOMException);
/**
Tests whether the DOM implementation implements a specific feature and
@@ -267,7 +268,7 @@ namespace DOM and returns it.
*/
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException);
+ throw (DOMException);
/**
Replaces the child node oldChild with newChild in the list of children,
@@ -275,19 +276,19 @@ namespace DOM */
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException);
+ throw (DOMException);
/**
The value of this node, depending on its type; see the table above.
*/
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException);
+ throw (DOMException);
/**
The namespace prefix of this node, or null if it is unspecified.
*/
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException);
+ throw (DOMException);
// --- XUnoTunnel
diff --git a/unoxml/source/dom/notation.hxx b/unoxml/source/dom/notation.hxx index c85b58598c33..6dd579c68bee 100644 --- a/unoxml/source/dom/notation.hxx +++ b/unoxml/source/dom/notation.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: notation.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:39 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,7 +102,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -183,7 +183,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -198,23 +198,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/processinginstruction.cxx b/unoxml/source/dom/processinginstruction.cxx index c04f790c2c97..0d7073f8201c 100644 --- a/unoxml/source/dom/processinginstruction.cxx +++ b/unoxml/source/dom/processinginstruction.cxx @@ -2,9 +2,9 @@ *
* $RCSfile: processinginstruction.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:41 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,7 +92,7 @@ namespace DOM /**
The content of this processing instruction.
*/
- void SAL_CALL CProcessingInstruction::setData(const OUString& data) throw (RuntimeException)
+ void SAL_CALL CProcessingInstruction::setData(const OUString& data) throw (DOMException)
{
// XXX
}
diff --git a/unoxml/source/dom/processinginstruction.hxx b/unoxml/source/dom/processinginstruction.hxx index 1670bd46e2b2..f781aad398e3 100644 --- a/unoxml/source/dom/processinginstruction.hxx +++ b/unoxml/source/dom/processinginstruction.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: processinginstruction.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lo $ $Date: 2004-01-28 16:31:43 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,7 +95,7 @@ namespace DOM /**
The content of this processing instruction.
*/
- virtual void SAL_CALL setData(const OUString& data) throw (RuntimeException);
+ virtual void SAL_CALL setData(const OUString& data) throw (DOMException);
// ---- resolve uno inheritance problems...
// overrides for XNode base
@@ -105,7 +105,7 @@ namespace DOM throw (RuntimeException);
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::appendChild(newChild);
}
@@ -186,7 +186,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::insertBefore(newChild, refChild);
}
@@ -201,23 +201,23 @@ namespace DOM CNode::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CNode::setPrefix(prefix);
}
diff --git a/unoxml/source/dom/text.hxx b/unoxml/source/dom/text.hxx index bb488f4e6f8e..c6c989a56e1f 100644 --- a/unoxml/source/dom/text.hxx +++ b/unoxml/source/dom/text.hxx @@ -2,9 +2,9 @@ *
* $RCSfile: text.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: lo $ $Date: 2004-02-19 13:24:05 $
+ * last change: $Author: lo $ $Date: 2004-02-26 14:43:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,12 +96,12 @@ namespace DOM // --- delegations for XCharacterData
virtual void SAL_CALL appendData(const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::appendData(arg);
}
virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::deleteData(offset, count);
}
@@ -114,22 +114,22 @@ namespace DOM return CCharacterData::getLength();
}
virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::insertData(offset, arg);
}
virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::replaceData(offset, count, arg);
}
virtual void SAL_CALL setData(const OUString& data)
- throw (RuntimeException)
+ throw (DOMException)
{
CCharacterData::setData(data);
}
virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::subStringData(offset, count);
}
@@ -142,7 +142,7 @@ namespace DOM // --- resolve uno inheritance problems...
// --- delegation for XNde base.
virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::appendChild(newChild);
}
@@ -227,7 +227,7 @@ namespace DOM }
virtual Reference< XNode > SAL_CALL insertBefore(
const Reference< XNode >& newChild, const Reference< XNode >& refChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::insertBefore(newChild, refChild);
}
@@ -242,23 +242,23 @@ namespace DOM CCharacterData::normalize();
}
virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::removeChild(oldChild);
}
virtual Reference< XNode > SAL_CALL replaceChild(
const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::replaceChild(newChild, oldChild);
}
virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::setNodeValue(nodeValue);
}
virtual void SAL_CALL setPrefix(const OUString& prefix)
- throw (RuntimeException)
+ throw (DOMException)
{
return CCharacterData::setPrefix(prefix);
}
|