summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx4
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx2
2 files changed, 4 insertions, 2 deletions
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 500488aaa39c..8ddfd08f3578 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -165,7 +165,9 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
pView->hideMarkHandles();
SdrPageView* pPageView = pView->ShowSdrPage(pPage);
- pObj=pObj->Clone();
+ // directly clone to target SdrModel
+ pObj = pObj->CloneSdrObject(*pModel);
+
pPage->NbcInsertObject(pObj);
pView->MarkObj(pObj,pPageView);
if( pSymbolShapeProperties )
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 3c361e923333..8c19e816dad4 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -398,7 +398,7 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
{
SdrObject* pObj(aIter.Next());
// Clone to new SdrModel
- SdrObject* pNewObj(pObj ? pObj->Clone(&pDrawModelWrapper->getSdrModel()) : nullptr);
+ SdrObject* pNewObj(pObj ? pObj->CloneSdrObject(pDrawModelWrapper->getSdrModel()) : nullptr);
if ( pNewObj )
{