diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-05-10 12:56:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-05-10 18:01:08 +0200 |
commit | 60901e880b215d06ab3a7d79d2041bb2c6c64a78 (patch) | |
tree | 27860c0f2a6c142cbb503387e137cfa879a32452 | |
parent | 32f40845a5b463cc45292df69f141a0011582272 (diff) |
sw: remove overloading of IDocumentContentOperations::Insert
Change-Id: I29114e7057262f8fd169927abc9d3186a4c74c0c
-rw-r--r-- | sw/inc/IDocumentContentOperations.hxx | 25 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentContentOperationsManager.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/undo/unins.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf2.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par4.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 38 |
13 files changed, 99 insertions, 59 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx index be4c084e78f9..c0becb223b1a 100644 --- a/sw/inc/IDocumentContentOperations.hxx +++ b/sw/inc/IDocumentContentOperations.hxx @@ -154,10 +154,15 @@ public: /** Insert graphic or formula. The XXXX are copied. */ - virtual SwFlyFrameFormat* Insert(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, - const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrameFormat*) = 0; - - virtual SwFlyFrameFormat* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, + virtual SwFlyFrameFormat* InsertGraphic( + const SwPaM &rRg, const OUString& rGrfName, + const OUString& rFltName, const Graphic* pGraphic, + const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, + SwFrameFormat*) = 0; + + virtual SwFlyFrameFormat* InsertGraphicObject( + const SwPaM& rRg, const GraphicObject& rGrfObj, + const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrameFormat*) = 0; /** Transpose graphic (with undo) @@ -167,14 +172,18 @@ public: /** Insert a DrawObject. The object must be already registered in DrawModel. */ - virtual SwDrawFrameFormat* InsertDrawObj( const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet& rFlyAttrSet ) = 0; + virtual SwDrawFrameFormat* InsertDrawObj( + const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet& rFlyAttrSet) = 0; /** Insert OLE-objects. */ - virtual SwFlyFrameFormat* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet) = 0; + virtual SwFlyFrameFormat* InsertEmbObject( + const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, + const SfxItemSet* pFlyAttrSet) = 0; - virtual SwFlyFrameFormat* InsertOLE(const SwPaM &rRg, const OUString& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet, - const SfxItemSet* pGrfAttrSet) = 0; + virtual SwFlyFrameFormat* InsertOLE( + const SwPaM &rRg, const OUString& rObjName, sal_Int64 nAspect, + const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet) = 0; /** Split a node at rPos (implemented only for TextNode). */ diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index da2fe6dd85b2..585c8c81afc2 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2620,7 +2620,8 @@ void DocumentContentOperationsManager::TransliterateText( m_rDoc.getIDocumentState().SetModified(); } -SwFlyFrameFormat* DocumentContentOperationsManager::Insert( const SwPaM &rRg, +SwFlyFrameFormat* DocumentContentOperationsManager::InsertGraphic( + const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, @@ -2639,7 +2640,8 @@ SwFlyFrameFormat* DocumentContentOperationsManager::Insert( const SwPaM &rRg, return pSwFlyFrameFormat; } -SwFlyFrameFormat* DocumentContentOperationsManager::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj, +SwFlyFrameFormat* DocumentContentOperationsManager::InsertGraphicObject( + const SwPaM &rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrameFormat* pFrameFormat ) @@ -2654,7 +2656,8 @@ SwFlyFrameFormat* DocumentContentOperationsManager::Insert( const SwPaM &rRg, co return pSwFlyFrameFormat; } -SwFlyFrameFormat* DocumentContentOperationsManager::Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, +SwFlyFrameFormat* DocumentContentOperationsManager::InsertEmbObject( + const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet) { sal_uInt16 nId = RES_POOLFRM_OLE; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 8bd52f04c3b5..024c895d618b 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -816,11 +816,12 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName, } } } - pFormat = GetDoc()->getIDocumentContentOperations().Insert(*pCursor, rGrfName, + pFormat = GetDoc()->getIDocumentContentOperations().InsertGraphic( + *pCursor, rGrfName, rFltName, pGraphic, pFlyAttrSet, nullptr, nullptr ); - OSL_ENSURE( pFormat, "Doc->getIDocumentContentOperations().Insert(notxt) failed." ); + OSL_ENSURE(pFormat, "IDocumentContentOperations::InsertGraphic failed."); pCursor = dynamic_cast<SwShellCursor*>(pCursor->GetNext()); } while( pCursor != pStartCursor ); @@ -855,10 +856,9 @@ SwFlyFrameFormat* SwFEShell::InsertObject( const svt::EmbeddedObjectRef& xObj, StartAllAction(); for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { - pFormat = GetDoc()->getIDocumentContentOperations().Insert(rPaM, xObj, - pFlyAttrSet ); - OSL_ENSURE( pFormat, "Doc->getIDocumentContentOperations().Insert(notxt) failed." ); - + pFormat = GetDoc()->getIDocumentContentOperations().InsertEmbObject( + rPaM, xObj, pFlyAttrSet ); + OSL_ENSURE(pFormat, "IDocumentContentOperations::InsertEmbObject failed."); } EndAllAction(); @@ -1772,7 +1772,8 @@ bool SwFEShell::ReplaceSdrObj( const OUString& rGrfName, const Graphic* pGrf ) // delete "Sdr-Object", insert the graphic instead DelSelectedObj(); - GetDoc()->getIDocumentContentOperations().Insert( *GetCursor(), rGrfName, "", pGrf, &aFrameSet, nullptr, nullptr ); + GetDoc()->getIDocumentContentOperations().InsertGraphic( + *GetCursor(), rGrfName, "", pGrf, &aFrameSet, nullptr, nullptr); EndUndo(); EndAllAction(); diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx index c1ac6dffffe3..23615fb0b408 100644 --- a/sw/source/core/inc/DocumentContentOperationsManager.hxx +++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx @@ -63,17 +63,17 @@ public: void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&) override; - SwFlyFrameFormat* Insert(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, + SwFlyFrameFormat* InsertGraphic(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrameFormat*) override; - SwFlyFrameFormat* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, + SwFlyFrameFormat* InsertGraphicObject(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrameFormat*) override; void ReRead(SwPaM&, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj) override; SwDrawFrameFormat* InsertDrawObj( const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet& rFlyAttrSet ) override; - SwFlyFrameFormat* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet) override; + SwFlyFrameFormat* InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet) override; SwFlyFrameFormat* InsertOLE(const SwPaM &rRg, const OUString& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet) override; diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index abed8436eb4c..b0b7a41b6f0f 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -418,7 +418,8 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) if( pGrfNd->IsGrfLink() ) pGrfNd->GetFileFilterNms( &sFile, &sFilter ); - rDoc.getIDocumentContentOperations().Insert( rContext.GetRepeatPaM(), sFile, sFilter, + rDoc.getIDocumentContentOperations().InsertGraphic( + rContext.GetRepeatPaM(), sFile, sFilter, &pGrfNd->GetGrf(), nullptr/* Graphics collection*/, nullptr, nullptr ); } @@ -438,7 +439,8 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) if (aCnt.StoreEmbeddedObject(rSwOLE.GetOleRef(), aName, true, OUString(), OUString())) { uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName ); - rDoc.getIDocumentContentOperations().Insert( rContext.GetRepeatPaM(), + rDoc.getIDocumentContentOperations().InsertEmbObject( + rContext.GetRepeatPaM(), svt::EmbeddedObjectRef( aNew, static_cast<SwOLENode*>(pCNd)->GetAspect() ), nullptr ); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 850a38942d27..f874b2f32469 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2844,11 +2844,12 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan (*pFilter) >>= sFltName; } - pFormat = - pGrfObj ? pDoc->getIDocumentContentOperations().Insert( aPam, *pGrfObj, &aFrameSet, &aGrSet, - pParentFrameFormat ) - : pDoc->getIDocumentContentOperations().Insert( aPam, sGraphicURL, sFltName, &aGraphic, - &aFrameSet, &aGrSet, pParentFrameFormat ); + pFormat = (pGrfObj) + ? pDoc->getIDocumentContentOperations().InsertGraphicObject( + aPam, *pGrfObj, &aFrameSet, &aGrSet, pParentFrameFormat) + : pDoc->getIDocumentContentOperations().InsertGraphic( + aPam, sGraphicURL, sFltName, &aGraphic, + &aFrameSet, &aGrSet, pParentFrameFormat); delete pGrfObj; if(pFormat) { @@ -2955,7 +2956,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan // TODO/LATER: Is it the only possible aspect here? sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; ::svt::EmbeddedObjectRef xObjRef( xIPObj, nAspect ); - pFormat2 = pDoc->getIDocumentContentOperations().Insert(aPam, xObjRef, &aFrameSet ); + pFormat2 = pDoc->getIDocumentContentOperations().InsertEmbObject( + aPam, xObjRef, &aFrameSet ); assert(pFormat2 && "Doc->Insert(notxt) failed."); pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr); @@ -2997,7 +2999,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan rPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( obj, rName ); SwFlyFrameFormat* pFrameFormat = nullptr; - pFrameFormat = pDoc->getIDocumentContentOperations().Insert( aPam, xObj, &aFrameSet ); + pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject( + aPam, xObj, &aFrameSet); pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr); pFrameFormat->Add(this); if(!m_sName.isEmpty()) diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 8e6ef04b7c65..153d1e31e346 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -709,8 +709,10 @@ IMAGE_SETEVENT: aFrameSet.Put( aFrameSize ); // passing empty sGrfNm here, means we don't want the graphic to be linked - SwFrameFormat *pFlyFormat = m_xDoc->getIDocumentContentOperations().Insert( *m_pPam, sGrfNm, aEmptyOUStr, &aGraphic, - &aFrameSet, nullptr, nullptr ); + SwFrameFormat *const pFlyFormat = + m_xDoc->getIDocumentContentOperations().InsertGraphic( + *m_pPam, sGrfNm, aEmptyOUStr, &aGraphic, + &aFrameSet, nullptr, nullptr); SwGrfNode *pGrfNd = m_xDoc->GetNodes()[ pFlyFormat->GetContent().GetContentIdx() ->GetIndex()+1 ]->GetGrfNode(); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index adc048cb3b67..154372347432 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -459,7 +459,9 @@ void SwHTMLParser::InsertEmbed() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_xDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrameSet ); + m_xDoc->getIDocumentContentOperations().InsertEmbObject(*m_pPam, + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aFrameSet); // Namen am FrameFormat setzen if( !aName.isEmpty() ) @@ -631,7 +633,7 @@ void SwHTMLParser::EndObject() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_xDoc->getIDocumentContentOperations().Insert( *m_pPam, + m_xDoc->getIDocumentContentOperations().InsertEmbObject(*m_pPam, ::svt::EmbeddedObjectRef( m_pAppletImpl->GetApplet(), embed::Aspects::MSOLE_CONTENT ), &m_pAppletImpl->GetItemSet() ); @@ -764,7 +766,7 @@ void SwHTMLParser::EndApplet() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_xDoc->getIDocumentContentOperations().Insert( *m_pPam, + m_xDoc->getIDocumentContentOperations().InsertEmbObject(*m_pPam, ::svt::EmbeddedObjectRef( m_pAppletImpl->GetApplet(), embed::Aspects::MSOLE_CONTENT ), &m_pAppletImpl->GetItemSet()); @@ -937,7 +939,9 @@ void SwHTMLParser::InsertFloatingFrame() // und in das Dok einfuegen SwFrameFormat* pFlyFormat = - m_xDoc->getIDocumentContentOperations().Insert( *m_pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrameSet ); + m_xDoc->getIDocumentContentOperations().InsertEmbObject(*m_pPam, + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aFrameSet); // den alternativen Namen setzen SwNoTextNode *pNoTextNd = diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 9623dd288355..121f605f34dd 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -3031,7 +3031,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj // as a linked graphic - if (GraphicType::NONE == eType || CanUseRemoteLink(aGrfName)) { - pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, aGrfName, OUString(), nullptr, + pRetFrameFormat = m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, aGrfName, OUString(), nullptr, &rFlySet, &aGrSet, nullptr); bDone = true; } @@ -3039,7 +3040,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj if (!bDone) { const Graphic& rGraph = pGrf->GetGraphic(); - pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), &rGraph, + pRetFrameFormat = m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, OUString(), OUString(), &rGraph, &rFlySet, &aGrSet, nullptr); } } diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 6f41f57aab17..4b42da49d882 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -368,8 +368,10 @@ SwFlyFrameFormat* SwWW8ImplReader::MakeGrafNotInContent(const WW8PicDesc& rPD, aFlySet.Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth, nHeight ) ); - SwFlyFrameFormat* pFlyFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, rFileName, OUString(), pGraph, - &aFlySet, &rGrfSet, nullptr); + SwFlyFrameFormat *const pFlyFormat = + m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, rFileName, OUString(), pGraph, + &aFlySet, &rGrfSet, nullptr); // So the frames are generated when inserted in an existing doc: if (m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() && @@ -395,7 +397,8 @@ SwFrameFormat* SwWW8ImplReader::MakeGrafInContent(const WW8_PIC& rPic, if( !pFlyFormat ) // then just as graphic { - pFlyFormat = m_rDoc.getIDocumentContentOperations().Insert( *m_pPaM, rFileName, OUString(), pGraph, &aFlySet, + pFlyFormat = m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, rFileName, OUString(), pGraph, &aFlySet, &rGrfSet, nullptr); } @@ -670,7 +673,8 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, if (!pRet) { - pRet = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), + pRet = m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, OUString(), OUString(), &rGraph, &aAttrSet, &aGrSet, nullptr ); } } diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 347c398a1b01..ac6d9d4c4525 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -300,7 +300,8 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, GraphicType::Bitmap == aGraph.GetType() ) { - pFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), &aGraph, pFlySet, + pFormat = m_rDoc.getIDocumentContentOperations().InsertGraphic( + *m_pPaM, OUString(), OUString(), &aGraph, pFlySet, pGrfSet, nullptr); } delete pTempSet; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index fd6f05de89b3..02b32af08c49 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2406,7 +2406,8 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr ) RES_FRMATR_END-1 ); aFlySet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aFlySet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); - m_pFlyFormatOfJustInsertedGraphic = m_rDoc.getIDocumentContentOperations().Insert( *m_pPaM, + m_pFlyFormatOfJustInsertedGraphic = + m_rDoc.getIDocumentContentOperations().InsertGraphic(*m_pPaM, aGrfName, OUString(), nullptr, // Graphic* diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 3a67abd2c3f8..4c06084fb6bf 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -287,9 +287,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( if( pTextCursor ) { - pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(), - ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), - &aItemSet ); + pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject( + *pTextCursor->GetPaM(), + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aItemSet); pOLENd = lcl_GetOLENode( pFrameFormat ); } @@ -590,9 +591,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::UNO_QUERY_THROW ); { - SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(), - ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), - &aItemSet ); + SwFrameFormat *const pFrameFormat = + pDoc->getIDocumentContentOperations().InsertEmbObject( + *pTextCursor->GetPaM(), + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aItemSet ); // TODO/LATER: in future may need a way to set replacement image url to the link ( may be even to the object ), needs oasis cws??? @@ -650,9 +653,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( Size( nWidth, nHeight ), MapUnit::Map100thMM ); - SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(), - ::svt::EmbeddedObjectRef( aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT ), - &aAppletImpl.GetItemSet()); + SwFrameFormat *const pFrameFormat = + pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(), + ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT), + &aAppletImpl.GetItemSet()); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) @@ -723,9 +727,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( makeAny( OUString( rMimeType ) ) ); } - SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(), - ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), - &aItemSet); + SwFrameFormat *const pFrameFormat = + pDoc->getIDocumentContentOperations().InsertEmbObject( + *pTextCursor->GetPaM(), + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aItemSet); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) @@ -874,9 +880,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra makeAny( sal_Int32( aMargin.Height() ) ) ); } - SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(), - ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), - &aItemSet); + SwFrameFormat *const pFrameFormat = + pDoc->getIDocumentContentOperations().InsertEmbObject( + *pTextCursor->GetPaM(), + ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT), + &aItemSet); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) |