[Libreoffice-commits] core.git: sw/source
Bjoern Michaelsen (via logerrit)
logerrit at kemper.freedesktop.org
Thu Oct 29 19:10:46 UTC 2020
sw/source/core/doc/DocumentFieldsManager.cxx | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 2ae0d2a21778634f085e5bccd73e88e8b96fc69a
Author: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Wed Oct 28 22:34:56 2020 +0100
Commit: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Thu Oct 29 20:10:07 2020 +0100
DocumentFieldsManager: remove calls to obsolete functions
- calling ModifyNotification directly is bad
- instead use SwClientNotify
- and also remove code duplication into a local function
Change-Id: Ib715db581a7d85fbf0074a5b33d2e668a6af40e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104980
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index d322463e6a9a..84769b8ec16e 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -179,6 +179,11 @@ namespace
#endif
}
}
+ void lcl_SwClientNotify(SwModify& rModify, const SfxPoolItem* pNew)
+ {
+ const sw::LegacyModifyHint aHint(nullptr, pNew);
+ rModify.SwClientNotify(rModify, aHint);
+ }
}
namespace sw
@@ -404,7 +409,7 @@ void DocumentFieldsManager::UpdateFields( bool bCloseDB )
case SwFieldIds::Dde:
{
SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL );
- pFieldType->ModifyNotification( nullptr, &aUpdateDDE );
+ lcl_SwClientNotify(*pFieldType, &aUpdateDDE );
break;
}
case SwFieldIds::GetExp:
@@ -414,7 +419,7 @@ void DocumentFieldsManager::UpdateFields( bool bCloseDB )
// Expression fields are treated separately
break;
default:
- pFieldType->ModifyNotification ( nullptr, nullptr );
+ lcl_SwClientNotify(*pFieldType, nullptr );
}
}
@@ -562,7 +567,7 @@ bool DocumentFieldsManager::UpdateField(SwTextField * pDstTextField, SwField & r
if (bUpdateFields)
UpdateTableFields( &aTableUpdate );
else
- pNewField->GetTyp()->ModifyNotification(nullptr, &aTableUpdate);
+ lcl_SwClientNotify(*pNewField->GetTyp(), &aTableUpdate);
if (! bUpdateFields)
bTableSelBreak = true;
@@ -572,8 +577,7 @@ bool DocumentFieldsManager::UpdateField(SwTextField * pDstTextField, SwField & r
case SwFieldIds::Macro:
if( bUpdateFields && pDstTextField->GetpTextNode() )
- pDstTextField->GetpTextNode()->
- ModifyNotification( nullptr, pDstFormatField );
+ lcl_SwClientNotify(*pDstTextField->GetpTextNode(), pDstFormatField);
break;
case SwFieldIds::DatabaseName:
@@ -618,7 +622,7 @@ void DocumentFieldsManager::UpdateRefFields()
{
for( auto const & pFieldType : *mpFieldTypes )
if( SwFieldIds::GetRef == pFieldType->Which() )
- pFieldType->ModifyNotification( nullptr, nullptr );
+ lcl_SwClientNotify(*pFieldType, nullptr );
}
void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt )
@@ -1351,10 +1355,10 @@ void DocumentFieldsManager::UpdatePageFields( SfxPoolItem* pMsgHint )
case SwFieldIds::Chapter:
case SwFieldIds::GetExp:
case SwFieldIds::RefPageGet:
- pFieldType->ModifyNotification( nullptr, pMsgHint );
+ lcl_SwClientNotify(*pFieldType, pMsgHint);
break;
case SwFieldIds::DocStat:
- pFieldType->ModifyNotification( nullptr, nullptr );
+ lcl_SwClientNotify(*pFieldType, nullptr);
break;
default: break;
}
More information about the Libreoffice-commits
mailing list