summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/lineinfo.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-01-26 02:16:21 +0100
committerBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>2018-01-26 23:25:16 +0100
commitced60a5fa7824caff07846d7dd8abad3c0f31b55 (patch)
treebdf5be9676c98f79bcb10cfd0903e4a36e460510 /sw/source/core/doc/lineinfo.cxx
parent3edf52796ef62c1734f51011fd32d8dc269fbf2d (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/lineinfo.cxx')
-rw-r--r--sw/source/core/doc/lineinfo.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index f8599bd94f1d..3774fa3f7604 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -76,16 +76,12 @@ SwLineNumberInfo::SwLineNumberInfo(const SwLineNumberInfo &rCpy ) : SwClient(),
bCountInFlys( rCpy.IsCountInFlys() ),
bRestartEachPage( rCpy.IsRestartEachPage() )
{
- if ( rCpy.GetRegisteredIn() )
- const_cast<SwModify*>(rCpy.GetRegisteredIn())->Add( this );
+ StartListeningToSameModifyAs(rCpy);
}
SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy)
{
- if ( rCpy.GetRegisteredIn() )
- const_cast<SwModify*>(rCpy.GetRegisteredIn())->Add( this );
- else
- EndListeningAll();
+ StartListeningToSameModifyAs(rCpy);
aType = rCpy.GetNumType();
aDivider = rCpy.GetDivider();