diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-23 15:43:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-27 15:40:06 +0200 |
commit | f789715a414bd1115401f93d11f09260f891956c (patch) | |
tree | 2e7ce9d3841ae8c98585901ddae699dbb9528820 /scripting/source | |
parent | 65c78617de30f4928255b15599e7709fa0081f67 (diff) |
fdo#46808, Use factory methods for frame::DispatchHelper instances
Change-Id: I7bdf16fc6d042e5ecd404c604a8b7c31c1ac7bc1
Diffstat (limited to 'scripting/source')
-rw-r--r-- | scripting/source/basprov/basmethnode.cxx | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx index e5046619b986..a1d7c5cd8fb2 100644 --- a/scripting/source/basprov/basmethnode.cxx +++ b/scripting/source/basprov/basmethnode.cxx @@ -19,8 +19,8 @@ #include "basmethnode.hxx" #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/frame/XDesktop.hpp> -#include <com/sun/star/frame/XDispatchHelper.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> @@ -263,24 +263,20 @@ namespace basprov if ( xProv.is() ) { - Reference< frame::XDispatchHelper > xHelper( xSMgr->createInstanceWithContext( - ::rtl::OUString( "com.sun.star.frame.DispatchHelper" ), m_xContext ), UNO_QUERY ); - - if ( xHelper.is() ) - { - Sequence < PropertyValue > aArgs(7); - aArgs[0].Name = ::rtl::OUString("Document"); - aArgs[0].Value <<= sDocURL; - aArgs[1].Name = ::rtl::OUString("LibName"); - aArgs[1].Value <<= sLibName; - aArgs[2].Name = ::rtl::OUString("Name"); - aArgs[2].Value <<= sModName; - aArgs[3].Name = ::rtl::OUString("Type"); - aArgs[3].Value <<= ::rtl::OUString("Module"); - aArgs[4].Name = ::rtl::OUString("Line"); - aArgs[4].Value <<= static_cast< sal_uInt32 >( nLine1 ); - xHelper->executeDispatch( xProv, ::rtl::OUString(".uno:BasicIDEAppear"), ::rtl::OUString(), 0, aArgs ); - } + Reference< frame::XDispatchHelper > xHelper( frame::DispatchHelper::create( m_xContext ) ); + + Sequence < PropertyValue > aArgs(7); + aArgs[0].Name = ::rtl::OUString("Document"); + aArgs[0].Value <<= sDocURL; + aArgs[1].Name = ::rtl::OUString("LibName"); + aArgs[1].Value <<= sLibName; + aArgs[2].Name = ::rtl::OUString("Name"); + aArgs[2].Value <<= sModName; + aArgs[3].Name = ::rtl::OUString("Type"); + aArgs[3].Value <<= ::rtl::OUString("Module"); + aArgs[4].Name = ::rtl::OUString("Line"); + aArgs[4].Value <<= static_cast< sal_uInt32 >( nLine1 ); + xHelper->executeDispatch( xProv, ::rtl::OUString(".uno:BasicIDEAppear"), ::rtl::OUString(), 0, aArgs ); } } } |