summaryrefslogtreecommitdiff
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
parentf789715a414bd1115401f93d11f09260f891956c (diff)
fdo#46808, Adapt document::DocumentProperties UNO service to new style
Change-Id: I19015d3e3e9aa6e4b3b4bb011183c73ab00365ca
-rw-r--r--chart2/source/model/main/ChartModel.cxx6
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx6
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx7
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx4
-rw-r--r--sfx2/source/doc/objuno.cxx10
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
-rw-r--r--svtools/source/contnr/templwin.cxx6
7 files changed, 17 insertions, 28 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 5d20b5285209..01f2776273c3 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
// header for class SvNumberFormatter
#include <svl/zforlist.hxx>
@@ -695,10 +696,7 @@ uno::Reference< document::XDocumentProperties > SAL_CALL
::osl::MutexGuard aGuard( m_aModelMutex );
if ( !m_xDocumentProperties.is() )
{
- uno::Reference< document::XDocumentProperties > xDocProps(
- ::comphelper::getProcessServiceFactory()->createInstance(
- C2U("com.sun.star.document.DocumentProperties") ), uno::UNO_QUERY );
- m_xDocumentProperties.set(xDocProps);
+ m_xDocumentProperties.set( document::DocumentProperties::create( ::comphelper::getProcessComponentContext() ) );
}
return m_xDocumentProperties;
}
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index bd83538ae270..286650f5c8a8 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <svtools/htmlkywd.hxx>
#include <svtools/rtfkeywd.hxx>
#include <tools/color.hxx>
@@ -730,9 +730,7 @@ void OHTMLImportExport::WriteHeader()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::WriteHeader" );
uno::Reference<document::XDocumentProperties> xDocProps(
- m_xFactory->createInstance(::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentProperties"))),
- uno::UNO_QUERY);
+ document::DocumentProperties::create( comphelper::ComponentContext(m_xFactory).getUNOContext() ) );
if (xDocProps.is()) {
xDocProps->setTitle(m_sName);
}
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index e67d75c18caa..41adfc60c476 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/document/EventObject.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XExporter.hpp>
@@ -2845,11 +2846,7 @@ uno::Reference< document::XDocumentProperties > SAL_CALL OReportDefinition::getD
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
if ( !m_pImpl->m_xDocumentProperties.is() )
{
- uno::Reference< lang::XInitialization > xDocProps(
- m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.DocumentProperties")) ,m_aProps->m_xContext),
- uno::UNO_QUERY_THROW);
- m_pImpl->m_xDocumentProperties.set(xDocProps, uno::UNO_QUERY_THROW);
+ m_pImpl->m_xDocumentProperties.set(document::DocumentProperties::create(m_aProps->m_xContext));
}
return m_pImpl->m_xDocumentProperties;
}
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);
}
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index 301967a7d1a5..5266ab941d54 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -62,7 +62,7 @@
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/view/XPrintable.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -621,9 +621,7 @@ SvtFrameWindow_Impl::SvtFrameWindow_Impl( Window* pParent ) :
xFrame->initialize( xWindow );
// create docinfo instance
- m_xDocProps.set( ::comphelper::getProcessServiceFactory()->createInstance(
- ASCII_STR("com.sun.star.document.DocumentProperties") ),
- UNO_QUERY );
+ m_xDocProps.set( document::DocumentProperties::create(::comphelper::getProcessComponentContext()) );
pEmptyWin = new Window( this, WB_BORDER | WB_3DLOOK );
}