[Libreoffice-commits] core.git: include/svx sc/source sd/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Tue Dec 22 12:15:10 PST 2015


 include/svx/svdobj.hxx           |    2 --
 include/svx/svdoole2.hxx         |    3 +--
 include/svx/svdxcgv.hxx          |    3 +--
 include/svx/view3d.hxx           |    3 +--
 sc/source/ui/app/drwtrans.cxx    |    2 +-
 sc/source/ui/view/viewfun7.cxx   |    2 +-
 sd/source/core/drawdoc3.cxx      |    2 +-
 sd/source/ui/inc/View.hxx        |    3 +--
 sd/source/ui/view/sdview2.cxx    |    5 ++---
 sd/source/ui/view/sdview3.cxx    |   10 +++++-----
 svx/source/engine3d/view3d.cxx   |    5 ++---
 svx/source/svdraw/svdobj.cxx     |    5 -----
 svx/source/svdraw/svdoole2.cxx   |   21 +++------------------
 svx/source/svdraw/svdxcgv.cxx    |    5 ++---
 sw/source/core/frmedt/fecopy.cxx |    2 +-
 sw/source/core/ole/ndole.cxx     |    4 ++--
 16 files changed, 24 insertions(+), 53 deletions(-)

New commits:
commit 0f02bc189b6e89ca2e62d4bd6a2f407a9fd4ec3b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 21 21:16:08 2015 +0000

    crashtesting: CreateShellID returns the mediums base url...
    
    when it works the way we want it to work, so presumably we can cut out the
    middle man and use getDocumentBaseURL directly which does the same thing.
    
    This has the advantage of being in the IEmbeddedHelper api so assignFrom can be
    tweaked to pull the src and dest ids arguments to CopyAndGetEmbeddedObject from
    the src and dest IEmbeddedHelpers always available there. So we ensure we
    have some ids to present to CopyAndGetEmbeddedObject, avoiding the assert
    on converting documents such as ooo89433-1.ppt to pdf
    
    So the explicit args can apparently be dropped, bubbling up then means we don't
    need a CloneWithShellIDs (introduced with tdf#71076 and tdf#71767) as normal
    Clone should now do the right thing.
    
    And various other arguments in various callers of these, which are typically
    filled in with an unhelpful empty OUString placeholder, can go
    
    Change-Id: I9c0be0340e72f98b10ee87ada7d2a021fcc39e23

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index a76cb71..8ce2fd7 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -530,8 +530,6 @@ public:
     // Note that this function uses operator= internally.
     virtual SdrObject* Clone() const;
 
-    virtual SdrObject* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const;
-
     // implemented mainly for the purposes of Clone()
     SdrObject& operator=(const SdrObject& rObj);
 
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 2d0b49d..0db2563 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -128,9 +128,8 @@ public:
     virtual OUString TakeObjNamePlural() const override;
 
     virtual SdrOle2Obj* Clone() const override;
-    virtual SdrOle2Obj* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const override;
 
-    SdrOle2Obj& assignFrom( const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID );
+    SdrOle2Obj& assignFrom(const SdrOle2Obj& rObj);
     SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
 
     virtual void NbcMove(const Size& rSize) override;
diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx
index 2faccca..0ad977b 100644
--- a/include/svx/svdxcgv.hxx
+++ b/include/svx/svdxcgv.hxx
@@ -107,8 +107,7 @@ public:
     // Valid values for nOptions are SDRINSERT_DONTMARK and SDRINSERT_ADDMARK
     // (@see svdedtv.hxx).
     virtual bool Paste(
-        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-        const OUString& rSrcShellID, const OUString& rDestShellID );
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions);
 
     bool            Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=nullptr, SdrInsertFlags nOptions=SdrInsertFlags::NONE);
     bool            Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=nullptr, SdrInsertFlags nOptions=SdrInsertFlags::NONE);
diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx
index 63da660..2f2fe08 100644
--- a/include/svx/view3d.hxx
+++ b/include/svx/view3d.hxx
@@ -98,8 +98,7 @@ public:
     // On Paste: We need to insert the objects of the Scene, but not the Scene itself
     using SdrView::Paste;
     virtual bool Paste(
-        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-        const OUString& rSrcShellID, const OUString& rDestShellID ) override;
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions) override;
 
     // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
     bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index a257bc5..56b33d1 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -735,7 +735,7 @@ void ScDrawTransferObj::InitDocShell()
         aDestView.Paste(
             *pModel,
             Point(aSrcSize.Width()/2, aSrcSize.Height()/2),
-            nullptr, SdrInsertFlags::NONE, OUString(), OUString());
+            nullptr, SdrInsertFlags::NONE);
 
         // put objects to right layer (see ScViewFunc::PasteDataFormat for SotClipboardFormatId::DRAWING)
 
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 8cf5de5..da2bdba 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -223,7 +223,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
         if ( !bSameDocClipboard )
             GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( true );
 
-        pScDrawView->Paste(*pModel, aPos, nullptr, nOptions, rSrcShellID, rDestShellID);
+        pScDrawView->Paste(*pModel, aPos, nullptr, nOptions);
 
         if ( !bSameDocClipboard )
             GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( false );
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index f63295c..41f0919 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1107,7 +1107,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
             pBMView->GetDoc().SetAllocDocSh(true);
 
         SdDrawDocument* pTmpDoc = static_cast<SdDrawDocument*>( pBMView->GetMarkedObjModel() );
-        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, SdrInsertFlags::NONE, OUString(), OUString());
+        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, SdrInsertFlags::NONE);
 
         if (bOLEObjFound)
             pBMView->GetDoc().SetAllocDocSh(false);
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 5c9aef6..5d65dda 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -183,8 +183,7 @@ public:
 
     virtual SdrModel*   GetMarkedObjModel() const override;
     virtual bool Paste(
-        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-        const OUString& rSrcShellID, const OUString& rDestShellID ) override;
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions) override;
 
     using SdrExchangeView::Paste;
 
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 9cd5e90..5caafe9 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -937,10 +937,9 @@ SdrModel* View::GetMarkedObjModel() const
 }
 
 bool View::Paste(
-    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-    const OUString& rSrcShellID, const OUString& rDestShellID )
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions)
 {
-    return FmFormView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
+    return FmFormView::Paste(rMod, rPos, pLst, nOptions);
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 2dc792a..7e5ec28 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -605,7 +605,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                     SdDrawDocument* pSourceDoc = static_cast<SdDrawDocument*>( pSourceView->GetModel() );
                     pSourceDoc->CreatingDataObj( pOwnData );
                     SdDrawDocument* pModel = static_cast<SdDrawDocument*>( pSourceView->GetMarkedObjModel() );
-                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions);
 
                     if( !pPage )
                         pPage = static_cast<SdPage*>( GetSdrPageView()->GetPage() );
@@ -646,7 +646,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                     pWorkModel->DeletePage( (sal_uInt16) i );
             }
 
-            bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
+            bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions);
 
             if( !pPage )
                 pPage = static_cast<SdPage*>( GetSdrPageView()->GetPage() );
@@ -807,7 +807,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                         maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
                     }
 
-                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions);
                 }
 
                 xShell->DoClose();
@@ -890,7 +890,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                             pModel->DeletePage( (sal_uInt16) i );
                     }
 
-                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions);
 
                     if( !pPage )
                         pPage = static_cast<SdPage*>(GetSdrPageView()->GetPage());
@@ -1515,7 +1515,7 @@ bool View::PasteRTFTable( ::tools::SvRef<SotStorageStream> xStm, SdrPage* pPage,
     pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
 
     CreateTableFromRTF( *xStm, pModel.get() );
-    bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
+    bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions);
 
     xComponent->dispose();
     xComponent.clear();
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index d7fd886..eadcd53 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -444,8 +444,7 @@ SdrModel* E3dView::GetMarkedObjModel() const
 // not the scene itself
 
 bool E3dView::Paste(
-    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-    const OUString& rSrcShellID, const OUString& rDestShellID )
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions)
 {
     bool bRetval = false;
 
@@ -490,7 +489,7 @@ bool E3dView::Paste(
     else
     {
         // call parent
-        bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
+        bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions);
     }
 
     return bRetval;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 7dd6799..d5dc3b9 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -956,11 +956,6 @@ SdrObject* SdrObject::Clone() const
     return CloneHelper< SdrObject >();
 }
 
