You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/0001-Resolves-tdf-105602-fi...

69 lines
2.7 KiB

From 429f80910484079e4ef10ca904710e40a14ed3c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 19 Dec 2018 11:56:23 +0000
Subject: [PATCH] Resolves: tdf#105602 fix extended help for non-dispatchable
toolbox commands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I832a043ca5ae3a4030b9ac22447cecfabd3650c0
Reviewed-on: https://gerrit.libreoffice.org/65422
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
vcl/source/window/builder.cxx | 2 +-
vcl/source/window/toolbox.cxx | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ba0281bacc4c..857bf71f34ca 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2121,9 +2121,9 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
//TODO: ImplToolItems::size_type -> sal_uInt16!
pToolBox->InsertItem(nItemId, extractLabel(rMap), nBits);
pToolBox->SetItemCommand(nItemId, aCommand);
- pToolBox->SetHelpId(nItemId, m_sHelpRoot + id);
}
+ pToolBox->SetHelpId(nItemId, m_sHelpRoot + id);
OUString sTooltip(extractTooltipText(rMap));
if (!sTooltip.isEmpty())
pToolBox->SetQuickHelpText(nItemId, sTooltip);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 824f216ccf0c..4d203c6b9186 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3792,6 +3792,17 @@ void ToolBox::Resize()
}
}
+namespace
+{
+ bool DispatchableCommand(const OUString& rName)
+ {
+ return rName.startsWith(".uno") ||
+ rName.startsWith("slot:") ||
+ rName.startsWith("macro:") ||
+ rName.startsWith("vnd.sun.star.script");
+ }
+}
+
const OUString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -3803,7 +3814,7 @@ const OUString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( pItem->maCommandStr.getLength() )
+ if (DispatchableCommand(pItem->maCommandStr))
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
if ( pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty() )
pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
--
2.20.1