summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-11-15 12:38:08 +0000
committerOliver Bolte <obo@openoffice.org>2004-11-15 12:38:08 +0000
commit7e18a665b6e02f9715417c7231ccfa7317d1838a (patch)
treedce92cf949f7d7b87051ea818ae0c58b24969e4e /configmgr
parentd1d10372b2afa5d620e8af69e10285d38fb29413 (diff)
INTEGRATION: CWS cfglooseends (1.6.12); FILE MERGED
2004/11/05 10:25:09 jb 1.6.12.1: #115489# Raise an exception when encountering an invalid value type
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/xml/basicparser.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/configmgr/source/xml/basicparser.cxx b/configmgr/source/xml/basicparser.cxx
index b290f1e229b7..be4fbd57c6cf 100644
--- a/configmgr/source/xml/basicparser.cxx
+++ b/configmgr/source/xml/basicparser.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: basicparser.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: kz $ $Date: 2004-08-31 14:58:23 $
+ * last change: $Author: obo $ $Date: 2004-11-15 13:38:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -334,7 +334,15 @@ void BasicParser::startProperty( ElementInfo const & aInfo, const uno::Reference
if (isInProperty())
raiseParseException( "Configuration XML Parser - Invalid Data: Properties may not nest" );
- m_aValueType = getDataParser().getPropertyValueType(xAttribs);
+ try
+ {
+ m_aValueType = getDataParser().getPropertyValueType(xAttribs);
+ }
+ catch (ElementParser::BadValueType & error)
+ {
+ raiseParseException(error.message());
+ }
+
m_bInProperty = true;
m_aNodes.push(aInfo);
@@ -550,6 +558,18 @@ void BasicParser::raiseParseException( sal_Char const * _pMsg )
throw sax::SAXException( sMessage, *this, uno::Any() );
}
// -----------------------------------------------------------------------------
+
+void BasicParser::raiseParseException( OUString const & sMessage )
+ CFG_THROW2 (sax::SAXException, uno::RuntimeException)
+{
+ OSL_DEBUG_ONLY( dbgUpdateLocation() );
+
+ if (sMessage.getLength() == 0) raiseParseException(NULL);
+
+ getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
+ throw sax::SAXException( sMessage, *this, uno::Any() );
+}
+// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
} // namespace