sw/source/uibase/config/usrpref.cxx |   10 +++++-----
 sw/source/uibase/inc/usrpref.hxx    |   17 ++++++++++-------
 2 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 8ce0b9964fc198eff0b8b4441d34b54063a2fd83
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 21:06:30 2025 +0100

    Resolves: tdf#165603 zoom settings reset to default in ctor
    
    after they were loaded from the config
    
    Change-Id: Id58d997d620b00f7e7ae9a7b9d71fd628d44db8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182635
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/config/usrpref.cxx 
b/sw/source/uibase/config/usrpref.cxx
index f6dbae1f63b2..2ca984ac948f 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();

Reply via email to