diff options
author | Henning Brinkmann <hbrinkm@openoffice.org> | 2002-11-19 12:03:15 +0000 |
---|---|---|
committer | Henning Brinkmann <hbrinkm@openoffice.org> | 2002-11-19 12:03:15 +0000 |
commit | 58328aafe8601fc0c9f1ea829780c9652009e76c (patch) | |
tree | 8367f2dca352c99b07e7ac723829892a280203af | |
parent | 51de6de0214698da5f0cd98cd10bfcb29effde3d (diff) |
#99838# catch IllegalArgumentException in XMLEventsImportContext::AddEventValues
-rw-r--r-- | xmloff/source/script/XMLEventsImportContext.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/xmloff/source/script/XMLEventsImportContext.cxx b/xmloff/source/script/XMLEventsImportContext.cxx index e5e6e59887aa..050461c745aa 100644 --- a/xmloff/source/script/XMLEventsImportContext.cxx +++ b/xmloff/source/script/XMLEventsImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEventsImportContext.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-08-02 18:51:34 $ + * last change: $Author: hbrinkm $ $Date: 2002-11-19 13:03:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,6 +91,10 @@ #include "xmltoken.hxx" #endif +#ifndef _XMLOFF_XMLERROR_HXX +#include "xmlerror.hxx" +#endif // _XMLOFF_XMLERROR_HXX + using namespace ::com::sun::star::uno; using namespace ::xmloff::token; @@ -99,7 +103,7 @@ using ::com::sun::star::xml::sax::XAttributeList; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::container::XNameReplace; using ::com::sun::star::document::XEventsSupplier; - +using ::com::sun::star::lang::IllegalArgumentException; TYPEINIT1(XMLEventsImportContext, SvXMLImportContext); @@ -268,7 +272,20 @@ void XMLEventsImportContext::AddEventValues( { Any aAny; aAny <<= rValues; - xEvents->replaceByName(rEventName, aAny); + + try + { + xEvents->replaceByName(rEventName, aAny); + } catch ( const IllegalArgumentException & rException ) + { + Sequence<OUString> aMsgParams(1); + + aMsgParams[0] = rEventName; + + GetImport().SetError(XMLERROR_FLAG_ERROR | + XMLERROR_ILLEGAL_EVENT, + aMsgParams, rException.Message, 0); + } } } else |