diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-26 14:33:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-27 09:52:47 +0100 |
commit | c41d2eb41dc9412ca15875c6f36410cfdd06941a (patch) | |
tree | cee88b30d9dbcea383f31140e09033ef97a66fe3 /sw/source/uibase | |
parent | e0b3f75e73c1f2f0c8877e57d47f2de499839ee6 (diff) |
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.mcnamara@collabora.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
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() { |