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 --- sfx2/source/doc/SfxDocumentMetaData.cxx | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 7387baba5255..e4a03d0be849 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -80,6 +80,7 @@ #include #include +#include /** * This file contains the implementation of the service @@ -641,12 +642,7 @@ css::uno::Reference< css::beans::XPropertySet > SAL_CALL SfxDocumentMetaData::getURLProperties( const css::uno::Sequence< css::beans::PropertyValue > & i_rMedium) const { - css::uno::Reference xMsf ( - m_xContext->getServiceManager()); - css::uno::Reference< css::beans::XPropertyContainer> xPropArg( - xMsf->createInstanceWithContext(OUString( - "com.sun.star.beans.PropertyBag"), m_xContext), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::beans::XPropertyBag> xPropArg = css::beans::PropertyBag::createDefault( m_xContext ); try { OUString dburl("DocumentBaseURL"); OUString hdn("HierarchicalDocumentName"); @@ -2287,26 +2283,10 @@ void SfxDocumentMetaData::createUserDefined() types[9] = ::cppu::UnoType::get(); // Time is supported for backward compatibility with OOo 3.x, x<=2 types[10] = ::cppu::UnoType::get(); - css::uno::Sequence args(2); - args[0] <<= css::beans::NamedValue( - OUString("AllowedTypes"), - css::uno::makeAny(types)); // #i94175#: ODF allows empty user-defined property names! - args[1] <<= css::beans::NamedValue( OUString( - "AllowEmptyPropertyName"), - css::uno::makeAny(sal_True)); - - const css::uno::Reference xMsf( - m_xContext->getServiceManager()); m_xUserDefined.set( - xMsf->createInstanceWithContext( - OUString("com.sun.star.beans.PropertyBag"), m_xContext), + css::beans::PropertyBag::createWithTypes( m_xContext, types, sal_True/*AllowEmptyPropertyName*/, sal_False/*AutomaticAddition*/ ), css::uno::UNO_QUERY_THROW); - const css::uno::Reference xInit( - m_xUserDefined, css::uno::UNO_QUERY); - if (xInit.is()) { - xInit->initialize(args); - } const css::uno::Reference xMB( m_xUserDefined, css::uno::UNO_QUERY); -- cgit v1.2.3