summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfun7.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/viewfun7.cxx')
-rw-r--r--sc/source/ui/view/viewfun7.cxx21
1 files changed, 6 insertions, 15 deletions
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index cfbd4bed996f..e1f521ce992f 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -153,12 +153,11 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
const SdrMark* pM=aMark.GetMark(nm);
const SdrObject* pObj=pM->GetMarkedSdrObj();
- // Directly Clone to taget SdrModel
- SdrObject* pNewObj(pObj->Clone(pDrawModel));
+ SdrObject* pNewObj=pObj->Clone();
if (pNewObj!=nullptr)
{
- // pNewObj->SetModel(pDrawModel);
+ pNewObj->SetModel(pDrawModel);
pNewObj->SetPage(pDestPage);
// copy graphics within the same model - always needs new name
@@ -194,9 +193,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
else
{
bPasteIsMove = false; // no internal move happened
- // TTTT hide all non-direct SdrView constr to disable construct
- // in-between classes in one of the next steps (!)
- SdrView aView(*pModel); // #i71529# never create a base class of SdrView directly!
+
+ SdrView aView(pModel); // #i71529# never create a base class of SdrView directly!
SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
aView.MarkAllObj(pPv);
Size aSize = aView.GetAllMarkedRect().GetSize();
@@ -355,11 +353,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
tools::Rectangle aRect( aInsPos, aSize );
ScDrawView* pDrView = GetScDrawView();
- SdrOle2Obj* pSdrObj = new SdrOle2Obj(
- pDrView->getSdrModelFromSdrView(),
- aObjRef,
- aName,
- aRect);
+ SdrOle2Obj* pSdrObj = new SdrOle2Obj( aObjRef, aName, aRect );
SdrPageView* pPV = pDrView->GetSdrPageView();
pDrView->InsertObjectSafe( pSdrObj, *pPV ); // don't mark if OLE
@@ -438,10 +432,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
GetViewData().GetViewShell()->SetDrawShell( true );
tools::Rectangle aRect(aPos, aSize);
- SdrGrafObj* pGrafObj = new SdrGrafObj(
- pScDrawView->getSdrModelFromSdrView(),
- rGraphic,
- aRect);
+ SdrGrafObj* pGrafObj = new SdrGrafObj(rGraphic, aRect);
// path was the name of the graphic in history