[Libreoffice-commits] core.git: comphelper/source framework/source include/comphelper sw/source
Stephan Bergmann
sbergman at redhat.com
Wed Nov 19 09:18:31 PST 2014
comphelper/source/misc/sequenceashashmap.cxx | 23 +++++++++++++++--------
framework/source/inc/loadenv/loadenv.hxx | 1 +
include/comphelper/sequenceashashmap.hxx | 5 ++---
sw/source/core/unocore/unodraw.cxx | 11 +----------
4 files changed, 19 insertions(+), 21 deletions(-)
New commits:
commit fced31697bcc2a2a4da34d804582002de0320302
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Nov 19 18:16:18 2014 +0100
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
diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx
index 35f2d6b..46df283 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);
}
}
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index ae598df..3ac1465 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -22,6 +22,7 @@
#include <loadenv/loadenvexception.hxx>
#include <loadenv/actionlockguard.hxx>
+#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
diff --git a/include/comphelper/sequenceashashmap.hxx b/include/comphelper/sequenceashashmap.hxx
index 38cf734..7d9cdfd 100644
--- a/include/comphelper/sequenceashashmap.hxx
+++ b/include/comphelper/sequenceashashmap.hxx
@@ -27,7 +27,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <comphelper/comphelperdllapi.h>
@@ -99,7 +98,7 @@ class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase
@param aSource
contains the new items for this map.
- @throw An com::sun::star::beans::IllegalTypeException
+ @throw An com::sun::star::lang::IllegalArgumentException
is thrown, if the given any does not contain a suitable sequence ...
but not if it's a VOID Any!
*/
@@ -114,7 +113,7 @@ class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase
@param lSource
contains the new items for this map.
- @throw An com::sun::star::beans::IllegalTypeException
+ @throw An com::sun::star::lang::IllegalArgumentException
is thrown, if the given any sequence
uses wrong types for its items. VOID Any will be ignored!
*/
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 0102e79..d8b4632 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -58,10 +58,8 @@
#include <crstate.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/makesequence.hxx>
-#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <svx/scene3d.hxx>
-#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <fmtwrapinfluenceonobjpos.hxx>
#include <com/sun/star/text/TextContentAnchorType.hpp>
@@ -1483,14 +1481,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
if (pFmt)
{
// We have a pFmt (but no pEntry): try to sync TextBox property.
- try {
- SwTextBoxHelper::syncProperty(pFmt, rPropertyName, aValue);
- } catch (css::beans::IllegalTypeException & e) {
- css::uno::Any a(cppu::getCaughtException());
- throw css::lang::WrappedTargetException(
- "wrapped IllegalTypeException " + e.Message,
- css::uno::Reference<css::uno::XInterface>(), a);
- }
+ SwTextBoxHelper::syncProperty(pFmt, rPropertyName, aValue);
}
// #i31698# - restore object position, if caption point is set.
More information about the Libreoffice-commits
mailing list