diff options
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 ); |