summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-29 10:06:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-29 16:48:42 +0200
commit2d2497dd3cea9ad01f7ade0b2bf4129083cd5875 (patch)
tree3c99f83a9b43cb68eabbfec5daabefca551e5f85 /vcl
parent917fadedee4459ff75e78e1b746ba320503301e0 (diff)
replace and drop MiscCfg
Change-Id: I5ea9e3663fc5d30d725cf18757badb9b9802da18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99675 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/field2.cxx8
-rw-r--r--vcl/win/window/salframe.cxx5
2 files changed, 7 insertions, 6 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index a300bf50627a..511976249c8d 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -25,6 +25,7 @@
#include <tools/diagnose_ex.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
+#include <officecfg/Office/Common.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
#include <vcl/toolkit/field.hxx>
@@ -39,7 +40,6 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/charclass.hxx>
-#include <unotools/misccfg.hxx>
using namespace ::com::sun::star;
using namespace ::comphelper;
@@ -1339,7 +1339,7 @@ bool DateFormatter::TextToDate(const OUString& rStr, Date& rDate, ExtDateFieldFo
return false;
Date aNewDate( nDay, nMonth, nYear );
- DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() );
+ DateFormatter::ExpandCentury( aNewDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get() );
if ( aNewDate.IsValidDate() )
{
rDate = aNewDate;
@@ -1411,7 +1411,7 @@ OUString DateFormatter::FormatDate(const Date& rDate, ExtDateFieldFormat eExtFor
if ( !bShowCentury )
{
// Check if I have to use force showing the century
- sal_uInt16 nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
+ sal_uInt16 nTwoDigitYearStart = officecfg::Office::Common::DateFormat::TwoDigitYear::get();
sal_uInt16 nYear = rDate.GetYearUnsigned();
// If year is not in double digit range
@@ -1948,7 +1948,7 @@ void DateFormatter::Reformat()
void DateFormatter::ExpandCentury( Date& rDate )
{
- ExpandCentury( rDate, utl::MiscCfg().GetYear2000() );
+ ExpandCentury(rDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get());
}
void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart )
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 55ddad83b743..dc7f50f4a0f7 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -21,7 +21,6 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
-#include <unotools/misccfg.hxx>
#include <officecfg/Office/Common.hxx>
@@ -2819,7 +2818,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
nValue = static_cast<sal_uLong>(ImplW2I( aValueBuf ));
if ( (nValue > 1000) && (nValue < 10000) )
{
- utl::MiscCfg().SetYear2000( static_cast<sal_Int32>(nValue-99) );
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::DateFormat::TwoDigitYear::set(static_cast<sal_Int32>(nValue-99), batch);
+ batch->commit();
}
}
}