diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-11-02 12:18:46 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-11-02 15:06:04 +0100 |
commit | 4839756fcb381e37f7c4cc65e392d772b325c8b4 (patch) | |
tree | 90862893a81d1c046288f919689bd984add6c5ed /sw/source | |
parent | d0292dd0a3bd241ab073bea6f5a985b8be154d78 (diff) |
SwFieldType: ModifyNotification no more ...
Change-Id: Idb6c0a6cca5df729037067f6def5594eed2cca19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105178
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 11 |
2 files changed, 15 insertions, 8 deletions
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index ce63d378f3fd..2a8da69042cb 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -40,6 +40,7 @@ #include <authfld.hxx> #include <calbck.hxx> #include <viewsh.hxx> +#include <hints.hxx> using namespace ::com::sun::star; using namespace nsSwDocInfoSubType; @@ -144,6 +145,17 @@ void SwFieldType::PutValue( const uno::Any& , sal_uInt16 ) { } +void SwFieldType::UpdateFields() const +{ + const_cast<SwFieldType*>(this)->SwClientNotify(*this, sw::LegacyModifyHint(nullptr, nullptr)); +} + +void SwFieldType::PrintHiddenPara() +{ + const SwMsgPoolItem aHint(RES_HIDDENPARA_PRINT); + SwClientNotify(*this, sw::LegacyModifyHint(&aHint, nullptr)); +} + void SwFieldType::dumpAsXml(xmlTextWriterPtr pWriter) const { std::vector<SwFormatField*> vFields; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index cac98fffaace..95129e6b90dc 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -940,10 +940,8 @@ void SwViewShell::SetEmptyDbFieldHidesPara(bool bEmptyDbFieldHidesPara) GetDoc()->getIDocumentState().SetModified(); for (auto const & pFieldType : *GetDoc()->getIDocumentFieldsAccess().GetFieldTypes()) { - if (pFieldType->Which() == SwFieldIds::Database) - { - pFieldType->ModifyNotification(nullptr, nullptr); - } + if(pFieldType->Which() == SwFieldIds::Database) + pFieldType->UpdateFields(); } EndAction(); } @@ -2172,10 +2170,7 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) SwHiddenParaFieldType* pFieldType = static_cast<SwHiddenParaFieldType*>(GetDoc()-> getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::HiddenPara)); if( pFieldType && pFieldType->HasWriterListeners() ) - { - SwMsgPoolItem aHint( RES_HIDDENPARA_PRINT ); - pFieldType->ModifyNotification( &aHint, nullptr); - } + pFieldType->PrintHiddenPara(); bReformat = true; } if ( !bReformat && mpOpt->IsShowHiddenChar() != rOpt.IsShowHiddenChar() ) |