diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-12-20 16:26:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-12-20 20:28:48 +0100 |
commit | 46d0e19de898cb8712b5e8582966e58ba6e13ff1 (patch) | |
tree | 1ac035de55fde60cb38e1af4dea2241d562cb556 | |
parent | 5de080cae9bf09a2e360974e7b31567272c89798 (diff) |
use member init list and initialize before member Loads
Change-Id: Iaca646e1a36b20adb29b5ff25649d08fc7055e24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178951
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 0dd805faf57d..212b7fa02832 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -43,10 +43,21 @@ void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy) *static_cast<SwViewOption*>(this) = rCopy; } +static FieldUnit lclGetFieldUnit() +{ + if (comphelper::IsFuzzing()) + return FieldUnit::CM; + MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); + return MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; +} + SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : m_eFieldUpdateFlags(AUTOUPD_OFF), m_nLinkUpdateMode(0), + m_eUserMetric(lclGetFieldUnit()), + m_eHScrollMetric(m_eUserMetric), m_bIsHScrollMetricSet(false), + m_eVScrollMetric(m_eUserMetric), m_bIsVScrollMetricSet(false), m_nDefTabInMm100( 2000 ), // 2 cm m_bIsSquaredPageMode(false), @@ -64,16 +75,12 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : { if (comphelper::IsFuzzing()) { - m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric = FieldUnit::CM; // match defaults SetCore2Option(true, ViewOptCoreFlags2::CursorInProt); SetCore2Option(false, ViewOptCoreFlags2::HiddenPara); m_nDefTabInMm100 = 1250; return; } - MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - m_eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; - m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric; m_aLayoutConfig.Load(); m_aCursorConfig.Load(); |