Kaydet (Commit) 3b55196f authored tarafından Andre Fischer's avatar Andre Fischer Kaydeden (comit) Caolán McNamara

Resolves: #i122433# The sidebar ControllerItem can now...

give access to the extended help text for commands

(cherry picked from commit 3f483a92)

Conflicts:
	sfx2/inc/sfx2/sidebar/ControllerItem.hxx

Change-Id: I22668e6f9c1c7aed174a43d7d3e04829dc6733ae

Related: #i122433# fix build breaker

 invalid use of incomplete type 'struct Help'

(cherry picked from commit 797e3999)

Change-Id: Ifde6fede9b91eb828c665a5a720b93171108e17b
üst b269b4ee
......@@ -100,6 +100,11 @@ public:
*/
::rtl::OUString GetLabel (void) const;
/** Return the extended help text for the command.
Returns an empty string when the UNO command name is not available.
*/
::rtl::OUString GetHelpText (void) const;
/** Return the icon for the command.
*/
Image GetIcon (void) const;
......
......@@ -25,6 +25,7 @@
#include "sfx2/sidebar/CommandInfoProvider.hxx"
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/help.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp>
......@@ -202,6 +203,23 @@ void ControllerItem::ResetFrame (void)
::rtl::OUString ControllerItem::GetHelpText (void) const
{
Help* pHelp = Application::GetHelp();
if (pHelp != NULL)
{
if (msCommandName.getLength() > 0)
{
const ::rtl::OUString sHelp (pHelp->GetHelpText(A2S(".uno:")+msCommandName, NULL));
return sHelp;
}
}
return ::rtl::OUString();
}
Image ControllerItem::GetIcon (void) const
{
return GetImage(mxFrame, A2S(".uno:")+msCommandName, sal_False);
......@@ -218,6 +236,7 @@ ControllerItem::ItemUpdateReceiverInterface::~ItemUpdateReceiverInterface()
void ControllerItem::SetupToolBoxItem (ToolBox& rToolBox, const sal_uInt16 nIndex)
{
rToolBox.SetQuickHelpText(nIndex, GetLabel());
rToolBox.SetHelpText(nIndex, GetHelpText());
rToolBox.SetItemImage(nIndex, GetIcon());
}
......
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