diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-05-18 16:15:02 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-05-19 00:29:26 +0200 |
commit | e1a8338876bd161de4e9d9a4b22d4bc5335f7cee (patch) | |
tree | 4e24e44f240d2638d4163b15475da9fa4cd8cd02 /svx | |
parent | 44a468323f3f011c41f892117f418987f9c98477 (diff) |
tdf#116979 Fixed 3D operator= to correct copy/paste
Change-Id: I81483a4d23523650cd9098794dd6101253b88e1c
Reviewed-on: https://gerrit.libreoffice.org/54546
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdogrp.cxx | 19 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 5 |
3 files changed, 24 insertions, 8 deletions
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 43661be94345..01fa06cc1b37 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -423,12 +423,18 @@ E3dScene& E3dScene::operator=(const E3dScene& rSource) // call parent E3dObject::operator=(rSource); - // copy local data + // copy child SdrObjects if (rSource.GetSubList()) { CopyObjects(*rSource.GetSubList()); + + // tdf#116979: needed here, we need bSnapRectDirty to be true + // which it is after using SdrObject::operator= (see above), + // but set to false again using CopyObjects + SetRectsDirty(); } + // copy local data aCamera = rSource.aCamera; aCameraSet = rSource.aCameraSet; static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera(); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 8969b5713f24..47a71bdb9a31 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -215,11 +215,20 @@ SdrObjGroup& SdrObjGroup::operator=(const SdrObjGroup& rObj) // copy SdrObject stuff SdrObject::operator=(rObj); - // #i36404# - // copy SubList, init model and page first - SdrObjList& rSourceSubList = *rObj.GetSubList(); - maSdrObjList.SetPage(rSourceSubList.GetPage()); - maSdrObjList.CopyObjects(*rObj.GetSubList()); + // copy child SdrObjects + if(nullptr != rObj.GetSubList()) + { + // #i36404# Copy SubList, init model and page first + const SdrObjList& rSourceSubList(*rObj.GetSubList()); + + maSdrObjList.SetPage(rSourceSubList.GetPage()); + maSdrObjList.CopyObjects(rSourceSubList); + + // tdf#116979: needed here, we need bSnapRectDirty to be true + // which it is after using SdrObject::operator= (see above), + // but set to false again using CopyObjects + SetRectsDirty(); + } // copy local parameters aRefPoint = rObj.aRefPoint; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 686a1b76e5d1..9469e79843a1 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1014,8 +1014,9 @@ SdrTextObj& SdrTextObj::operator=(const SdrTextObj& rObj) { if( this == &rObj ) return *this; - // call parent - SdrObject::operator=(rObj); + + // call parent. tdf#116979: use the correct parent class + SdrAttrObj::operator=(rObj); maRect = rObj.maRect; aGeo =rObj.aGeo; |