[Libreoffice-commits] core.git: sw/inc sw/source
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Tue Feb 28 09:05:59 UTC 2017
sw/inc/dcontact.hxx | 2 --
sw/source/core/draw/dcontact.cxx | 15 +++------------
2 files changed, 3 insertions(+), 14 deletions(-)
New commits:
commit ca1aa6950314dd7332a02a31171920ec45f23187
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Tue Feb 28 00:29:12 2017 +0100
fold CreateVirtObj()
- only one caller, and throwing around nacked pointers to owned objects
should be avoided anyway
Change-Id: I2ecc716a844c73e42a0838ac048caf0c20c045a1
Reviewed-on: https://gerrit.libreoffice.org/34705
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index b440d4d..468a866 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -364,8 +364,6 @@ class SwDrawContact final : public SwContact
bool operator() ( const std::unique_ptr<SwDrawVirtObj>& _pDrawVirtObj );
};
- /// method for adding/removing 'virtual' drawing object.
- SwDrawVirtObj* CreateVirtObj();
void RemoveAllVirtObjs();
void InvalidateObjs_( const bool _bUpdateSortedObjsList = false );
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index e83bfe0..fe9b058 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -746,22 +746,13 @@ SwFrame* SwDrawContact::GetAnchorFrame(SdrObject *const pDrawObj)
return const_cast<SwFrame *>(const_cast<SwDrawContact const*>(this)->GetAnchorFrame(pDrawObj));
}
-/// create a new 'virtual' drawing object.
-SwDrawVirtObj* SwDrawContact::CreateVirtObj()
-{
- maDrawVirtObjs.push_back(std::unique_ptr<SwDrawVirtObj>(new SwDrawVirtObj(*GetMaster(), *this)));
- return maDrawVirtObjs.back().get();
-}
-
/** add a 'virtual' drawing object to drawing page.
- *
- * Use an already created one, which isn't used, or create a new one.
*/
SwDrawVirtObj* SwDrawContact::AddVirtObj()
{
- auto pAddedDrawVirtObj(CreateVirtObj());
- pAddedDrawVirtObj->AddToDrawingPage();
- return pAddedDrawVirtObj;
+ maDrawVirtObjs.push_back(std::unique_ptr<SwDrawVirtObj>(new SwDrawVirtObj(*GetMaster(), *this)));
+ maDrawVirtObjs.back()->AddToDrawingPage();
+ return maDrawVirtObjs.back().get();
}
/// remove 'virtual' drawing objects and destroy them.
More information about the Libreoffice-commits
mailing list