diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-29 17:20:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-29 18:18:28 +0200 |
commit | c2ca6fabd1afc3fc07001721c2069d3c8db7000a (patch) | |
tree | 350741d6d19564bcaf00506bd7d22b4c644e0fdc /sw | |
parent | f05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff) |
Use comphelper::getComponentContext
...and some further clean up.
Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8toolbar.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/config/mailconfigpage.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dbui/mailmergehelper.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/inc/mailmergehelper.hxx | 20 |
4 files changed, 12 insertions, 33 deletions
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index ff1ae4971bf4..48910c0bead1 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -370,8 +370,8 @@ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper& } uno::Reference< lang::XSingleComponentFactory > xSCF( xIndexContainer, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< uno::XComponentContext > xContext( xProps->getPropertyValue( "DefaultContext" ), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext( + comphelper::getProcessComponentContext() ); // create the popup menu uno::Sequence< beans::PropertyValue > aPopupMenu( 4 ); aPopupMenu[0].Name = "CommandURL"; diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index da6591eea945..430312c0883e 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -339,8 +339,9 @@ void SwTestAccountSettingsDialog::Test() try { uno::Reference< mail::XMailService > xInMailService; - uno::Reference< mail::XMailServiceProvider > xMailServiceProvider = - mail::MailServiceProvider::create(getCurrentCmpCtx(rMgr)); + uno::Reference< mail::XMailServiceProvider > xMailServiceProvider( + mail::MailServiceProvider::create( + comphelper::getComponentContext(rMgr))); uno::Reference< mail::XMailService > xMailService = xMailServiceProvider->create( mail::MailServiceType_SMTP); diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx index 9f756c267c69..91fd9fcdced8 100644 --- a/sw/source/ui/dbui/mailmergehelper.cxx +++ b/sw/source/ui/dbui/mailmergehelper.cxx @@ -110,8 +110,9 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( if (rMgr.is()) try { - uno::Reference< mail::XMailServiceProvider > xMailServiceProvider = - mail::MailServiceProvider::create(getCurrentCmpCtx(rMgr)); + uno::Reference< mail::XMailServiceProvider > xMailServiceProvider( + mail::MailServiceProvider::create( + comphelper::getComponentContext(rMgr))); xSmtpServer = uno::Reference< mail::XSmtpService > ( xMailServiceProvider->create( mail::MailServiceType_SMTP @@ -673,17 +674,6 @@ void SwConnectionListener::disposing(const lang::EventObject& /*aEvent*/) { } -uno::Reference< uno::XComponentContext> getCurrentCmpCtx( - uno::Reference<lang::XMultiServiceFactory> rSrvMgr) -{ - uno::Reference< beans::XPropertySet > xPropSet = - uno::Reference< beans::XPropertySet>(rSrvMgr, uno::UNO_QUERY); - Any aAny = xPropSet->getPropertyValue( ::rtl::OUString("DefaultContext")); - uno::Reference< uno::XComponentContext> rCmpCtx; - aAny >>= rCmpCtx; - return rCmpCtx; -} - SwMailTransferable::SwMailTransferable(const rtl::OUString& rBody, const rtl::OUString& rMimeType) : cppu::WeakComponentImplHelper2< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex), m_aMimeType( rMimeType ), diff --git a/sw/source/ui/inc/mailmergehelper.hxx b/sw/source/ui/inc/mailmergehelper.hxx index d7024d3c39a3..7796046c0b0b 100644 --- a/sw/source/ui/inc/mailmergehelper.hxx +++ b/sw/source/ui/inc/mailmergehelper.hxx @@ -45,18 +45,10 @@ class SwMailMergeConfigItem; -namespace com{ namespace sun{ namespace star{ - namespace uno{ - class XComponentContext; - } - namespace lang{ - class XMultiServiceFactory; - } - namespace mail{ - class XSmtpService; - class XMailService; - } -}}} +namespace com { namespace sun { namespace star { namespace mail { + class XMailService; + class XSmtpService; +} } } } namespace SwMailMergeHelper { @@ -317,10 +309,6 @@ public: {m_sSenderAddress = rSenderAddress;} }; -SW_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> - getCurrentCmpCtx( - ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory> rSrvMgr); #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |