sw/source/uibase/config/usrpref.cxx | 10 +++++----- sw/source/uibase/inc/usrpref.hxx | 17 ++++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-)
New commits: commit 89ad587864893b45dfcaa881ea613216947afdb4 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Mar 7 15:59:46 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Mar 7 16:04:29 2025 +0000 Resolves: tdf#165603 zoom settings reset to default in ctor after they were loaded from the config Change-Id: Id58d997d620b00f7e7ae9a7b9d71fd628d44db8c diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 7f79d17306f7..1da3a75756b4 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -62,16 +62,16 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : m_nDefTabInMm100( 2000 ), // 2 cm m_bIsSquaredPageMode(false), m_bIsAlignMathObjectsToBaseline(false), + m_bApplyCharUnit(false), + m_bUseDefaultZoom(true), + m_nDefaultZoomValue(100), + m_eDefaultZoomType(SvxZoomType::PERCENT), m_aContentConfig(bWeb, *this), m_aLayoutConfig(bWeb, *this), m_aGridConfig(bWeb, *this), m_aCursorConfig(*this), m_pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : nullptr), - m_aFmtAidsAutoComplConfig(*this), - m_bApplyCharUnit(false), - m_bUseDefaultZoom(true), - m_nDefaultZoomValue(100), - m_eDefaultZoomType(SvxZoomType::PERCENT) + m_aFmtAidsAutoComplConfig(*this) { if (comphelper::IsFuzzing()) { diff --git a/sw/source/uibase/inc/usrpref.hxx b/sw/source/uibase/inc/usrpref.hxx index 764f52a1d457..74789e15f641 100644 --- a/sw/source/uibase/inc/usrpref.hxx +++ b/sw/source/uibase/inc/usrpref.hxx @@ -160,13 +160,6 @@ class SwMasterUsrPref : public SwViewOption bool m_bIsSquaredPageMode; //default page mode for text grid bool m_bIsAlignMathObjectsToBaseline; - SwContentViewConfig m_aContentConfig; - SwLayoutViewConfig m_aLayoutConfig; - SwGridConfig m_aGridConfig; - SwCursorConfig m_aCursorConfig; - std::unique_ptr<SwWebColorConfig> m_pWebColorConfig; - SwFmtAidsAutoComplConfig m_aFmtAidsAutoComplConfig; - bool m_bApplyCharUnit; // apply_char_unit // Scale @@ -174,6 +167,16 @@ class SwMasterUsrPref : public SwViewOption sal_uInt16 m_nDefaultZoomValue; // percent. SvxZoomType m_eDefaultZoomType; + // Note that these write to SwMasterUsrPref during their ctor + // so any members initialized after their ctor's are called + // will overwrite their loaded config settings + SwContentViewConfig m_aContentConfig; + SwLayoutViewConfig m_aLayoutConfig; + SwGridConfig m_aGridConfig; + SwCursorConfig m_aCursorConfig; + std::unique_ptr<SwWebColorConfig> m_pWebColorConfig; + SwFmtAidsAutoComplConfig m_aFmtAidsAutoComplConfig; + public: SwMasterUsrPref(bool bWeb); ~SwMasterUsrPref();