summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-20 14:26:22 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-21 01:12:40 +0100
commit1840947f172c63e1bd53781be50e6a260ee3a8fa (patch)
tree5f712fadc113d51c8fce028d7f1f7956af88a6ba /sw
parent0242f8b8ff2d6b9886b410f1f45033a4d6d9ab2f (diff)
make modcfg ConfigItems listen to the config changes.
Change-Id: I9ba49ff8df463519631e698ce5916f0126c5d7b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178934 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/modcfg.hxx2
-rw-r--r--sw/source/uibase/config/modcfg.cxx46
2 files changed, 34 insertions, 14 deletions
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index 1c7e5cac0a78..3be2fba4903a 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 8fe3bca246d2..0eb74b0a0688 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(u"Office.Writer/Revision"_ustr, ConfigItemMode::ReleaseTree)
+ : ConfigItem(u"Office.Writer/Revision"_ustr)
, 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 ? u"Office.WriterWeb/Insert"_ustr : u"Office.Writer/Insert"_ustr,
- ConfigItemMode::ReleaseTree),
+ ConfigItem(bWeb ? u"Office.WriterWeb/Insert"_ustr : u"Office.Writer/Insert"_ustr),
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 ? u"Office.WriterWeb/Table"_ustr : u"Office.Writer/Table"_ustr,
- ConfigItemMode::ReleaseTree)
+ : ConfigItem(bWeb ? u"Office.WriterWeb/Table"_ustr : u"Office.Writer/Table"_ustr)
, 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(u"Office.Writer"_ustr, ConfigItemMode::ReleaseTree),
+ ConfigItem(u"Office.Writer"_ustr),
m_bDefaultFontsInCurrDocOnly(false),
m_bShowIndexPreview(false),
m_bGrfToGalleryAsLnk(true),
@@ -1167,6 +1177,7 @@ SwMiscConfig::SwMiscConfig() :
m_nMailingFormats(MailTextFormats::NONE)
{
Load();
+ EnableNotification(GetPropertyNames());
}
SwMiscConfig::~SwMiscConfig()
@@ -1194,7 +1205,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()
{
@@ -1273,9 +1287,9 @@ const Sequence<OUString>& SwCompareConfig::GetPropertyNames()
return aNames;
}
-SwCompareConfig::SwCompareConfig() :
- ConfigItem(u"Office.Writer/Comparison"_ustr, ConfigItemMode::ReleaseTree)
- ,m_bStoreRsid(true)
+SwCompareConfig::SwCompareConfig()
+ : ConfigItem(u"Office.Writer/Comparison"_ustr)
+ , m_bStoreRsid(true)
{
m_eCmpMode = SwCompareMode::Auto;
m_bUseRsid = false;
@@ -1283,6 +1297,7 @@ SwCompareConfig::SwCompareConfig() :
m_nPieceLen = 1;
Load();
+ EnableNotification(GetPropertyNames());
}
SwCompareConfig::~SwCompareConfig()
@@ -1329,4 +1344,9 @@ void SwCompareConfig::Load()
}
}
+void SwCompareConfig::Notify(const css::uno::Sequence<OUString>&)
+{
+ Load();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */