diff options
author | Noel Power <noel.power@suse.com> | 2013-01-24 18:08:41 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-01-25 15:23:14 +0000 |
commit | 1f41546e5786dbd0a248c67ba4f1cba409fe05a6 (patch) | |
tree | d8226eda3ec44087a364f08cb94c6ebf55d5504b | |
parent | 32ad9111191fd4f12f03120e8f3a416ee06fb7c3 (diff) |
import page/cell anchoring for xls drawing ( & ole ) objects fdo#58360
Change-Id: I26ee91e683f94b2fdfaadac960b840e088f1f155
-rw-r--r-- | filter/inc/filter/msfilter/msdffimp.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/inc/xiescher.hxx | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx index b798be049f25..020655ee82e5 100644 --- a/filter/inc/filter/msfilter/msdffimp.hxx +++ b/filter/inc/filter/msfilter/msdffimp.hxx @@ -312,7 +312,7 @@ struct DffObjData sal_Bool bOpt2 : 1; sal_Bool bIsAutoText : 1; sal_Bool bRotateTextWithShape : 1; - + bool bPageAnchor; int nCalledByGroup; DffObjData( const DffRecordHeader& rObjHd, @@ -331,6 +331,7 @@ struct DffObjData bOpt2( sal_False ), bIsAutoText( sal_False ), bRotateTextWithShape( sal_True ), + bPageAnchor( true ), nCalledByGroup( nClByGroup ){} }; diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 6e16f279b7fe..24a5cc6e265d 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -3407,11 +3407,17 @@ void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm, OSL_ENSURE( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffConverter::ProcessClientAnchor2 - no client anchor record" ); XclObjAnchor aAnchor; rHeader.SeekToContent( rDffStrm ); - rDffStrm.SeekRel( 2 ); // flags + sal_uInt8 nFlags(0); + rDffStrm >> nFlags; + rDffStrm.SeekRel( 1 ); // flags rDffStrm >> aAnchor; // anchor format equal to BIFF5 OBJ records + pDrawObj->SetAnchor( aAnchor ); rObjData.aChildAnchor = rConvData.mrDrawing.CalcAnchorRect( aAnchor, true ); rObjData.bChildAnchor = sal_True; + // page anchoring is the best approximation we have if mbMove + // is set + rObjData.bPageAnchor = ( nFlags & 0x1 ); } } @@ -3479,6 +3485,10 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO // process the SdrObject if( xSdrObj.is() ) { + // cell anchoring + if ( !rDffObjData.bPageAnchor ) + ScDrawLayer::SetCellAnchoredFromPosition( *xSdrObj, GetDoc(), xDrawObj->GetTab() ); + // filled without color -> set system window color if( GetPropertyBool( DFF_Prop_fFilled ) && !IsProperty( DFF_Prop_fillColor ) ) xSdrObj->SetMergedItem( XFillColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWBACK ) ) ); diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index eb99781bf62c..07655516b419 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -125,6 +125,7 @@ public: /** Additional processing for the passed SdrObject after insertion into the drawing page (calls virtual DoPostProcessSdrObj() function). */ void PostProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; + SCTAB GetTab() const { return mnTab; } protected: /** Reads the object name in a BIFF5 OBJ record. */ @@ -167,7 +168,6 @@ protected: virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; /** Derived classes may perform additional processing for the passed SdrObject after insertion. */ virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; - SCTAB GetTab() const { return mnTab; } private: /** Reads the contents of a BIFF3 OBJ record. */ void ImplReadObj3( XclImpStream& rStrm ); |