[Libreoffice-commits] core.git: sw/inc sw/source
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Tue Feb 28 08:58:13 UTC 2017
sw/inc/dcontact.hxx | 6 ++++--
sw/source/core/draw/dcontact.cxx | 12 ------------
2 files changed, 4 insertions(+), 14 deletions(-)
New commits:
commit ae181f927dfc7d18562279a49813035931667463
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Mon Feb 27 22:24:50 2017 +0100
remove const code duplication
Change-Id: If8330d3f1ce0c92122dcecfc22c32b005deffeb3
Reviewed-on: https://gerrit.libreoffice.org/34702
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 966ddc1..91800c4 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -202,7 +202,8 @@ public:
virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj ) const override;
virtual SwAnchoredObject* GetAnchoredObj( SdrObject* _pSdrObj ) override;
- virtual const SdrObject* GetMaster() const override;
+ virtual const SdrObject* GetMaster() const override
+ { return const_cast<SwFlyDrawContact*>(this)->GetMaster(); };
virtual SdrObject* GetMaster() override;
/** override methods to control Writer fly frames,
@@ -385,7 +386,8 @@ class SwDrawContact final : public SwContact
virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj ) const override;
virtual SwAnchoredObject* GetAnchoredObj( SdrObject* _pSdrObj ) override;
- virtual const SdrObject* GetMaster() const override;
+ virtual const SdrObject* GetMaster() const override
+ { return const_cast<SwDrawContact*>(this)->GetMaster(); };
virtual SdrObject* GetMaster() override;
const SwFrame* GetAnchorFrame( const SdrObject* _pDrawObj = nullptr ) const;
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 713524a..f8a5eb0 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -481,11 +481,6 @@ SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj(SdrObject *const pSdrObj)
return const_cast<SwAnchoredObject *>(const_cast<SwFlyDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
}
-const SdrObject* SwFlyDrawContact::GetMaster() const
-{
- return mpMasterObj.get();
-}
-
SdrObject* SwFlyDrawContact::GetMaster()
{
return mpMasterObj.get();
@@ -723,13 +718,6 @@ SwAnchoredObject* SwDrawContact::GetAnchoredObj(SdrObject *const pSdrObj)
return const_cast<SwAnchoredObject*>(const_cast<SwDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
}
-const SdrObject* SwDrawContact::GetMaster() const
-{
- return !mbMasterObjCleared
- ? maAnchoredDrawObj.GetDrawObj()
- : nullptr;
-}
-
SdrObject* SwDrawContact::GetMaster()
{
return !mbMasterObjCleared
More information about the Libreoffice-commits
mailing list