diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-12-20 14:26:22 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2025-01-07 08:26:42 +0100 |
commit | 3fc2a888e0abd3a78bff22522508491700533b88 (patch) | |
tree | 3ad38db46fd60fbd86114eb4c43b42fb6672bce3 | |
parent | 1ea2adc8bab592402ebd12a51c1588170b0c59bf (diff) |
make modcfg ConfigItems listen to the config changes.
Change-Id: I9ba49ff8df463519631e698ce5916f0126c5d7b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178932
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r-- | sw/inc/modcfg.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/config/modcfg.cxx | 46 |
2 files changed, 34 insertions, 14 deletions
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index 16862c5536c7..9299159ab24e 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -110,7 +110,7 @@ public: SwCompareConfig(); virtual ~SwCompareConfig() override; - virtual void Notify( const css::uno::Sequence< OUString >& ) override { }; + virtual void Notify( const css::uno::Sequence< OUString >& ) override; void Load(); using ConfigItem::SetModified; }; diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index ff36e0a3e1fa..2af9fe156460 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -230,7 +230,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() } SwRevisionConfig::SwRevisionConfig() - : ConfigItem("Office.Writer/Revision", ConfigItemMode::ReleaseTree) + : ConfigItem("Office.Writer/Revision") , m_nMarkAlign(0) { m_aInsertAttr.m_nItemId = SID_ATTR_CHAR_UNDERLINE; @@ -245,6 +245,7 @@ SwRevisionConfig::SwRevisionConfig() m_aFormatAttr.m_nAttr = WEIGHT_BOLD; m_aFormatAttr.m_nColor = COL_BLACK; Load(); + EnableNotification(GetPropertyNames()); } SwRevisionConfig::~SwRevisionConfig() @@ -277,7 +278,10 @@ static sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr) return nRet; } -void SwRevisionConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwRevisionConfig::Notify(const css::uno::Sequence<OUString>&) +{ + Load(); +} void SwRevisionConfig::ImplCommit() { @@ -561,8 +565,7 @@ const Sequence<OUString>& SwInsertConfig::GetPropertyNames() const } SwInsertConfig::SwInsertConfig(bool bWeb) : - ConfigItem(bWeb ? OUString("Office.WriterWeb/Insert") : OUString("Office.Writer/Insert"), - ConfigItemMode::ReleaseTree), + ConfigItem(bWeb ? OUString("Office.WriterWeb/Insert") : OUString("Office.Writer/Insert")), m_bInsWithCaption( false ), m_bCaptionOrderNumberingFirst( false ), m_aInsTableOpts(SwInsertTableFlags::NONE,0), @@ -577,6 +580,7 @@ SwInsertConfig::SwInsertConfig(bool bWeb) : m_pCapOptions.reset(new InsCaptionOptArr); Load(); + EnableNotification(GetPropertyNames()); } SwInsertConfig::~SwInsertConfig() @@ -602,7 +606,10 @@ static void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nPro } } -void SwInsertConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwInsertConfig::Notify(const css::uno::Sequence<OUString>&) +{ + Load(); +} void SwInsertConfig::ImplCommit() { @@ -1083,8 +1090,7 @@ const Sequence<OUString>& SwTableConfig::GetPropertyNames() } SwTableConfig::SwTableConfig(bool bWeb) - : ConfigItem(bWeb ? OUString("Office.WriterWeb/Table") : OUString("Office.Writer/Table"), - ConfigItemMode::ReleaseTree) + : ConfigItem(bWeb ? OUString("Office.WriterWeb/Table") : OUString("Office.Writer/Table")) , m_nTableHMove(0) , m_nTableVMove(0) , m_nTableHInsert(0) @@ -1096,13 +1102,17 @@ SwTableConfig::SwTableConfig(bool bWeb) , m_bSplitVerticalByDefault(false) { Load(); + EnableNotification(GetPropertyNames()); } SwTableConfig::~SwTableConfig() { } -void SwTableConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwTableConfig::Notify(const css::uno::Sequence<OUString>&) +{ + Load(); +} void SwTableConfig::ImplCommit() { @@ -1156,7 +1166,7 @@ void SwTableConfig::Load() } SwMiscConfig::SwMiscConfig() : - ConfigItem("Office.Writer", ConfigItemMode::ReleaseTree), + ConfigItem("Office.Writer"), m_bDefaultFontsInCurrDocOnly(false), m_bShowIndexPreview(false), m_bGrfToGalleryAsLnk(true), @@ -1168,6 +1178,7 @@ SwMiscConfig::SwMiscConfig() : m_nMailingFormats(MailTextFormats::NONE) { Load(); + EnableNotification(GetPropertyNames()); } SwMiscConfig::~SwMiscConfig() @@ -1196,7 +1207,10 @@ const Sequence<OUString>& SwMiscConfig::GetPropertyNames() return aNames; } -void SwMiscConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwMiscConfig::Notify(const css::uno::Sequence<OUString>&) +{ + EnableNotification(GetPropertyNames()); +} void SwMiscConfig::ImplCommit() { @@ -1277,9 +1291,9 @@ const Sequence<OUString>& SwCompareConfig::GetPropertyNames() return aNames; } -SwCompareConfig::SwCompareConfig() : - ConfigItem("Office.Writer/Comparison", ConfigItemMode::ReleaseTree) - ,m_bStoreRsid(true) +SwCompareConfig::SwCompareConfig() + : ConfigItem("Office.Writer/Comparison") + , m_bStoreRsid(true) { m_eCmpMode = SwCompareMode::Auto; m_bUseRsid = false; @@ -1287,6 +1301,7 @@ SwCompareConfig::SwCompareConfig() : m_nPieceLen = 1; Load(); + EnableNotification(GetPropertyNames()); } SwCompareConfig::~SwCompareConfig() @@ -1333,4 +1348,9 @@ void SwCompareConfig::Load() } } +void SwCompareConfig::Notify(const css::uno::Sequence<OUString>&) +{ + Load(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |