extensions/source/propctrlr/standardcontrol.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit c69aadfec031535c5b6266dcb97d40225f40eb9b Author: Caolán McNamara <[email protected]> AuthorDate: Fri Aug 13 14:49:13 2021 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Aug 13 17:39:18 2021 +0200 pre-select todays's date if the date is empty Change-Id: If34dbb31d14512b7a7c2a76a3adeb99882a8c60c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120457 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index f03c60b2bb4f..584c66889348 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -142,7 +142,13 @@ namespace pcr { if (!rToggle.get_active()) return; - m_xCalendarBox->set_date(m_xEntryFormatter->GetDate()); + ::Date aDate = m_xEntryFormatter->GetDate(); + if (aDate.IsEmpty()) + { + // with an empty date preselect today in the calendar + aDate = ::Date(::Date::SYSTEM); + } + m_xCalendarBox->set_date(aDate); } Any SAL_CALL ODateControl::getValue()
