diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 18:16:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 18:18:06 +0100 |
commit | fced31697bcc2a2a4da34d804582002de0320302 (patch) | |
tree | a8db100cf5c2202214db2d1ba79022e900f652fb /comphelper | |
parent | 49329e371c0a5f1fe7e605841109cab02e053b1a (diff) |
comphelper::SequenceAsHashMap: throw IllegalArgumentException
...instead of IllegalTypeException (where the latter is not a RuntimeException).
Fixes cid#707218, cid#1224993, etc., and reverts previous fix
358f5280e0f6afb968edc295d8f1dce55f05e18f "Fix coverity#1224993 w/o breaking
JunitTest_framework_unoapi."
Change-Id: I13ce153e1513749fb0be2ee8e560cec86a30c5ba
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/sequenceashashmap.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index 35f2d6bf118a..46df283f3278 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <com/sun/star/lang/IllegalArgumentException.hpp> #include <comphelper/sequenceashashmap.hxx> @@ -75,8 +78,9 @@ void SequenceAsHashMap::operator<<(const css::uno::Any& aSource) return; } - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw css::lang::IllegalArgumentException( + "Any contains wrong type.", css::uno::Reference<css::uno::XInterface>(), + -1); } @@ -94,8 +98,9 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lP.Name.isEmpty()) || (!lP.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "PropertyValue struct contains no useful information." ); + throw css::lang::IllegalArgumentException( + "PropertyValue struct contains no useful information.", + css::uno::Reference<css::uno::XInterface>(), -1); (*this)[lP.Name] = lP.Value; continue; } @@ -107,16 +112,18 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lN.Name.isEmpty()) || (!lN.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "NamedValue struct contains no useful information." ); + throw css::lang::IllegalArgumentException( + "NamedValue struct contains no useful information.", + css::uno::Reference<css::uno::XInterface>(), -1); (*this)[lN.Name] = lN.Value; continue; } // ignore VOID Any ... but reject wrong filled ones! if (lSource[i].hasValue()) - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw css::lang::IllegalArgumentException( + "Any contains wrong type.", + css::uno::Reference<css::uno::XInterface>(), -1); } } |