summaryrefslogtreecommitdiff
path: root/sax/source/fastparser/fastparser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r--sax/source/fastparser/fastparser.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 9b35c1682be5..55e1a345f331 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -889,15 +889,15 @@ void FastSaxParserImpl::setTokenHandler( const Reference< XFastTokenHandler >& x
void FastSaxParserImpl::registerNamespace( const OUString& NamespaceURL, sal_Int32 NamespaceToken )
{
- if( NamespaceToken >= FastToken::NAMESPACE )
+ if( NamespaceToken < FastToken::NAMESPACE )
+ throw IllegalArgumentException("Invalid namespace token " + OUString::number(NamespaceToken), css::uno::Reference<css::uno::XInterface >(), 0);
+
+ if( GetNamespaceToken( NamespaceURL ) == FastToken::DONTKNOW )
{
- if( GetNamespaceToken( NamespaceURL ) == FastToken::DONTKNOW )
- {
- maNamespaceMap[ NamespaceURL ] = NamespaceToken;
- return;
- }
+ maNamespaceMap[ NamespaceURL ] = NamespaceToken;
+ return;
}
- throw IllegalArgumentException();
+ throw IllegalArgumentException("namespace URL is already registered: " + NamespaceURL, css::uno::Reference<css::uno::XInterface >(), 0);
}
OUString const & FastSaxParserImpl::getNamespaceURL( const OUString& rPrefix )