[Libreoffice-commits] core.git: comphelper/source cppuhelper/source include/cppuhelper

Stephan Bergmann sbergman at redhat.com
Fri Jan 16 01:20:28 PST 2015


 comphelper/source/property/propstate.cxx |   15 ++++++---------
 cppuhelper/source/propshlp.cxx           |   10 ++++------
 include/cppuhelper/propshlp.hxx          |    6 +++++-
 3 files changed, 15 insertions(+), 16 deletions(-)

New commits:
commit d3ce5b298e3f5cc58256ba80f5d3f361618c4820
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 16 10:19:36 2015 +0100

    Fix getTypes() of OPropertySetHelper and derived
    
    ...broken with 60d60caf99a40ca0c3891bf230c5a1fdbae5f49c "Renamed XPropertySet2
    to XPropertySetOption" et al
    
    Change-Id: I684736ffafc4642548b7c24171cc52c1acb32252

diff --git a/comphelper/source/property/propstate.cxx b/comphelper/source/property/propstate.cxx
index d8f53b5..8f6b907 100644
--- a/comphelper/source/property/propstate.cxx
+++ b/comphelper/source/property/propstate.cxx
@@ -55,15 +55,12 @@ namespace comphelper
 
     css::uno::Sequence<css::uno::Type> OPropertyStateHelper::getTypes()
     {
-        ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aTypes(4);
-        ::com::sun::star::uno::Type* pTypes = aTypes.getArray();
-        // base class types
-        pTypes[0] = cppu::UnoType<com::sun::star::beans::XPropertySet>::get();
-        pTypes[1] = cppu::UnoType<com::sun::star::beans::XMultiPropertySet>::get();
-        pTypes[2] = cppu::UnoType<com::sun::star::beans::XFastPropertySet>::get();
-        // my own type
-        pTypes[3] = cppu::UnoType<com::sun::star::beans::XPropertyState>::get();
-        return aTypes;
+        return css::uno::Sequence<css::uno::Type>({
+            cppu::UnoType<css::beans::XPropertySet>::get(),
+            cppu::UnoType<css::beans::XMultiPropertySet>::get(),
+            cppu::UnoType<css::beans::XFastPropertySet>::get(),
+            cppu::UnoType<css::beans::XPropertySetOption>::get(),
+            cppu::UnoType<css::beans::XPropertyState>::get()});
     }
 
     OPropertyStateHelper::OPropertyStateHelper(
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index d19e656..509019c 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -231,12 +231,10 @@ Any OPropertySetHelper2::queryInterface( const ::com::sun::star::uno::Type & rTy
 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > OPropertySetHelper::getTypes()
     throw (RuntimeException)
 {
-    Sequence< ::com::sun::star::uno::Type > aTypes( 4 );
-    aTypes[ 0 ] = XPropertySet::static_type();
-    aTypes[ 1 ] = XPropertySetOption::static_type();
-    aTypes[ 2 ] = XMultiPropertySet::static_type();
-    aTypes[ 3 ] = XFastPropertySet::static_type();
-    return aTypes;
+    return css::uno::Sequence<css::uno::Type>({
+        UnoType<css::beans::XPropertySet>::get(),
+        UnoType<css::beans::XMultiPropertySet>::get(),
+        UnoType<css::beans::XFastPropertySet>::get()});
 }
 
 // ComponentHelper
diff --git a/include/cppuhelper/propshlp.hxx b/include/cppuhelper/propshlp.hxx
index ec769e3..8cf0159 100644
--- a/include/cppuhelper/propshlp.hxx
+++ b/include/cppuhelper/propshlp.hxx
@@ -686,7 +686,11 @@ protected:
 
 /**
    OPropertySetHelper plus XPropertySetOption
- */
+
+   @attention
+   The getTypes() inherited from OPropertysetHelper does not cover
+   XPropertySetOption.
+*/
 class CPPUHELPER_DLLPUBLIC OPropertySetHelper2 : public OPropertySetHelper,
                             public ::com::sun::star::beans::XPropertySetOption
 {


More information about the Libreoffice-commits mailing list