From 3cfecf8427c529c7c1d32be2b361934b63fa6933 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Mar 2013 09:16:19 +0200 Subject: fdo#46808, Convert beans::PropertyBag to new style Change-Id: Ibb2466af4c9289cba93b8330d10db033d296bfc1 --- dbaccess/source/core/dataaccess/ModelImpl.cxx | 13 +++++-------- dbaccess/source/core/dataaccess/ModelImpl.hxx | 4 ++-- dbaccess/source/core/dataaccess/datasource.cxx | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 882f7863da7c..95af6b73e65b 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -30,17 +30,18 @@ #include "userinformation.hxx" #include "sdbcoretools.hxx" +#include #include #include -#include #include #include #include +#include +#include +#include #include #include #include -#include -#include #include #include @@ -488,11 +489,7 @@ void ODatabaseModelImpl::impl_construct_nothrow() *pAllowedType++ = ::getCppuType( static_cast< sal_Int16* >( NULL ) ); *pAllowedType++ = ::getCppuType( static_cast< Sequence< Any >* >( NULL ) ); - Sequence< Any > aInitArgs( 2 ); - aInitArgs[0] <<= NamedValue("AutomaticAddition", makeAny( (sal_Bool)sal_True )); - aInitArgs[1] <<= NamedValue("AllowedTypes", makeAny( aAllowedTypes )); - - m_xSettings.set( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.beans.PropertyBag", aInitArgs, m_aContext), UNO_QUERY_THROW ); + m_xSettings = PropertyBag::createWithTypes( m_aContext, aAllowedTypes, sal_False/*AllowEmptyPropertyName*/, sal_True/*AutomaticAddition*/ ); // insert the default settings Reference< XPropertyContainer > xContainer( m_xSettings, UNO_QUERY_THROW ); diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index 49f6a10efdc6..fa595648336c 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -245,7 +245,7 @@ public: sal_Bool m_bSuppressVersionColumns : 1; sal_Bool m_bModified : 1; sal_Bool m_bDocumentReadOnly : 1; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyAccess > + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyBag > m_xSettings; ::com::sun::star::uno::Sequence< OUString > m_aTableFilter; ::com::sun::star::uno::Sequence< OUString > m_aTableTypeFilter; diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 9e9d4fee411d..2b3147b82120 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -880,7 +880,7 @@ namespace @param _rAllNewPropertyValues the new property values to set for the bag */ - void lcl_setPropertyValues_resetOrRemoveOther( const Reference< XPropertyAccess >& _rxPropertyBag, const Sequence< PropertyValue >& _rAllNewPropertyValues ) + void lcl_setPropertyValues_resetOrRemoveOther( const Reference< XPropertyBag >& _rxPropertyBag, const Sequence< PropertyValue >& _rAllNewPropertyValues ) { // sequences are ugly to operate on typedef ::std::set< OUString > StringSet; -- cgit