summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/sfxhelp.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-12-11 00:02:35 +0100
committerMathias Bauer <mba@openoffice.org>2009-12-11 00:02:35 +0100
commit6cf70e1ed38d5ee02c691fed3d7cc10b4cac338b (patch)
treef8ef6aba919703dfbc89a6718f99ddbd3bc10779 /sfx2/source/appl/sfxhelp.cxx
parentf4bf27fe666be0da383728969499a4bd95ee970f (diff)
#i107450#: HelpAgent now can be started without linking against sfx2
Diffstat (limited to 'sfx2/source/appl/sfxhelp.cxx')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx42
1 files changed, 24 insertions, 18 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 7421330cf9..eb6ca0e841 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -38,9 +38,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -60,13 +58,11 @@
#include <tools/urlobj.hxx>
#include <unotools/configmgr.hxx>
#include <ucbhelper/content.hxx>
-
#include <unotools/pathoptions.hxx>
#include <rtl/ustring.hxx>
#include <osl/process.h>
#include <osl/file.hxx>
#include <unotools/bootstrap.hxx>
-
#include <rtl/uri.hxx>
#include <vcl/msgbox.hxx>
#include <svtools/ehdl.hxx>
@@ -76,16 +72,13 @@
#define _SVSTDARR_ULONGSSORT
#include <svl/svstdarr.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/app.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/msgpool.hxx>
#include "newhelp.hxx"
-#include <sfx2/objsh.hxx>
-#include <sfx2/docfac.hxx>
#include "sfxresid.hxx"
#include "helper.hxx"
#include "app.hrc"
+#include <sfx2/sfxuno.hxx>
+#include <vcl/svapp.hxx>
+#include <sfx2/frame.hxx>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
@@ -967,26 +960,39 @@ String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleN
return aURL;
}
-void SfxHelp::OpenHelpAgent( SfxFrame *pFrame, ULONG nHelpId )
+void SfxHelp::OpenHelpAgent( SfxFrame*, ULONG nHelpId )
{
- if ( SvtHelpOptions().IsHelpAgentAutoStartMode() )
- {
SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
if ( pHelp )
- {
- SfxHelpOptions_Impl *pOpt = pHelp->pImp->GetOptions();
+ pHelp->OpenHelpAgent( nHelpId );
+}
+
+void SfxHelp::OpenHelpAgent( ULONG nHelpId )
+{
+ if ( SvtHelpOptions().IsHelpAgentAutoStartMode() )
+ {
+// SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
+// if ( pHelp )
+// {
+ SfxHelpOptions_Impl *pOpt = pImp->GetOptions();
if ( !pOpt->HasId( nHelpId ) )
return;
try
{
URL aURL;
- aURL.Complete = pHelp->CreateHelpURL_Impl( nHelpId, pHelp->GetHelpModuleName_Impl() );
+ aURL.Complete = CreateHelpURL_Impl( nHelpId, GetHelpModuleName_Impl() );
Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY );
xTrans->parseStrict(aURL);
- Reference< XDispatchProvider > xDispProv( pFrame->GetTopFrame()->GetFrameInterface(), UNO_QUERY );
+ Reference < XFrame > xCurrentFrame;
+ Reference < XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
+ DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ if ( xDesktop.is() )
+ xCurrentFrame = xDesktop->getCurrentFrame();
+
+ Reference< XDispatchProvider > xDispProv( xCurrentFrame, UNO_QUERY );
Reference< XDispatch > xHelpDispatch;
if ( xDispProv.is() )
xHelpDispatch = xDispProv->queryDispatch(
@@ -1001,7 +1007,7 @@ void SfxHelp::OpenHelpAgent( SfxFrame *pFrame, ULONG nHelpId )
{
DBG_ERRORFILE( "OpenHelpAgent: caught an exception while executing the dispatch!" );
}
- }
+// }
}
}