sfx2/inc/sfx2/sidebar/ControllerItem.hxx | 5 +++++ sfx2/source/sidebar/ControllerItem.cxx | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)
New commits: commit 3f483a9219b9135f9f854d62b4ad0512d3752660 Author: Andre Fischer <[email protected]> Date: Mon Jun 3 12:33:38 2013 +0000 122433: The sidebar ControllerItem can now give access to the extended help text for commands. diff --git a/sfx2/inc/sfx2/sidebar/ControllerItem.hxx b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx index 0641e38..0d53b01 100644 --- a/sfx2/inc/sfx2/sidebar/ControllerItem.hxx +++ b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx @@ -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; diff --git a/sfx2/source/sidebar/ControllerItem.cxx b/sfx2/source/sidebar/ControllerItem.cxx index a4b6a08..1455232 100644 --- a/sfx2/source/sidebar/ControllerItem.cxx +++ b/sfx2/source/sidebar/ControllerItem.cxx @@ -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 bool bIsHighContrastMode) const void ControllerItem::SetupToolBoxItem (ToolBox& rToolBox, const sal_uInt16 nIndex) { rToolBox.SetQuickHelpText(nIndex, GetLabel()); + rToolBox.SetHelpText(nIndex, GetHelpText()); rToolBox.SetItemImage(nIndex, GetIcon()); } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
