User: rt      
Date: 2007-07-24 12:05:46+0000
Modified:
   dba/dbaccess/source/core/misc/propertybag.hxx

Log:
 INTEGRATION: CWS dba23b (1.4.88); FILE MERGED
 2007/07/11 20:51:26 fs 1.4.88.3: #i10000#
 2007/07/07 20:22:45 fs 1.4.88.2: #i78593# overload getPropertyStateByHandle, 
to respect the MAYBEDEFAULT attribute (especially when it's *not* set)
 2007/07/07 19:20:32 fs 1.4.88.1: in preparation of #i78593#: refactor so that 
comphelper/propertybag is used

File Changes:

Directory: /dba/dbaccess/source/core/misc/
==========================================

File [changed]: propertybag.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/propertybag.hxx?r1=1.4&r2=1.5
Delta lines:  +20 -57
---------------------
--- propertybag.hxx     2006-10-24 15:14:49+0000        1.4
+++ propertybag.hxx     2007-07-24 12:05:43+0000        1.5
@@ -57,18 +57,11 @@
 #endif
 /** === end UNO includes === **/
 
-#ifndef _CPPUHELPER_IMPLBASE4_HXX_
 #include <cppuhelper/implbase4.hxx>
-#endif
-#ifndef COMPHELPER_PROPERTYSTATECONTAINER_HXX
-#include <comphelper/propertystatecontainer.hxx>
-#endif
-#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/propstate.hxx>
 #include <comphelper/broadcasthelper.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/propertybag.hxx>
 #include <comphelper/uno3.hxx>
-#endif
 
 #include <map>
 #include <set>
@@ -99,17 +92,15 @@
     //====================================================================
        //= OPropertyBag
        //====================================================================
-
-    typedef ::comphelper::OMutexAndBroadcastHelper  OPropertyBag_BBase;
     typedef ::cppu::WeakAggImplHelper4  <   
::com::sun::star::beans::XPropertyContainer
                                         ,   
::com::sun::star::beans::XPropertyAccess
                                         ,   
::com::sun::star::lang::XServiceInfo
                                         ,   
::com::sun::star::lang::XInitialization
                                         >   OPropertyBag_Base;
-    typedef ::comphelper::OPropertyStateContainer   OPropertyBag_CBase;
+    typedef ::comphelper::OPropertyStateHelper  OPropertyBag_PBase;
 
-    class OPropertyBag  :public OPropertyBag_BBase  // must be before 
OPropertyBag_CBase
-                        ,public OPropertyBag_CBase
+    class OPropertyBag  :public ::comphelper::OMutexAndBroadcastHelper  // 
must be before OPropertyBag_PBase
+                        ,public OPropertyBag_PBase
                         ,public OPropertyBag_Base
        {
     private:
@@ -119,10 +110,8 @@
         /// our IPropertyArrayHelper implementation
         ::std::auto_ptr< ::cppu::OPropertyArrayHelper >
                         m_pArrayHelper;
-        /// flag denoting whether <member>m_pArrayHelper</member> must be 
re-created before accessing it next time
-        bool            m_bArrayHelperDirty;
-        /// the default values for our registered properties
-        MapInt2Any      m_aDefaultValues;
+        ::comphelper::PropertyBag
+                        m_aDynamicProperties;
         /// set of allowed property types
         TypeBag         m_aAllowedTypes;
         /// should we automatically add properties which are tried to set, if 
they don't exist previously?
@@ -163,10 +152,16 @@
         virtual ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) 
throw(::com::sun::star::uno::RuntimeException);
         /** === UNO interface implementations == **/
 
-        // XPropertyState (OPropertyStateContainer)
-               virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, 
::com::sun::star::uno::Any& _rDefault ) const;
+        // XPropertyState
+           virtual ::com::sun::star::uno::Any  getPropertyDefaultByHandle( 
sal_Int32 _nHandle ) const;
+
+        // OPropertyStateHelper
+        virtual ::com::sun::star::beans::PropertyState  
getPropertyStateByHandle( sal_Int32 _nHandle );
 
         // OPropertySetHelper
+           virtual void SAL_CALL getFastPropertyValue( 
::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+        virtual sal_Bool SAL_CALL convertFastPropertyValue( 
::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & 
rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw 
(::com::sun::star::lang::IllegalArgumentException);
+        virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 
nHandle, const ::com::sun::star::uno::Any& rValue ) throw 
(::com::sun::star::uno::Exception);
         virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
 
     private:
@@ -179,11 +174,6 @@
         /** implements the setPropertyValues method
             @param _rProps
                 the property values to set
-            @param _bTolerateUnknownProperties 
-                determines whether UnknownPropertyExceptions should be 
tolerated. If <TRUE/>, and
-                an UnknownPropertyException occurs, the method tries to add 
all properties which
-                currently are not added. After this, it tries to set all given 
property values,
-                again.
 
             @throws PropertyVetoException
                 if the XMultiPropertySet::setPropertyValues call does so
@@ -205,43 +195,16 @@
                 if the XMultiPropertySet::setPropertyValues call did throw an 
exception not listed
                 above
         */
-        void implSetPropertyValues( const ::com::sun::star::uno::Sequence< 
::com::sun::star::beans::PropertyValue >& _rProps, bool 
_bTolerateUnknownProperties );
-
-        /** ensures that the property bag contains a property with the given 
name, and the given
-            initial/default value
-
-            If a property with the given name already exists in the bag, 
nothing happens.
-
-            If the property does not yet exist, it is automatically added, 
with the
-            PropertyAttribute::BOUND, PropertyAttribute::REMOVEABLE and 
PropertyAttribute::MAYBEDEFAULT
-            attributes.
-
-            @return
-                <TRUE/> if the property was successfully added, <FALSE/> 
otherwise. Failure conditions are
-                <ul><li><arg>_rValue</arg> is <NULL/>. In this case, the 
property is not added, since
-                    no type for it can be determined.</li>
-                </ul>
-
-            @throws ::com::sun::star::lang::WrappedTargetException
-                if the <member>addPropertyWithType</member> call does throw an
-                ::com::sun::star::beans::IllegalTypeException
-            @throws ::com::sun::star::lang::IllegalArgumentException
-                if the <member>addPropertyWithType</member> call does so
-            @throws ::com::sun::star::uno::RuntimeException
-                if the <member>addPropertyWithType</member> call does so
-        */
-        bool implEnsureContainsProperty(
-            const ::rtl::OUString& _rName,
-            const ::com::sun::star::uno::Any& _rValue
-        );
+        void impl_setPropertyValues_throw( const 
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& 
_rProps );
 
     private:
         OPropertyBag();                                 // never implemented
         OPropertyBag( const OPropertyBag& );            // never implemented
         OPropertyBag& operator=( const OPropertyBag& ); // never implemented
-
-        using OPropertyStateContainer::getPropertyValues;
-        using OPropertyStateContainer::setPropertyValues;
+    protected:
+        using ::cppu::OPropertySetHelper::getPropertyValues;
+        using ::cppu::OPropertySetHelper::setPropertyValues;
+        using ::cppu::OPropertySetHelper::getFastPropertyValue;
     };
 
 //........................................................................




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to