diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-20 09:16:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-08 13:53:02 +0200 |
commit | 3cfecf8427c529c7c1d32be2b361934b63fa6933 (patch) | |
tree | 0eed4fbb77434a558dd48234a95b099a9ada534b /sfx2 | |
parent | 002aab309055b7feeeeeb25c1835b6abe6646729 (diff) |
fdo#46808, Convert beans::PropertyBag to new style
Change-Id: Ibb2466af4c9289cba93b8330d10db033d296bfc1
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 26 |
1 files changed, 3 insertions, 23 deletions
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 <cppuhelper/implbase1.hxx> #include <com/sun/star/document/XCompatWriterDocProperties.hpp> +#include <com/sun/star/beans/PropertyBag.hpp> /** * 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<css::lang::XMultiComponentFactory> 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<sal_Int64>::get(); // Time is supported for backward compatibility with OOo 3.x, x<=2 types[10] = ::cppu::UnoType<css::util::Time>::get(); - css::uno::Sequence<css::uno::Any> 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<css::lang::XMultiComponentFactory> 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<css::lang::XInitialization> xInit( - m_xUserDefined, css::uno::UNO_QUERY); - if (xInit.is()) { - xInit->initialize(args); - } const css::uno::Reference<css::util::XModifyBroadcaster> xMB( m_xUserDefined, css::uno::UNO_QUERY); |