diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-17 10:52:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-24 16:49:49 +0200 |
commit | 33a0f8ce656c8c5bb9c3c3deaa10c182e262b374 (patch) | |
tree | abd469ffb224c8d7b2de1cf76e3aada03e035fc1 /extensions | |
parent | f252b332dd2652abb02851ba0c2521c045787801 (diff) |
fdo#46808, Adapt awt::Toolkit UNO service to new style
Create a merged XToolkit2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Also mark sub-interfaces as non-optional.
Change-Id: I278d0288e92be277033013302267cf93f7d70480
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/nsplugin/source/so_instance.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 4aeb45a645f7..a86ddbeec814 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <com/sun/star/lang/SystemDependent.hpp> +#include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XSystemChildFactory.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/util/XCloseable.hpp> @@ -132,15 +133,11 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) try { + Reference< beans::XPropertySet > xFactoryProperties( mxRemoteMSF, uno::UNO_QUERY ); + Reference< uno::XComponentContext > xContext( xFactoryProperties->getPropertyValue( "DefaultContext" ), UNO_QUERY ); + // try to create netscape plugin window - Reference< awt::XToolkit > xToolkit( - mxRemoteMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ), - uno::UNO_QUERY ); - if( !xToolkit.is() ) - { - debug_fprintf(NSP_LOG_APPEND, "Can not create Toolkit!\n"); - return sal_False; - } + Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW ); // prepare parameters for plugin window css::uno::Any hwndParent = css::uno::makeAny((sal_Int32)hParent); @@ -240,8 +237,6 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) } //create stream for the document - Reference< uno::XComponentContext > xContext( - comphelper::getComponentContext( mxRemoteMSF ) ); Reference< ucb::XSimpleFileAccess2 > xSimpleFileAccess( ucb::SimpleFileAccess::create(xContext) ); Reference<io::XInputStream> xInputStream = xSimpleFileAccess->openFileRead( m_sURL ); |