sw/source/uibase/config/usrpref.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit c41d2eb41dc9412ca15875c6f36410cfdd06941a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Nov 26 14:33:00 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Nov 27 09:52:47 2024 +0100 Allow toggling grid options on/off via config to update writer SwGridConfig ConfigItem didn't listen to the config changes. Note that after this, while toggling e.g. VisibleGrid on/off in expert settings doesn't initially appear to do a whole pile, it does affect newly created documents, while before this change it does not. Existing documents don't update to use that config. Toggling this on/off via the explicit Show Grid ends up in SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView) with something of a bodge to determine the current SwView in order to affect the document the setting dialog is launched from, which is why it changes the current document, and new documents, but not any other open documents. Change-Id: Ic57e89e3aa9765ad3c4374ddf02ed718382cf518 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177349 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 48e63388a31f..0dd805faf57d 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -76,7 +76,6 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric; m_aLayoutConfig.Load(); - m_aGridConfig.Load(); m_aCursorConfig.Load(); if(m_pWebColorConfig) m_pWebColorConfig->Load(); @@ -473,10 +472,11 @@ Sequence<OUString> SwGridConfig::GetPropertyNames() } SwGridConfig::SwGridConfig(bool bIsWeb, SwMasterUsrPref& rPar) : - ConfigItem(bIsWeb ? u"Office.WriterWeb/Grid"_ustr : u"Office.Writer/Grid"_ustr, - ConfigItemMode::ReleaseTree), + ConfigItem(bIsWeb ? u"Office.WriterWeb/Grid"_ustr : u"Office.Writer/Grid"_ustr), m_rParent(rPar) { + Load(); + EnableNotification(GetPropertyNames()); } SwGridConfig::~SwGridConfig() @@ -539,7 +539,10 @@ void SwGridConfig::Load() m_rParent.SetSnapSize(aSnap); } -void SwGridConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwGridConfig::Notify( const css::uno::Sequence< OUString >& ) +{ + Load(); +} Sequence<OUString> SwCursorConfig::GetPropertyNames() {