diff options
author | David Tardon <dtardon@redhat.com> | 2011-11-24 13:01:09 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-12-05 15:11:49 +0100 |
commit | b2096dee9025e72a2a6cca728f7e8d2cfcf9f114 (patch) | |
tree | 35ea7d797cbdb8c3f6e6c63a0b9bb9bb73fa0daf /vcl | |
parent | c11d549a89fe16db311be3a9f057da69ab6bf49b (diff) |
process HelpId option entry
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/gdi/salprn-gtk.cxx | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index 72b22c3769e8..e7c0e52a5730 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -30,7 +30,9 @@ #include "unx/gtk/gtkprn.hxx" #include "vcl/configsettings.hxx" +#include "vcl/help.hxx" #include "vcl/print.hxx" +#include "vcl/svapp.hxx" #include "vcl/unohelp.hxx" #include <gtk/gtkprinter.h> @@ -348,6 +350,22 @@ lcl_makeFrame( return pFrame; } +void +lcl_extractHelpTextsOrIds( + const beans::PropertyValue& rEntry, + uno::Sequence<rtl::OUString>& rHelpStrings) +{ + if (!(rEntry.Value >>= rHelpStrings)) + { + rtl::OUString aHelpString; + if ((rEntry.Value >>= aHelpString)) + { + rHelpStrings.realloc(1); + *rHelpStrings.getArray() = aHelpString; + } + } +} + } GtkPrintDialog::GtkPrintDialog(vcl::PrinterController& io_rController) @@ -441,18 +459,23 @@ GtkPrintDialog::impl_initCustomTab() rEntry.Value >>= nMinValue; else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MaxValue"))) rEntry.Value >>= nMaxValue; - else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpText"))) + else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpId"))) { - if (!(rEntry.Value >>= aHelpTexts)) + uno::Sequence<rtl::OUString> aHelpIds; + lcl_extractHelpTextsOrIds(rEntry, aHelpIds); + Help* const pHelp = Application::GetHelp(); + if (pHelp) { - rtl::OUString aHelpText; - if ((rEntry.Value >>= aHelpText)) - { - aHelpTexts.realloc(1); - *aHelpTexts.getArray() = aHelpText; - } + const int nLen = aHelpIds.getLength(); + aHelpTexts.realloc(nLen); + for (int j = 0; j != nLen; ++j) + aHelpTexts[j] = pHelp->GetHelpText(aHelpIds[j], 0); } + else // fallback + aHelpTexts = aHelpIds; } + else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpText"))) + lcl_extractHelpTextsOrIds(rEntry, aHelpTexts); else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("InternalUIOnly"))) rEntry.Value >>= bIgnore; else if (rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Enabled"))) |