[Libreoffice-commits] core.git: svx/source

Armin Le Grand (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 4 19:54:27 UTC 2020


 svx/source/svdraw/svdxcgv.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit d08d5c1857482cb3789ed2896921abeb83f4d217
Author:     Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Wed Mar 4 17:40:50 2020 +0100
Commit:     Armin Le Grand <Armin.Le.Grand at me.com>
CommitDate: Wed Mar 4 20:53:49 2020 +0100

    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 at me.com>

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);
         }
 


More information about the Libreoffice-commits mailing list