summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-23 15:49:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-08-27 15:40:07 +0200
commit170cfbc62549e4a74077c4ec403baf35ec4d42f6 (patch)
tree1c5f1ab911f3a899bd008ed0ba8fb3d0253269fa /sfx2
parentf789715a414bd1115401f93d11f09260f891956c (diff)
fdo#46808, Adapt document::DocumentProperties UNO service to new style
Change-Id: I19015d3e3e9aa6e4b3b4bb011183c73ab00365ca
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx4
-rw-r--r--sfx2/source/doc/objuno.cxx10
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
3 files changed, 9 insertions, 11 deletions
diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx
index b12d3b334e9d..2a77bde0336c 100644
--- a/sfx2/source/dialog/templateinfodlg.cxx
+++ b/sfx2/source/dialog/templateinfodlg.cxx
@@ -15,7 +15,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -83,7 +83,7 @@ void SfxTemplateInfoDlg::loadDocument(const OUString &rURL)
aProps[0].Value <<= xInteractionHandler;
uno::Reference<document::XDocumentProperties> xDocProps(
- xContext->createInstance("com.sun.star.document.DocumentProperties"), uno::UNO_QUERY );
+ document::DocumentProperties::create(comphelper::getProcessComponentContext()) );
xDocProps->loadFromMedium( rURL, aProps );
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx
index d3ee6af367a3..dfa05ee04e19 100644
--- a/sfx2/source/doc/objuno.cxx
+++ b/sfx2/source/doc/objuno.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/document/XCompatWriterDocProperties.hpp>
#include <unotools/configmgr.hxx>
@@ -46,6 +46,7 @@
#include <tools/errcode.hxx>
#include <svl/cntwids.hrc>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/string.hxx>
#include <comphelper/sequenceasvector.hxx>
#include <comphelper/storagehelper.hxx>
@@ -1182,8 +1183,8 @@ SfxStandaloneDocumentInfoObject::SfxStandaloneDocumentInfoObject( const ::com::s
, _xFactory( xFactory )
{
uno::Reference< lang::XInitialization > xDocProps(
- _xFactory->createInstance( ::rtl::OUString(
- "com.sun.star.document.DocumentProperties")), uno::UNO_QUERY_THROW);
+ document::DocumentProperties::create(comphelper::ComponentContext(_xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW);
uno::Any a;
a <<= xDocProps;
uno::Sequence<uno::Any> args(1);
@@ -1261,8 +1262,7 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin
::osl::ClearableMutexGuard aGuard( _pImp->_aMutex );
uno::Reference< document::XDocumentProperties > xDocProps(
- _xFactory->createInstance( ::rtl::OUString(
- "com.sun.star.document.DocumentProperties")), uno::UNO_QUERY_THROW);
+ document::DocumentProperties::create(comphelper::ComponentContext(_xFactory).getUNOContext()) );
_pImp->Reset(xDocProps);
aGuard.clear();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 3e7479c4751a..75bf08b627c1 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -43,7 +43,7 @@
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/Aspects.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <comphelper/enumhelper.hxx> // can be removed when this is a "real" service
@@ -921,9 +921,7 @@ SfxBaseModel::getDocumentProperties()
if ( !m_pData->m_xDocumentProperties.is() )
{
uno::Reference< document::XDocumentProperties > xDocProps(
- ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.document.DocumentProperties") ),
- uno::UNO_QUERY_THROW);
+ document::DocumentProperties::create( ::comphelper::getProcessComponentContext() ) );
m_pData->impl_setDocumentProperties(xDocProps);
}