summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-26 13:53:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-04 16:57:55 +0200
commitb3c76dee6d44d07eae404b8d7341e6c88e6c4429 (patch)
treec747dd5bddf94c3b4312c7b1861a5087e76e71d6 /extensions
parenteb68bf18f2d859486c4a737abb2536a6afe45411 (diff)
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new ::create methods Change-Id: I01d4417820f52718836c92faf3c2fae0dc96b30d Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/plugin/base/xplugin.cxx23
-rw-r--r--extensions/source/propctrlr/browserline.cxx8
-rw-r--r--extensions/source/update/ui/updatecheckui.cxx27
3 files changed, 27 insertions, 31 deletions
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 897be135a541..4d2b0420ea24 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -42,7 +42,9 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/loader/XImplementationLoader.hpp>
#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#include <com/sun/star/plugin/PluginManager.hpp>
+#include <comphelper/componentcontext.hxx>
#include <plugin/impl.hxx>
#include <tools/fsys.hxx>
#include <ucbhelper/content.hxx>
@@ -137,8 +139,8 @@ XPlugin_Impl::XPlugin_Impl( const uno::Reference< com::sun::star::lang::XMultiSe
uno::Reference< com::sun::star::beans::XPropertySet > xPS( m_xModel, UNO_QUERY );
xPS->addPropertyChangeListener( OUString(), this );
- Guard< Mutex > aGuard( PluginManager::get().getPluginMutex() );
- PluginManager::get().getPlugins().push_back( this );
+ Guard< Mutex > aGuard( ::PluginManager::get().getPluginMutex() );
+ ::PluginManager::get().getPlugins().push_back( this );
}
void XPlugin_Impl::destroyInstance()
@@ -198,11 +200,11 @@ IMPL_LINK( XPlugin_Impl, secondLevelDispose, XPlugin_Impl*, /*pThis*/ )
// may have become undisposable between PostUserEvent and here
// or may have disposed and receive a second UserEvent
- std::list<XPlugin_Impl*>& rList = PluginManager::get().getPlugins();
+ std::list<XPlugin_Impl*>& rList = ::PluginManager::get().getPlugins();
std::list<XPlugin_Impl*>::iterator iter;
{
- Guard< Mutex > aPluginGuard( PluginManager::get().getPluginMutex() );
+ Guard< Mutex > aPluginGuard( ::PluginManager::get().getPluginMutex() );
for( iter = rList.begin(); iter != rList.end(); ++iter )
{
if( *iter == this )
@@ -222,7 +224,7 @@ IMPL_LINK( XPlugin_Impl, secondLevelDispose, XPlugin_Impl*, /*pThis*/ )
uno::Reference< com::sun::star::beans::XPropertySet > xPS( m_xModel, UNO_QUERY );
xPS->removePropertyChangeListener( OUString(), this );
{
- Guard< Mutex > aPluginGuard( PluginManager::get().getPluginMutex() );
+ Guard< Mutex > aPluginGuard( ::PluginManager::get().getPluginMutex() );
rList.remove( this );
}
m_aNPWindow.window = NULL;
@@ -512,8 +514,8 @@ void XPlugin_Impl::loadPlugin()
Guard< Mutex > aGuard( m_aMutex );
std::list<PluginComm*>::iterator iter;
- for( iter = PluginManager::get().getPluginComms().begin();
- iter != PluginManager::get().getPluginComms().end(); ++iter )
+ for( iter = ::PluginManager::get().getPluginComms().begin();
+ iter != ::PluginManager::get().getPluginComms().end(); ++iter )
{
if( OStringToOUString( (*iter)->getLibName(), m_aEncoding ) == m_aDescription.PluginName )
{
@@ -893,12 +895,7 @@ void XPlugin_Impl::setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_,
PluginDescription XPlugin_Impl::fitDescription( const OUString& rURL )
{
- uno::Reference< XPluginManager > xPMgr( m_xSMgr->createInstance( OUString("com.sun.star.plugin.PluginManager") ), UNO_QUERY );
- if( !xPMgr.is() )
- {
- m_nProvidingState = PROVIDING_NONE;
- return PluginDescription();
- }
+ uno::Reference< XPluginManager > xPMgr( plugin::PluginManager::create(comphelper::ComponentContext(m_xSMgr).getUNOContext()) );
Sequence< PluginDescription > aDescrs = xPMgr->getPluginDescriptions();
const PluginDescription* pDescrs = aDescrs.getConstArray();
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 480ac6badacd..816612344e5e 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -28,7 +28,9 @@
#include "browserline.hxx"
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/inspection/PropertyLineElement.hpp>
+#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <comphelper/componentcontext.hxx>
@@ -46,10 +48,12 @@ namespace pcr
/** === begin UNO using === **/
using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::inspection::XPropertyControl;
using ::com::sun::star::inspection::XPropertyControlContext;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::graphic::GraphicProvider;
using ::com::sun::star::graphic::XGraphicProvider;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::PropertyValue;
@@ -412,8 +416,8 @@ namespace pcr
{
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create(xContext) );
Sequence< PropertyValue > aMediaProperties(1);
aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index 2c974dcf508f..53d41c40efd2 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/task/XJob.hpp>
@@ -323,30 +324,24 @@ Image UpdateCheckUI::GetBubbleImage( ::rtl::OUString &rURL )
if ( !maBubbleImageURL.isEmpty() )
{
- uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- if( !xServiceManager.is() )
+ if( !xContext.is() )
throw uno::RuntimeException(
UNISTRING( "UpdateCheckUI: unable to obtain service manager from component context" ),
uno::Reference< uno::XInterface >() );
try
{
- uno::Reference< graphic::XGraphicProvider > xGraphProvider(
- xServiceManager->createInstance(
- ::rtl::OUString("com.sun.star.graphic.GraphicProvider") ),
- uno::UNO_QUERY );
- if ( xGraphProvider.is() )
- {
- uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
- aMediaProps[0].Name = ::rtl::OUString("URL");
- aMediaProps[0].Value <<= rURL;
+ uno::Reference< graphic::XGraphicProvider > xGraphProvider(graphic::GraphicProvider::create(xContext));
+ uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
+ aMediaProps[0].Name = ::rtl::OUString("URL");
+ aMediaProps[0].Value <<= rURL;
- uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps );
- if ( xGraphic.is() )
- {
- aImage = Image( xGraphic );
- }
+ uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps );
+ if ( xGraphic.is() )
+ {
+ aImage = Image( xGraphic );
}
}
catch( const uno::Exception& )