summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2020-03-04 17:40:50 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2020-03-04 20:53:49 +0100
commitd08d5c1857482cb3789ed2896921abeb83f4d217 (patch)
tree4e478b0ac3adea3d5fe45532bef59a350e36f867 /svx/source
parent8d9d6d43a9d895eb781a7fb7f47b7e4342883829 (diff)
tdf#125520 enhance internal OLE cloning
For D&D/Copy&Paste te temp SdrModel had no IEmbeddedHelper/Persist, so use the one from the source SDrModel in the temporary one for transfer/cloning. Should be okay, the persist is part of the DocumentModels, handed to the SDrModel for usage and *not* destroyed when SdrModel gets destroyed Change-Id: I46e9e371ef8802d6c1c5bfe761b26651ae6e1f73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89986 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdxcgv.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 1c5664a2602e..4ba25a6c1265 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -734,7 +734,20 @@ std::unique_ptr<SdrModel> SdrExchangeView::CreateMarkedObjModel() const
if(nullptr == pNewObj)
{
- // not cloned yet, use default way
+ // not cloned yet
+ if (pObj->GetObjIdentifier() == OBJ_OLE2)
+ {
+ // tdf#125520 - temp SdrModel will need a comphelper::IEmbeddedHelper
+ // to succesfully clone the OLE content, use the one from source model
+ // in the temporary SdrModel - it gets not deleted in SdrModel destructor.
+ // As long as the temporary SdrModel is used temprary (and does NOT get
+ // extended to a full document) this *should* work. There stay some
+ // concerns about what may happen in BG and if saved/loaded from clipboard,
+ // so this *might* need to be enhanced in the future.
+ pNewModel->SetPersist(mpModel->GetPersist());
+ }
+
+ // use default way
pNewObj = pObj->CloneSdrObject(*pNewModel);
}