You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2013/06/03 14:33:39 UTC
svn commit: r1488976 - in /openoffice/trunk/main/sfx2:
inc/sfx2/sidebar/ControllerItem.hxx source/sidebar/ControllerItem.cxx
Author: af
Date: Mon Jun 3 12:33:38 2013
New Revision: 1488976
URL: http://svn.apache.org/r1488976
Log:
122433: The sidebar ControllerItem can now give access to the extended help text for commands.
Modified:
openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx
Modified: openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx?rev=1488976&r1=1488975&r2=1488976&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx (original)
+++ openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx Mon Jun 3 12:33:38 2013
@@ -103,6 +103,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. Uses the system high contrast mode state.
*/
Image GetIcon (void) const;
Modified: openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx?rev=1488976&r1=1488975&r2=1488976&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx Mon Jun 3 12:33:38 2013
@@ -208,6 +208,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 GetIcon(Application::GetSettings().GetStyleSettings().GetHighContrastMode());
@@ -228,6 +245,7 @@ Image ControllerItem::GetIcon (const boo
void ControllerItem::SetupToolBoxItem (ToolBox& rToolBox, const sal_uInt16 nIndex)
{
rToolBox.SetQuickHelpText(nIndex, GetLabel());
+ rToolBox.SetHelpText(nIndex, GetHelpText());
rToolBox.SetItemImage(nIndex, GetIcon());
}