summaryrefslogtreecommitdiff
path: root/cppuhelper/source/propertysetmixin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppuhelper/source/propertysetmixin.cxx')
-rw-r--r--cppuhelper/source/propertysetmixin.cxx106
1 files changed, 60 insertions, 46 deletions
diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx
index 8469f1a7c51d..88e104d90453 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -66,6 +66,7 @@
#include <com/sun/star/uno/TypeClass.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
+#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/propertysetmixin.hxx>
#include <cppuhelper/weak.hxx>
@@ -436,9 +437,11 @@ PropertySetMixinImpl::Impl::Impl(
m_type.getTypeName()),
css::uno::UNO_QUERY_THROW);
} catch (css::container::NoSuchElementException & e) {
- throw css::uno::RuntimeException(
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
"unexpected com.sun.star.container.NoSuchElementException: "
- + e.Message);
+ + e.Message,
+ nullptr, anyEx );
}
std::vector< rtl::OUString > handleNames;
initProperties(ifc, m_absentOptional, &handleNames);
@@ -509,10 +512,11 @@ void PropertySetMixinImpl::Impl::setProperty(
throw css::lang::IllegalArgumentException(
e.Message, object, illegalArgumentPosition);
} else {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
}
} catch (css::lang::IllegalAccessException &) {
//TODO Clarify whether PropertyVetoException is the correct exception
@@ -564,10 +568,11 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
try {
value = field->get(object->queryInterface(m_type));
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
} catch (css::lang::WrappedTargetRuntimeException & e) {
//FIXME A WrappedTargetRuntimeException from XIdlField2.get is not
// guaranteed to originate directly within XIdlField2.get (and thus have
@@ -621,10 +626,11 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
ambiguous->getField("Value"), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
}
undoAmbiguous = false;
} else if (undoDefaulted
@@ -649,10 +655,11 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
defaulted->getField("Value"), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
}
undoDefaulted = false;
} else if (undoOptional
@@ -681,10 +688,11 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
optional->getField("Value"), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
}
undoOptional = false;
} else {
@@ -738,15 +746,17 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
type->getField("IsAmbiguous"), css::uno::UNO_QUERY_THROW)->set(
strct, css::uno::Any(isAmbiguous));
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
} catch (css::lang::IllegalAccessException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalAccessException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalAccessException: "
+ + e.Message,
+ object, anyEx );
}
return strct;
}
@@ -767,15 +777,17 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
type->getField("IsDefaulted"), css::uno::UNO_QUERY_THROW)->set(
strct, css::uno::Any(isDefaulted));
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
} catch (css::lang::IllegalAccessException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalAccessException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalAccessException: "
+ + e.Message,
+ object, anyEx );
}
return strct;
}
@@ -799,15 +811,17 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
isAmbiguous, wrapDefaulted, isDefaulted, false));
}
} catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalArgumentException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalArgumentException: "
+ + e.Message,
+ object, anyEx );
} catch (css::lang::IllegalAccessException & e) {
- throw css::uno::RuntimeException(
- ("unexpected com.sun.star.lang.IllegalAccessException: "
- + e.Message),
- object);
+ css::uno::Any anyEx = cppu::getCaughtException();
+ throw css::lang::WrappedTargetRuntimeException(
+ "unexpected com.sun.star.lang.IllegalAccessException: "
+ + e.Message,
+ object, anyEx );
}
return strct;
}