Kaydet (Commit) 7978eb8f authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Pranav Kant

LOK: fix URL launching, so that Help buttons work.

Change-Id: I9efe0173c35341043c3402042d9aa364a03e4fc5
Reviewed-on: https://gerrit.libreoffice.org/46419Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
(cherry picked from commit 2ccf578372cd77060abb6db520985165e779de3f)
üst fbd537ae
......@@ -23,14 +23,27 @@
#include <sfx2/sfxresid.hxx>
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
#include <openuriexternally.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewsh.hxx>
#include <sfx2/strings.hrc>
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 {
......
......@@ -56,6 +56,10 @@
#include <svtools/sfxecode.hxx>
#include <openuriexternally.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewsh.hxx>
#include "newhelp.hxx"
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
......@@ -503,6 +507,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());
......@@ -531,6 +538,19 @@ static bool impl_showOnlineHelp( const OUString& rURL )
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
{
sfx2::openUriExternally(aHelpLink, false);
......@@ -622,6 +642,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() )
{
ScopedVclPtrInstance< MessageDialog > aQueryBox(const_cast< vcl::Window* >( pWindow ),"onlinehelpmanual","sfx/ui/helpmanual.ui");
......
......@@ -14,6 +14,7 @@ $(eval $(call gb_Library_use_sdk_api,syssh))
$(eval $(call gb_Library_use_libraries,syssh,\
cppu \
cppuhelper \
comphelper \
sal \
))
......
......@@ -34,6 +34,7 @@
#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/lok.hxx>
#include <uno/current_context.hxx>
......@@ -97,6 +98,12 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
{
OStringBuffer aBuffer, aLaunchBuffer;
if (comphelper::LibreOfficeKit::isActive())
{
SAL_WARN("shell", "Unusual - shell attemp to launch " << aCommand << " with params " << aParameter << " under lok");
return;
}
// DESKTOP_LAUNCH, see http://freedesktop.org/pipermail/xdg/2004-August/004489.html
static const char *pDesktopLaunch = getenv( "DESKTOP_LAUNCH" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment