diff options
author | sb <sb@openoffice.org> | 2009-10-01 13:40:46 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2009-10-01 13:40:46 +0200 |
commit | e573925559daab2f374c9b485290e28751978b52 (patch) | |
tree | 5e5ca0588d2f819336683f02b822be5949c10885 /configmgr2 | |
parent | 3ffb5481b5e116c4a39dd07335439e711f0ca706 (diff) |
#i101955# changed platform backend interface once again, from XNameAccess to XPropertySet
Diffstat (limited to 'configmgr2')
-rw-r--r-- | configmgr2/source/xcuparser.cxx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/configmgr2/source/xcuparser.cxx b/configmgr2/source/xcuparser.cxx index ad0d5283d9c5..81b48572da8c 100644 --- a/configmgr2/source/xcuparser.cxx +++ b/configmgr2/source/xcuparser.cxx @@ -32,15 +32,15 @@ #include <algorithm> -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/UnknownPropertyException.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" -#include "com/sun/star/uno/Type.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XInterface.hpp" #include "osl/diagnose.h" @@ -454,12 +454,20 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { e.Message, RTL_TEXTENCODING_UTF8).getStr()); } if (service.is()) { - css::uno::Any value; + css::beans::Optional< css::uno::Any > value; try { - value = css::uno::Reference< css::container::XNameAccess >( - service, css::uno::UNO_QUERY_THROW)-> - getByName(external.copy(i + 1)); - } catch (css::container::NoSuchElementException & e) { + if (!((css::uno::Reference< css::beans::XPropertySet >( + service, css::uno::UNO_QUERY_THROW)-> + getPropertyValue(external.copy(i + 1))) >>= + value)) + { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "cannot obtain oor:external value")), + css::uno::Reference< css::uno::XInterface >()); + } + } catch (css::beans::UnknownPropertyException & e) { throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -474,12 +482,9 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { e.Message), css::uno::Reference< css::uno::XInterface >()); } - css::uno::Type t; - if (!(value >>= t) || - t != cppu::UnoType< cppu::UnoVoidType >::get()) - { + if (value.IsPresent) { //TODO: check value type - prop->setValue(valueParser_.getLayer(), value); + prop->setValue(valueParser_.getLayer(), value.Value); } } state_.push(State()); |