diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-16 17:26:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-13 15:18:54 +0200 |
commit | 20bc07707949508f029da5e523fedda3cd64ccc8 (patch) | |
tree | ea692c2791883245776b8761c55f343ea7ce40ff /svtools | |
parent | 282ddcf0bf0893f9a71eef2b1fea3db86b1c3292 (diff) |
tdf#143357 use a DateFormatter and a separate Calendar menubutton
similar to what we ended up with in DateControl in
svtools/source/brwbox/ebbcontrols.cxx
Change-Id: I37c843ff7e1e8e39b318db80fe590ce5f796f46a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119082
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index c482d8b4a8ec..37119eb50833 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1634,8 +1634,9 @@ void SvtLineListBox::UpdatePreview() } } -SvtCalendarBox::SvtCalendarBox(std::unique_ptr<weld::MenuButton> pControl) - : m_xControl(std::move(pControl)) +SvtCalendarBox::SvtCalendarBox(std::unique_ptr<weld::MenuButton> pControl, bool bUseLabel) + : m_bUseLabel(bUseLabel) + , m_xControl(std::move(pControl)) , m_xBuilder(Application::CreateBuilder(m_xControl.get(), "svt/ui/datewindow.ui")) , m_xTopLevel(m_xBuilder->weld_widget("date_popup_window")) , m_xCalendar(m_xBuilder->weld_calendar("date")) @@ -1653,6 +1654,8 @@ void SvtCalendarBox::set_date(const Date& rDate) void SvtCalendarBox::set_label_from_date() { + if (!m_bUseLabel) + return; const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper(); m_xControl->set_label(rLocaleData.getDate(m_xCalendar->get_date())); } |