diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-10 16:15:45 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-10 20:06:59 +0100 |
commit | f9e2cfc0d2e244c1550a0e2cc8de960f82eaf9cf (patch) | |
tree | 181a26cfffb85ada958ab6e8bfeba8890befeaed /svx | |
parent | 2af67c35d283abefe6030a5b90b831b0b797dd62 (diff) |
tdf#125520 create a persist correctly for OLE
If the D&D-Start described as in the task is an
OLE object we need to create a Persist-object
to copy the included EmbeddedObjectContainer
Change-Id: Ib8b9677bbc3e6c5b3895abc55e6da5b0a96e33d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90263
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index c3fccab27d74..e8c8a3218a89 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -47,6 +47,7 @@ #include <sdr/contact/objectcontactofobjlistpainter.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <svx/svdotable.hxx> +#include <sal/log.hxx> using namespace com::sun::star; @@ -735,16 +736,12 @@ std::unique_ptr<SdrModel> SdrExchangeView::CreateMarkedObjModel() const if(nullptr == pNewObj) { // not cloned yet - if (pObj->GetObjIdentifier() == OBJ_OLE2) + if(pObj->GetObjIdentifier() == OBJ_OLE2 && nullptr == mpModel->GetPersist()) { - // tdf#125520 - temp SdrModel will need a comphelper::IEmbeddedHelper - // to successfully 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 temporarily (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()); + // tdf#125520 - former fix was wrong, the SdrModel + // has to have a GetPersist() already, see task. + // We can still warn here when this is not the case + SAL_WARN( "svx", "OLE gets cloned Persist, EmbeddedObjectContainer will not be copied" ); } // use default way |