summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview4.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-07 11:44:26 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-08 01:53:46 +0200
commit91b0d2122bdee361bf5412a42d48ff051159cbf2 (patch)
tree003ef60b93668847803a812486534ebc805e6546 /sd/source/ui/view/sdview4.cxx
parentbdccb7e9991d83029eb2f2f11327b54534a00db8 (diff)
tdf#116977 secured ::Clone methods
Renamed SdrPage::Clone -> SdrPage::CloneSdrPage Renamed SdrObject::Clone -> SdrObject::CloneSdrObject Giving SdrModel is no longer an option, but a must (as reference). This makes future changes more safe by force usage to think about it. Also equals the constructors which already require a target SdrModel. Done the same for ::CloneSdrPage. Change-Id: I06f0129e15140bd8693db27a445037d7e2f7f652 Reviewed-on: https://gerrit.libreoffice.org/53933 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'sd/source/ui/view/sdview4.cxx')
-rw-r--r--sd/source/ui/view/sdview4.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 0a8792cd8538..9d1cb05ed000 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -111,7 +111,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( bIsGraphic )
{
// We fill the object with the Bitmap
- pNewGrafObj = static_cast<SdrGrafObj*>( pPickObj->Clone() );
+ pNewGrafObj = static_cast<SdrGrafObj*>( pPickObj->CloneSdrObject(pPickObj->getSdrModelFromSdrObject()) );
pNewGrafObj->SetGraphic(rGraphic);
}
else
@@ -318,7 +318,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM
if( mnAction == DND_ACTION_LINK && pPickObj && pPV && dynamic_cast< SdrMediaObj *>( pPickObj ) != nullptr )
{
- pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() );
+ pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->CloneSdrObject(pPickObj->getSdrModelFromSdrObject()) );
pNewMediaObj->setURL( rMediaURL, ""/*TODO?*/, rMimeType );
BegUndo(SdResId(STR_UNDO_DRAGDROP));