extensions/source/propctrlr/standardcontrol.cxx | 4 ++-- forms/source/component/Date.cxx | 2 +- toolkit/source/controls/unocontrolmodel.cxx | 4 ++-- toolkit/source/controls/unocontrols.cxx | 4 ++-- vcl/source/app/weldutils.cxx | 4 ++-- vcl/source/control/field2.cxx | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-)
New commits: commit 5d40ced9e8b0aa1e4c07aea56ed8c1bdaa89705f Author: Juan C. Sanz <[email protected]> AuthorDate: Thu Sep 8 00:14:39 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Sep 8 10:24:01 2022 +0200 Revert "tdf#150569 Modify hardcoded dates to extend the range of accepted dates" This reverts commit b20594f2fc8f6f9fdbf0b257b4e74d95a8d90139. Reason for revert: Further testing has shown some errors in other ways of displaying the data Change-Id: Ic4909f8571c8730ab3ba622c7fad99f2646616ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139566 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 1c88f98ecf8c..95b4143c76b8 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -99,8 +99,8 @@ namespace pcr m_xEntryFormatter.reset(new weld::DateFormatter(*m_xEntry)); m_xEntryFormatter->SetStrictFormat(true); - m_xEntryFormatter->SetMin(::Date(1, 1, 0001)); - m_xEntryFormatter->SetMax(::Date(31, 12, 9999)); + m_xEntryFormatter->SetMin(::Date(1, 1, 1600)); + m_xEntryFormatter->SetMax(::Date(1, 1, 9999)); m_xEntryFormatter->SetExtDateFormat(ExtDateFieldFormat::SystemShortYYYY); m_xEntryFormatter->EnableEmptyField(true); diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index e2be9e2ef8c1..3305e7695dff 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -86,7 +86,7 @@ ODateModel::ODateModel(const Reference<XComponentContext>& _rxFactory) try { if ( m_xAggregateSet.is() ) - m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, Any(util::Date(1, 1, 0001)) ); + m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, Any(util::Date(1, 1, 1800)) ); } catch( const Exception& ) { diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index efd25aa998e7..986f55efbc50 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -226,8 +226,8 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const case BASEPROPERTY_PUSHBUTTONTYPE: aDefault <<= sal_Int16(0) /*PushButtonType::STANDARD*/; break; case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:aDefault <<= sal_Int16(awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY); break; - case BASEPROPERTY_DATEMAX: aDefault <<= util::Date( 31, 12, 9999 ); break; - case BASEPROPERTY_DATEMIN: aDefault <<= util::Date( 1, 1, 0001 ); break; + case BASEPROPERTY_DATEMAX: aDefault <<= util::Date( 31, 12, 2200 ); break; + case BASEPROPERTY_DATEMIN: aDefault <<= util::Date( 1, 1, 1900 ); break; case BASEPROPERTY_TIMEMAX: aDefault <<= util::Time(0, 0, 59, 23, false); break; case BASEPROPERTY_TIMEMIN: aDefault <<= util::Time(); break; case BASEPROPERTY_VALUEMAX_DOUBLE: aDefault <<= double(1000000); break; diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index de764e7b8be1..3bc095cf3f03 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -3433,8 +3433,8 @@ stardiv_Toolkit_UnoControlDateFieldModel_get_implementation( UnoDateFieldControl::UnoDateFieldControl() { - mnFirst = util::Date( 1, 1, 0001 ); - mnLast = util::Date( 31, 12, 9999 ); + mnFirst = util::Date( 1, 1, 1900 ); + mnLast = util::Date( 31, 12, 2200 ); mbLongFormat = TRISTATE_INDET; } diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx index 8e916ce984b9..f17aed238ae8 100644 --- a/vcl/source/app/weldutils.cxx +++ b/vcl/source/app/weldutils.cxx @@ -444,8 +444,8 @@ void DateFormatter::Init() SetOutputHdl(LINK(this, DateFormatter, FormatOutputHdl)); SetInputHdl(LINK(this, DateFormatter, ParseInputHdl)); - SetMin(Date(1, 1, 0001)); - SetMax(Date(31, 12, 9999)); + SetMin(Date(1, 1, 1900)); + SetMax(Date(31, 12, 2200)); } void DateFormatter::SetExtDateFormat(ExtDateFieldFormat eFormat) diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 6af391a6cede..89efabf08c3f 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1718,8 +1718,8 @@ DateFormatter::DateFormatter(Edit* pEdit) : FormatterBase(pEdit) , maFieldDate(0) , maLastDate(0) - , maMin(1, 1, 0001) - , maMax(31, 12, 9999) + , maMin(1, 1, 1900) + , maMax(31, 12, 2200) , mbLongFormat(false) , mbShowDateCentury(true) , mnExtDateFormat(ExtDateFieldFormat::SystemShort)
