fdo#46808, Use service constructor for rendering::CanvasFactory
Change-Id: If6bebe0d2dfb30c3fffd0fb284cd766e3f315b49
This commit is contained in:
@@ -50,6 +50,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_ooxmlexport))
|
|||||||
|
|
||||||
$(eval $(call gb_CppunitTest_use_components,sw_ooxmlexport,\
|
$(eval $(call gb_CppunitTest_use_components,sw_ooxmlexport,\
|
||||||
basic/util/sb \
|
basic/util/sb \
|
||||||
|
canvas/source/factory/canvasfactory \
|
||||||
comphelper/util/comphelp \
|
comphelper/util/comphelp \
|
||||||
configmgr/source/configmgr \
|
configmgr/source/configmgr \
|
||||||
embeddedobj/util/embobj \
|
embeddedobj/util/embobj \
|
||||||
|
@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_rtfimport))
|
|||||||
|
|
||||||
$(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\
|
$(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\
|
||||||
basic/util/sb \
|
basic/util/sb \
|
||||||
|
canvas/source/factory/canvasfactory \
|
||||||
comphelper/util/comphelp \
|
comphelper/util/comphelp \
|
||||||
configmgr/source/configmgr \
|
configmgr/source/configmgr \
|
||||||
embeddedobj/util/embobj \
|
embeddedobj/util/embobj \
|
||||||
|
@@ -56,6 +56,7 @@
|
|||||||
#include <com/sun/star/awt/XGraphics.hpp>
|
#include <com/sun/star/awt/XGraphics.hpp>
|
||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
#include <com/sun/star/rendering/XCanvas.hpp>
|
#include <com/sun/star/rendering/XCanvas.hpp>
|
||||||
|
#include <com/sun/star/rendering/CanvasFactory.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
|
||||||
@@ -2565,22 +2566,17 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
|
|||||||
aArg[ 3 ] = uno::makeAny( sal_False );
|
aArg[ 3 ] = uno::makeAny( sal_False );
|
||||||
aArg[ 5 ] = GetSystemGfxDataAny();
|
aArg[ 5 ] = GetSystemGfxDataAny();
|
||||||
|
|
||||||
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
|
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
|
||||||
|
|
||||||
uno::Reference<rendering::XCanvas> xCanvas;
|
|
||||||
|
|
||||||
// Create canvas instance with window handle
|
// Create canvas instance with window handle
|
||||||
// =========================================
|
// =========================================
|
||||||
static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(
|
static uno::Reference<lang::XMultiComponentFactory> xCanvasFactory( rendering::CanvasFactory::create( xContext ) );
|
||||||
xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ),
|
|
||||||
uno::UNO_QUERY );
|
uno::Reference<rendering::XCanvas> xCanvas;
|
||||||
if(xCanvasFactory.is())
|
|
||||||
{
|
|
||||||
xCanvas.set(
|
xCanvas.set(
|
||||||
xCanvasFactory->createInstanceWithArguments(
|
xCanvasFactory->createInstanceWithArgumentsAndContext(
|
||||||
"com.sun.star.rendering.Canvas", aArg ),
|
"com.sun.star.rendering.Canvas", aArg, xContext ),
|
||||||
uno::UNO_QUERY );
|
uno::UNO_QUERY );
|
||||||
}
|
|
||||||
|
|
||||||
return xCanvas;
|
return xCanvas;
|
||||||
}
|
}
|
||||||
|
@@ -75,23 +75,24 @@
|
|||||||
#include "dndlcon.hxx"
|
#include "dndlcon.hxx"
|
||||||
#include "dndevdis.hxx"
|
#include "dndevdis.hxx"
|
||||||
|
|
||||||
|
#include "com/sun/star/accessibility/XAccessible.hpp"
|
||||||
|
#include "com/sun/star/accessibility/AccessibleRole.hpp"
|
||||||
#include "com/sun/star/awt/XWindowPeer.hpp"
|
#include "com/sun/star/awt/XWindowPeer.hpp"
|
||||||
#include "com/sun/star/rendering/XCanvas.hpp"
|
#include "com/sun/star/awt/XTopWindow.hpp"
|
||||||
#include "com/sun/star/rendering/XSpriteCanvas.hpp"
|
|
||||||
#include "com/sun/star/awt/XWindow.hpp"
|
#include "com/sun/star/awt/XWindow.hpp"
|
||||||
#include "comphelper/processfactory.hxx"
|
#include "com/sun/star/awt/XDisplayConnection.hpp"
|
||||||
#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
|
#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
|
||||||
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
|
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
|
||||||
#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
|
#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
|
||||||
#include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp"
|
#include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp"
|
||||||
#include "com/sun/star/datatransfer/clipboard/SystemClipboardExt.hpp"
|
#include "com/sun/star/datatransfer/clipboard/SystemClipboardExt.hpp"
|
||||||
#include "com/sun/star/awt/XTopWindow.hpp"
|
|
||||||
#include "com/sun/star/awt/XDisplayConnection.hpp"
|
|
||||||
#include "com/sun/star/lang/XInitialization.hpp"
|
#include "com/sun/star/lang/XInitialization.hpp"
|
||||||
#include "com/sun/star/lang/XComponent.hpp"
|
#include "com/sun/star/lang/XComponent.hpp"
|
||||||
#include "com/sun/star/lang/XServiceName.hpp"
|
#include "com/sun/star/lang/XServiceName.hpp"
|
||||||
#include "com/sun/star/accessibility/XAccessible.hpp"
|
#include "com/sun/star/rendering/CanvasFactory.hpp"
|
||||||
#include "com/sun/star/accessibility/AccessibleRole.hpp"
|
#include "com/sun/star/rendering/XCanvas.hpp"
|
||||||
|
#include "com/sun/star/rendering/XSpriteCanvas.hpp"
|
||||||
|
#include "comphelper/processfactory.hxx"
|
||||||
|
|
||||||
#include <sal/macros.h>
|
#include <sal/macros.h>
|
||||||
#include <rtl/strbuf.hxx>
|
#include <rtl/strbuf.hxx>
|
||||||
@@ -9467,16 +9468,13 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
|
|||||||
const_cast<Window*>(this)->GetComponentInterface(),
|
const_cast<Window*>(this)->GetComponentInterface(),
|
||||||
uno::UNO_QUERY ));
|
uno::UNO_QUERY ));
|
||||||
|
|
||||||
uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
|
uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
|
||||||
|
|
||||||
// Create canvas instance with window handle
|
// Create canvas instance with window handle
|
||||||
// =========================================
|
// =========================================
|
||||||
static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
|
static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiComponentFactory> xStaticCanvasFactory(
|
||||||
uno::Reference<lang::XMultiServiceFactory>(
|
rendering::CanvasFactory::create( xContext ) );
|
||||||
xFactory->createInstance(
|
uno::Reference<lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get());
|
||||||
OUString( "com.sun.star.rendering.CanvasFactory" ) ),
|
|
||||||
UNO_QUERY ));
|
|
||||||
uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
|
|
||||||
|
|
||||||
if(xCanvasFactory.is())
|
if(xCanvasFactory.is())
|
||||||
{
|
{
|
||||||
@@ -9489,22 +9487,24 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
|
|||||||
const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
|
const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
|
||||||
if( (nDisplay >= Application::GetScreenCount()) )
|
if( (nDisplay >= Application::GetScreenCount()) )
|
||||||
{
|
{
|
||||||
xCanvas.set( xCanvasFactory->createInstanceWithArguments(
|
xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
|
||||||
bSpriteCanvas ?
|
bSpriteCanvas ?
|
||||||
OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
|
OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
|
||||||
OUString( "com.sun.star.rendering.Canvas.MultiScreen" ),
|
OUString( "com.sun.star.rendering.Canvas.MultiScreen" ),
|
||||||
aArg ),
|
aArg,
|
||||||
|
xContext ),
|
||||||
UNO_QUERY );
|
UNO_QUERY );
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
xCanvas.set( xCanvasFactory->createInstanceWithArguments(
|
xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
|
||||||
bSpriteCanvas ?
|
bSpriteCanvas ?
|
||||||
OUString( "com.sun.star.rendering.SpriteCanvas" ) :
|
OUString( "com.sun.star.rendering.SpriteCanvas" ) :
|
||||||
OUString( "com.sun.star.rendering.Canvas" ),
|
OUString( "com.sun.star.rendering.Canvas" ),
|
||||||
aArg ),
|
aArg,
|
||||||
|
xContext ),
|
||||||
UNO_QUERY );
|
UNO_QUERY );
|
||||||
|
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
|
Reference in New Issue
Block a user