diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-11-15 12:38:39 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-11-15 12:38:39 +0000 |
commit | 35aa0031278b6d482d83cc06a9c33809d77e5df1 (patch) | |
tree | 3caf99a0078a75b3dffa8575495fd2f53bad382c /configmgr | |
parent | c2a092d28080859c625ca8f500c7a1903d6d1ace (diff) |
INTEGRATION: CWS cfglooseends (1.9.12); FILE MERGED
2004/11/05 10:25:10 jb 1.9.12.1: #115489# Raise an exception when encountering an invalid value type
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/xml/elementparser.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/configmgr/source/xml/elementparser.cxx b/configmgr/source/xml/elementparser.cxx index 410dd23631ff..ac98f69077b1 100644 --- a/configmgr/source/xml/elementparser.cxx +++ b/configmgr/source/xml/elementparser.cxx @@ -2,9 +2,9 @@ * * $RCSfile: elementparser.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: kz $ $Date: 2004-08-31 14:58:46 $ + * last change: $Author: obo $ $Date: 2004-11-15 13:38:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,8 @@ #include <com/sun/star/configuration/backend/SchemaAttribute.hpp> #include <com/sun/star/configuration/backend/NodeAttribute.hpp> +#include <rtl/ustrbuf.hxx> + // ----------------------------------------------------------------------------- namespace configmgr @@ -364,14 +366,18 @@ ElementInfo::FlagsType ElementParser::getNodeFlags(SaxAttributeList const& xAttr } // ----------------------------------------------------------------------------- static -void badValueType(Logger const & logger, sal_Char const * _pMsg, OUString const & _sExtra) +void badValueType(Logger const & logger, sal_Char const * _pMsg, OUString const & _sType) { - rtl::OString sMessage( "Configuration XML parser: Bad value type attribute:" ); - sMessage += _pMsg; - sMessage += rtl::OUStringToOString(_sExtra,RTL_TEXTENCODING_ASCII_US); + rtl::OUStringBuffer sMessageBuf; + sMessageBuf.appendAscii( "Configuration XML parser: Bad value type attribute: " ); + if (_pMsg) sMessageBuf.appendAscii(_pMsg); + + const sal_Unicode kQuote = '"'; + sMessageBuf.append(kQuote).append(_sType).append(kQuote); + OUString const sMessage = sMessageBuf.makeStringAndClear(); logger.error(sMessage); -// throw sax::SAXException(sMessage, NULL, uno::Any()); + throw ElementParser::BadValueType(sMessage); } // ----------------------------------------------------------------------------- static @@ -420,7 +426,7 @@ OUString stripTypeName(Logger const & logger, OUString const & _sString, OUStrin if ( matchNsPrefix(_sString,_sPrefix)) return stripNsPrefix(_sString, _sPrefix); - badValueType(logger, "Missing expected namespace prefix: ", _sPrefix); + badValueType(logger, "Missing expected namespace prefix on type name: ", _sString); return _sString; } |