diff options
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 72 | ||||
-rw-r--r-- | sc/source/filter/html/htmlexp2.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/rtf/eeimpars.cxx | 6 |
4 files changed, 65 insertions, 18 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index cad44b77ea43..055663df4782 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -4221,7 +4221,7 @@ void XclImpChartDrawing::ConvertObjects( XclImpDffConverter& rDffConv, Reference< XDrawPageSupplier > xDrawPageSupp( rxModel, UNO_QUERY_THROW ); Reference< XDrawPage > xDrawPage( xDrawPageSupp->getDrawPage(), UNO_SET_THROW ); pSdrPage = ::GetSdrPageFromXDrawPage( xDrawPage ); - pSdrModel = pSdrPage ? pSdrPage->GetModel() : nullptr; + pSdrModel = pSdrPage ? &pSdrPage->getSdrModelFromSdrPage() : nullptr; } catch( Exception& ) { diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 94b2d0130d0b..989c9b693d0f 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -425,8 +425,7 @@ SdrObjectPtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, c else { xSdrObj = DoCreateSdrObj( rDffConv, rAnchorRect ); - if( xSdrObj ) - xSdrObj->SetModel( rDffConv.GetModel() ); + //added for exporting OCX control /* mnObjType value set should be as below table: 0x0000 Group 0x0001 Line @@ -1012,7 +1011,9 @@ std::size_t XclImpGroupObj::DoGetProgressSize() const SdrObjectPtr XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& /*rAnchorRect*/ ) const { - std::unique_ptr<SdrObjGroup, SdrObjectFree> xSdrObj( new SdrObjGroup ); + std::unique_ptr<SdrObjGroup, SdrObjectFree> xSdrObj( + new SdrObjGroup( + *GetDoc().GetDrawLayer())); // child objects in BIFF2-BIFF5 have absolute size, not needed to pass own anchor rectangle SdrObjList& rObjList = *xSdrObj->GetSubList(); // SdrObjGroup always returns existing sublist for( ::std::vector< XclImpDrawObjRef >::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt ) @@ -1080,7 +1081,11 @@ SdrObjectPtr XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) ); break; } - SdrObjectPtr xSdrObj( new SdrPathObj( OBJ_LINE, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) ); + SdrObjectPtr xSdrObj( + new SdrPathObj( + *GetDoc().GetDrawLayer(), + OBJ_LINE, + ::basegfx::B2DPolyPolygon(aB2DPolygon))); ConvertLineStyle( *xSdrObj, maLineData ); // line ends @@ -1195,7 +1200,10 @@ void XclImpRectObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI SdrObjectPtr XclImpRectObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const { - SdrObjectPtr xSdrObj( new SdrRectObj( rAnchorRect ) ); + SdrObjectPtr xSdrObj( + new SdrRectObj( + *GetDoc().GetDrawLayer(), + rAnchorRect)); ConvertRectStyle( *xSdrObj ); rDffConv.Progress(); return xSdrObj; @@ -1208,7 +1216,11 @@ XclImpOvalObj::XclImpOvalObj( const XclImpRoot& rRoot ) : SdrObjectPtr XclImpOvalObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const { - SdrObjectPtr xSdrObj( new SdrCircObj( OBJ_CIRC, rAnchorRect ) ); + SdrObjectPtr xSdrObj( + new SdrCircObj( + *GetDoc().GetDrawLayer(), + OBJ_CIRC, + rAnchorRect)); ConvertRectStyle( *xSdrObj ); rDffConv.Progress(); return xSdrObj; @@ -1280,7 +1292,13 @@ SdrObjectPtr XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const t break; } SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_SECT : OBJ_CARC; - SdrObjectPtr xSdrObj( new SdrCircObj( eObjKind, aNewRect, nStartAngle, nEndAngle ) ); + SdrObjectPtr xSdrObj( + new SdrCircObj( + *GetDoc().GetDrawLayer(), + eObjKind, + aNewRect, + nStartAngle, + nEndAngle)); ConvertFillStyle( *xSdrObj, maFillData ); ConvertLineStyle( *xSdrObj, maLineData ); rDffConv.Progress(); @@ -1358,7 +1376,11 @@ SdrObjectPtr XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, con aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, maCoords.front() ) ); // create the SdrObject SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_PATHPOLY : OBJ_PATHPLIN; - xSdrObj.reset( new SdrPathObj( eObjKind, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) ); + xSdrObj.reset( + new SdrPathObj( + *GetDoc().GetDrawLayer(), + eObjKind, + ::basegfx::B2DPolyPolygon(aB2DPolygon))); ConvertRectStyle( *xSdrObj ); } rDffConv.Progress(); @@ -1420,7 +1442,9 @@ void XclImpTextObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI SdrObjectPtr XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const { - std::unique_ptr<SdrObjCustomShape, SdrObjectFree> xSdrObj( new SdrObjCustomShape ); + std::unique_ptr<SdrObjCustomShape, SdrObjectFree> xSdrObj( + new SdrObjCustomShape( + *GetDoc().GetDrawLayer())); xSdrObj->NbcSetSnapRect( rAnchorRect ); OUString aRectType = "rectangle"; xSdrObj->MergeDefaultAttributes( &aRectType ); @@ -1710,7 +1734,12 @@ SdrObjectPtr XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const // ChartHelper::AdaptDefaultsForChart( xEmbObj ); // create the container OLE object - xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect ) ); + xSdrObj.reset( + new SdrOle2Obj( + *GetDoc().GetDrawLayer(), + svt::EmbeddedObjectRef(xEmbObj, nAspect), + aEmbObjName, + rAnchorRect)); } return xSdrObj; @@ -2953,7 +2982,11 @@ SdrObjectPtr XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, con // no OLE - create a plain picture from IMGDATA record data if( !xSdrObj && (maGraphic.GetType() != GraphicType::NONE) ) { - xSdrObj.reset( new SdrGrafObj( maGraphic, rAnchorRect ) ); + xSdrObj.reset( + new SdrGrafObj( + *GetDoc().GetDrawLayer(), + maGraphic, + rAnchorRect)); ConvertRectStyle( *xSdrObj ); } @@ -3434,9 +3467,20 @@ SdrObjectPtr XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicOb ErrCode nError = ERRCODE_NONE; namespace cssea = ::com::sun::star::embed::Aspects; sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT; - xSdrObj.reset( CreateSdrOLEFromStorage( - aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic, - rAnchorRect, aVisArea, nullptr, nError, mnOleImpFlags, nAspects, GetRoot().GetMedium().GetBaseURL()) ); + xSdrObj.reset( + CreateSdrOLEFromStorage( + GetConvData().mrSdrModel, + aStrgName, + xSrcStrg, + pDocShell->GetStorage(), + aGraphic, + rAnchorRect, + aVisArea, + nullptr, + nError, + mnOleImpFlags, + nAspects, + GetRoot().GetMedium().GetBaseURL())); } } } diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index a6b73fd76631..d6887744f517 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -165,8 +165,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) break; default: { - Graphic aGraph( SdrExchangeView::GetObjGraphic( - pDoc->GetDrawLayer(), pObject ) ); + Graphic aGraph(SdrExchangeView::GetObjGraphic(*pObject)); OUString aLinkName; WriteImage( aLinkName, aGraph, aOpt ); pE->bWritten = true; diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index d6915302aba4..e553df1130ff 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -602,7 +602,11 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab, if ( pI->pGraphic ) { tools::Rectangle aRect ( aInsertPos, aLogicSize ); - SdrGrafObj* pObj = new SdrGrafObj( *pI->pGraphic, aRect ); + SdrGrafObj* pObj = new SdrGrafObj( + *pModel, + *pI->pGraphic, + aRect); + // calling SetGraphicLink here doesn't work pObj->SetName( pI->aURL ); |