diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-06 22:32:24 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-06 22:32:24 +0200 |
commit | eba4d5b2b76cefde90cb3d6638c736f435023a45 (patch) | |
tree | 43befa620475c11f3dde00e5ea141e1efd95a334 /filter/source/msfilter/msdffimp.cxx | |
parent | SOSAW080: Added first bunch of basic changes to helpers (diff) | |
download | core-eba4d5b2b76cefde90cb3d6638c736f435023a45.tar.gz core-eba4d5b2b76cefde90cb3d6638c736f435023a45.zip |
Revert "SOSAW080: Added first bunch of basic changes to helpers"
This reverts commit 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91.
Diffstat (limited to 'filter/source/msfilter/msdffimp.cxx')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 86 |
1 files changed, 32 insertions, 54 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index e958c813068c..ac281e0bfdd1 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3955,7 +3955,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons } if( !pRet ) { - pRet = new SdrGrafObj(*pSdrModel); + pRet = new SdrGrafObj; if( bGrfRead ) static_cast<SdrGrafObj*>(pRet)->SetGraphic( aGraf ); @@ -3997,6 +3997,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons pRet->SetName( aFileName ); } } + pRet->SetModel( pSdrModel ); // required for GraphicLink pRet->SetLogicRect( rObjData.aBoundRect ); if ( dynamic_cast<const SdrGrafObj* >(pRet) != nullptr ) @@ -4306,7 +4307,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r if ( aObjData.nSpFlags & ShapeFlag::Group ) { - pRet = new SdrObjGroup(*pSdrModel); + pRet = new SdrObjGroup; /* After CWS aw033 has been integrated, an empty group object cannot store its resulting bounding rectangle anymore. We have to return this rectangle via rClientRect now, but only, if @@ -4336,10 +4337,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r basegfx::B2DPolygon aPoly; aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); - pRet = new SdrPathObj( - *pSdrModel, - OBJ_LINE, - basegfx::B2DPolyPolygon(aPoly)); + pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); + pRet->SetModel( pSdrModel ); ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); } @@ -4350,7 +4349,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r ApplyAttributes( rSt, aSet, aObjData ); - pRet = new SdrObjCustomShape(*pSdrModel); + pRet = new SdrObjCustomShape(); + pRet->SetModel( pSdrModel ); sal_uInt32 ngtextFStrikethrough = GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ); bool bIsFontwork = ( ngtextFStrikethrough & 0x4000 ) != 0; @@ -4471,7 +4471,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r { SdrOutliner& rOutliner = static_cast<SdrObjCustomShape*>(pRet)->ImpGetDrawOutliner(); bool bOldUpdateMode = rOutliner.GetUpdateMode(); - rOutliner.SetStyleSheetPool(static_cast< SfxStyleSheetPool* >(pRet->getSdrModelFromSdrObject().GetStyleSheetPool())); + SdrModel* pModel = pRet->GetModel(); + if ( pModel ) + rOutliner.SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(pModel->GetStyleSheetPool()) ); rOutliner.SetUpdateMode( false ); rOutliner.SetText( *pParaObj ); ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); @@ -4733,7 +4735,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r basegfx::B2DPolyPolygon aPoly( static_cast<SdrObjCustomShape*>(pRet)->GetLineGeometry( true ) ); SdrObject::Free( pRet ); - pRet = new SdrEdgeObj(*pSdrModel); + pRet = new SdrEdgeObj(); ApplyAttributes( rSt, aSet, aObjData ); pRet->SetLogicRect( aObjData.aBoundRect ); pRet->SetMergedItemSet(aSet); @@ -5233,10 +5235,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, } } - pTextObj = new SdrRectObj( - *pSdrModel, - OBJ_TEXT, - rTextRect); + pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect); pTextImpRec = new SvxMSDffImportRec(*pImpRec); bDeleteTextImpRec = true; @@ -5365,6 +5364,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, } pTextObj->SetMergedItemSet(aSet); + pTextObj->SetModel(pSdrModel); if (bVerticalText) pTextObj->SetVerticalWriting(true); @@ -5397,7 +5397,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, { if( pTextObj != pObj ) { - SdrObject* pGroup = new SdrObjGroup(*pSdrModel); + SdrObject* pGroup = new SdrObjGroup; pGroup->GetSubList()->NbcInsertObject( pObj ); pGroup->GetSubList()->NbcInsertObject( pTextObj ); if (pOrgObj == pObj) @@ -5413,11 +5413,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, // simple rectangular objects are ignored by ImportObj() :-( // this is OK for Draw but not for Calc and Writer // cause here these objects have a default border - pObj = new SdrRectObj( - *pSdrModel, - rTextRect); - + pObj = new SdrRectObj(rTextRect); pOrgObj = pObj; + pObj->SetModel( pSdrModel ); SfxItemSet aSet( pSdrModel->GetItemPool() ); ApplyAttributes( rSt, aSet, rObjData ); @@ -6617,19 +6615,9 @@ SdrObject* SvxMSDffManager::ImportOLE( sal_uInt32 nOLEId, ErrCode nError = ERRCODE_NONE; uno::Reference < embed::XStorage > xDstStg; if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg )) - pRet = CreateSdrOLEFromStorage( - *GetModel(), - sStorageName, - xSrcStg, - xDstStg, - rGrf, - rBoundRect, - rVisArea, - pStData, - nError, - nSvxMSDffOLEConvFlags, - embed::Aspects::MSOLE_CONTENT, - maBaseURL); + pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg, + rGrf, rBoundRect, rVisArea, pStData, nError, + nSvxMSDffOLEConvFlags, embed::Aspects::MSOLE_CONTENT, maBaseURL); return pRet; } @@ -7118,18 +7106,17 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo // TODO/MBA: code review and testing! SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( - SdrModel& rSdrModel, - const OUString& rStorageName, - tools::SvRef<SotStorage> const & rSrcStorage, - const uno::Reference < embed::XStorage >& xDestStorage, - const Graphic& rGrf, - const tools::Rectangle& rBoundRect, - const tools::Rectangle& rVisArea, - SvStream* pDataStrm, - ErrCode& rError, - sal_uInt32 nConvertFlags, - sal_Int64 nRecommendedAspect, - OUString const& rBaseURL) + const OUString& rStorageName, + tools::SvRef<SotStorage> const & rSrcStorage, + const uno::Reference < embed::XStorage >& xDestStorage, + const Graphic& rGrf, + const tools::Rectangle& rBoundRect, + const tools::Rectangle& rVisArea, + SvStream* pDataStrm, + ErrCode& rError, + sal_uInt32 nConvertFlags, + sal_Int64 nRecommendedAspect, + OUString const& rBaseURL) { sal_Int64 nAspect = nRecommendedAspect; SdrOle2Obj* pRet = nullptr; @@ -7197,12 +7184,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( aObj.SetGraphic( rGrf, OUString() ); // TODO/MBA: check setting of PersistName - pRet = new SdrOle2Obj( - rSdrModel, - aObj, - OUString(), - rBoundRect); - + pRet = new SdrOle2Obj( aObj, OUString(), rBoundRect); // we have the Object, don't create another bValidStorage = false; } @@ -7298,11 +7280,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( // TODO/LATER: need MediaType aObj.SetGraphic( rGrf, OUString() ); - pRet = new SdrOle2Obj( - rSdrModel, - aObj, - aDstStgName, - rBoundRect); + pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect); } } } |