From bb121c864cc3c101ef733a4088c7ba3e36eced14 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 14 Dec 2012 12:58:00 +0200 Subject: fdo#46808, Convert frame::Desktop to new style service. I had to drop XEventBroadcaster from the merged interface because it introduced method name conflicts (addEventListener). Shouldn't be an issue since it was scheduled to be dropped anyhow, and the service implementation still implements it, so existing clients will be fine. I dropped the interface XPropertySet from the combined IDL because nobody seems to be using it, and it's primary purpose appears to be to set weird flags. I dropped the optional interfaces XStatusIndicatorFactory XDispatchInformationProvider from the combined IDL because the service does not implement them, and nobody seems to be using them. I suspect they were mistakenly copied from XFrame. I also did not convert the Title, UserDefinedAttributes and LayoutManager properties to attributes, again because no-one is using them. Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af --- oox/source/helper/graphichelper.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'oox') diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index 95dd078a82ad..8cd4d8d86928 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -69,9 +70,7 @@ GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, c maGraphicObjScheme( CREATE_OUSTRING( "vnd.sun.star.GraphicObject:" ) ) { OSL_ENSURE( mxContext.is(), "GraphicHelper::GraphicHelper - missing component context" ); - Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY ); - OSL_ENSURE( xFactory.is(), "GraphicHelper::GraphicHelper - missing service factory" ); - if( xFactory.is() ) + if( mxContext.is() ) mxGraphicProvider.set( graphic::GraphicProvider::create( mxContext ) ); //! TODO: get colors from system @@ -109,9 +108,9 @@ GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, c // if no target frame has been passed (e.g. OLE objects), try to fallback to the active frame // TODO: we need some mechanism to keep and pass the parent frame Reference< XFrame > xFrame = rxTargetFrame; - if( !xFrame.is() && xFactory.is() ) try + if( !xFrame.is() && mxContext.is() ) try { - Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); + Reference< XDesktop2 > xFramesSupp = Desktop::create( mxContext ); xFrame = xFramesSupp->getActiveFrame(); } catch( Exception& ) -- cgit