-SdrObject* SdrObject::CloneWithShellIDs( const OUString& /*rSrcShellID*/, const OUString& /*rDestShellID*/ ) const
-{
-    return Clone();
-}
-
 SdrObject& SdrObject::operator=(const SdrObject& rObj)
 {
     if( this == &rObj )
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index e786dbf..9cb3279 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1642,27 +1642,12 @@ OUString SdrOle2Obj::TakeObjNamePlural() const
     return ImpGetResStr(mpImpl->mbFrame ? STR_ObjNamePluralFrame : STR_ObjNamePluralOLE2);
 }
 
-
-
 SdrOle2Obj* SdrOle2Obj::Clone() const
 {
     return CloneHelper< SdrOle2Obj >();
 }
 
-SdrOle2Obj* SdrOle2Obj::CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const
-{
-    SdrOle2Obj* pObj =
-        dynamic_cast<SdrOle2Obj*>(
-            SdrObjFactory::MakeNewObject(GetObjInventor(), GetObjIdentifier(), nullptr));
-
-    if (pObj)
-        pObj->assignFrom(*this, rSrcShellID, rDestShellID);
-
-    return pObj;
-}
-
-SdrOle2Obj& SdrOle2Obj::assignFrom(
-    const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID )
+SdrOle2Obj& SdrOle2Obj::assignFrom(const SdrOle2Obj& rObj)
 {
     //TODO/LATER: who takes over control of my old object?!
     if( &rObj != this )
@@ -1709,7 +1694,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
                 {
                     OUString aTmp;
                     mpImpl->mxObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
-                        rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
+                        rContainer, xObj, aTmp, pSrcPers->getDocumentBaseURL(), pDestPers->getDocumentBaseURL()), rOle2Obj.GetAspect());
                     mpImpl->mbTypeAsked = false;
                     mpImpl->aPersistName = aTmp;
                     CheckFileLink_Impl();
@@ -1724,7 +1709,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
 
 SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
 {
-    return assignFrom(rObj, OUString(), OUString());
+    return assignFrom(rObj);
 }
 
 void SdrOle2Obj::ImpSetVisAreaSize()
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 0eeedc9..2cf6bee 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -224,8 +224,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt
 }
 
 bool SdrExchangeView::Paste(
-    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions,
-    const OUString& rSrcShellID, const OUString& rDestShellID )
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions)
 {
     const SdrModel* pSrcMod=&rMod;
     if (pSrcMod==mpModel)
@@ -300,7 +299,7 @@ bool SdrExchangeView::Paste(
         {
             const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
 
-            SdrObject* pNeuObj = pSrcOb->CloneWithShellIDs(rSrcShellID, rDestShellID);
+            SdrObject* pNeuObj = pSrcOb->Clone();
 
             if (pNeuObj!=nullptr)
             {
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 55ece42..b40a0bfd 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1518,7 +1518,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt )
         // #i50824#
         // method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
         lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
-        pView->Paste(*pModel, aPos, nullptr, SdrInsertFlags::NONE, OUString(), OUString());
+        pView->Paste(*pModel, aPos, nullptr, SdrInsertFlags::NONE);
 
         const size_t nCnt = pView->GetMarkedObjectList().GetMarkCount();
         if( nCnt )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 6089e69..5db900b 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -439,8 +439,8 @@ SwContentNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
         pSrc->GetEmbeddedObjectContainer(),
         pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
         aNewName,
-        SfxObjectShell::CreateShellID(pSrc),
-        SfxObjectShell::CreateShellID(pPersistShell));
+        pSrc->getDocumentBaseURL(),
+        pPersistShell->getDocumentBaseURL());
 
     SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
                                     pDoc->GetDfltGrfFormatColl(),


More information about the Libreoffice-commits mailing list