summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-12-13 15:09:36 +0000
committerJan Holesovsky <kendy@collabora.com>2017-12-14 06:42:10 +0100
commit689176e9424e617a64edd5e233b750b2269a7275 (patch)
tree30644a54fadfb3b0b387f08620ad436df7f8adb3 /sfx2
parentd83b5a462412acbad86ecb31685159015374ffbb (diff)
LOK: fix URL launching, so that Help buttons work.
Change-Id: I9efe0173c35341043c3402042d9aa364a03e4fc5 Reviewed-on: https://gerrit.libreoffice.org/46419 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/openuriexternally.cxx16
-rw-r--r--sfx2/source/appl/sfxhelp.cxx26
2 files changed, 42 insertions, 0 deletions
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index ed702340fb11..5e597cc4cc2f 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -24,6 +24,11 @@
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
+#include <sfx2/viewsh.hxx>
+
#include "openuriexternally.hxx"
#include "app.hrc"
@@ -31,6 +36,17 @@
bool sfx2::openUriExternally(
OUString const & uri, bool handleSystemShellExecuteException)
{
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if(SfxViewShell* pViewShell = SfxViewShell::Current())
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED,
+ uri.toUtf8().getStr());
+ return true;
+ }
+ return false;
+ }
+
css::uno::Reference< css::system::XSystemShellExecute > exec(
css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
try {
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 2a4c32566c98..7e98a7984ed2 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -58,6 +58,10 @@
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <sfx2/viewsh.hxx>
+
#include "newhelp.hxx"
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
@@ -490,6 +494,9 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p
/// Check for built-in help
static bool impl_hasHelpInstalled( const OUString &rLang = OUString() )
{
+ if (comphelper::LibreOfficeKit::isActive())
+ return false;
+
OUStringBuffer aHelpRootURL("vnd.sun.star.help://");
AppendConfigToken(aHelpRootURL, true, rLang);
std::vector< OUString > aFactories = SfxContentHelper::GetResultSet(aHelpRootURL.makeStringAndClear());
@@ -517,6 +524,19 @@ static bool impl_showOnlineHelp( const OUString& rURL )
OUString aHelpLink( "http://help.libreoffice.org/" );
aHelpLink += rURL.copy( aInternal.getLength() );
aHelpLink = aHelpLink.replaceAll("%2F","/");
+
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if(SfxViewShell* pViewShell = SfxViewShell::Current())
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED,
+ aHelpLink.toUtf8().getStr());
+ return true;
+ }
+ return false;
+ }
+
try
{
Reference< XSystemShellExecute > xSystemShell(
@@ -611,6 +631,12 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
}
}
+ if ( comphelper::LibreOfficeKit::isActive() )
+ {
+ impl_showOnlineHelp( aHelpURL );
+ return true;
+ }
+
if ( !impl_hasHelpInstalled() )
{
if ( impl_showOnlineHelp( aHelpURL ) )