diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2018-01-26 02:16:21 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@libreoffice.org> | 2018-01-26 23:25:16 +0100 |
commit | ced60a5fa7824caff07846d7dd8abad3c0f31b55 (patch) | |
tree | bdf5be9676c98f79bcb10cfd0903e4a36e460510 /sw/source/core/doc/docftn.cxx | |
parent | 3edf52796ef62c1734f51011fd32d8dc269fbf2d (diff) |
introduce SwClient::StartListeningToSameModifyAs
- ... as it is a common pattern
Change-Id: Ie6a9b803e1e763fb0c01d808fac107df88f79460
Reviewed-on: https://gerrit.libreoffice.org/48647
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/source/core/doc/docftn.cxx')
-rw-r--r-- | sw/source/core/doc/docftn.cxx | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 66b2587c5855..3ddfcf96c9ee 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -39,26 +39,10 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) { - if( rInfo.GetFootnoteTextColl() ) - rInfo.GetFootnoteTextColl()->Add(this); - else - EndListeningAll(); - - if ( rInfo.aPageDescDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep ); - else - aPageDescDep.EndListeningAll(); - - if ( rInfo.aCharFormatDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aCharFormatDep.GetRegisteredIn())->Add( &aCharFormatDep ); - else - aCharFormatDep.EndListeningAll(); - - if ( rInfo.aAnchorCharFormatDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aAnchorCharFormatDep.GetRegisteredIn())->Add( - &aAnchorCharFormatDep ); - else - aAnchorCharFormatDep.EndListeningAll(); + StartListeningToSameModifyAs(rInfo); + aPageDescDep.StartListeningToSameModifyAs(rInfo.aPageDescDep); + aCharFormatDep.StartListeningToSameModifyAs(rInfo.aCharFormatDep); + aAnchorCharFormatDep.StartListeningToSameModifyAs(rInfo.aAnchorCharFormatDep); aFormat = rInfo.aFormat; nFootnoteOffset = rInfo.nFootnoteOffset; @@ -95,15 +79,9 @@ SwEndNoteInfo::SwEndNoteInfo(const SwEndNoteInfo& rInfo) : aFormat( rInfo.aFormat ), nFootnoteOffset( rInfo.nFootnoteOffset ) { - if( rInfo.aPageDescDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep ); - - if( rInfo.aCharFormatDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aCharFormatDep.GetRegisteredIn())->Add( &aCharFormatDep ); - - if( rInfo.aAnchorCharFormatDep.GetRegisteredIn() ) - const_cast<SwModify*>(rInfo.aAnchorCharFormatDep.GetRegisteredIn())->Add( - &aAnchorCharFormatDep ); + aPageDescDep.StartListeningToSameModifyAs(rInfo.aPageDescDep); + aCharFormatDep.StartListeningToSameModifyAs(rInfo.aCharFormatDep); + aAnchorCharFormatDep.StartListeningToSameModifyAs(rInfo.aAnchorCharFormatDep); } SwEndNoteInfo::SwEndNoteInfo() : |