Kaydet (Commit) 09c33de8 authored tarafından Jianyuan Li's avatar Jianyuan Li

#120554# Shape Gradient MS2003 import/export Enhancement

Reported by: Jianyuan Li
Patch by: Jianyuan Li
Review by: SunYing
üst c0f38bc7
...@@ -1222,9 +1222,10 @@ class MSFILTER_DLLPUBLIC EscherPropertyContainer ...@@ -1222,9 +1222,10 @@ class MSFILTER_DLLPUBLIC EscherPropertyContainer
static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor ); static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor );
void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient ); void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & ); void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & , sal_Bool bTransparentGradient = sal_False );
void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge ); void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge ); void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge , sal_Bool bTransparentGradient = sal_False );
void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText, void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText,
const sal_Bool bIsCustomShape = sal_False, const sal_Bool bIsTextFrame = sal_True ); const sal_Bool bIsCustomShape = sal_False, const sal_Bool bIsTextFrame = sal_True );
......
...@@ -80,6 +80,7 @@ class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet ...@@ -80,6 +80,7 @@ class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet
public: public:
sal_Int32 mnFix16Angle; sal_Int32 mnFix16Angle;
sal_Bool mbRotateGranientFillWithAngle;
DffPropertyReader( const SvxMSDffManager& rManager ); DffPropertyReader( const SvxMSDffManager& rManager );
~DffPropertyReader(); ~DffPropertyReader();
...@@ -94,6 +95,7 @@ public: ...@@ -94,6 +95,7 @@ public:
void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const; void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const;
void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const; void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const;
void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const; void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const;
void ImportGradientColor( SfxItemSet& aSet, MSO_FillType eMSO_FillType, double dTrans = 1.0 , double dBackTrans = 1.0 ) const;
}; };
......
...@@ -4132,7 +4132,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag ...@@ -4132,7 +4132,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 ); aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 ); aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 ); aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001; sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) ) if ( aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line nLineFlags |= 0x10001; // draw dashed line if no line
...@@ -4191,7 +4191,7 @@ void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSo ...@@ -4191,7 +4191,7 @@ void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSo
mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_TextBox, 0xa00, rSolver ); ImplCreateShape( ESCHER_ShpInst_TextBox, 0xa00, rSolver );
if ( bFill ) if ( bFill )
rPropOpt.CreateFillProperties( mXPropSet, sal_True ); rPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() ) if ( ImplGetText() )
rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True ); rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
} }
...@@ -4353,7 +4353,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4353,7 +4353,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{ {
ImplCreateShape( eShapeType, nMirrorFlags | 0xa00, aSolverContainer ); ImplCreateShape( eShapeType, nMirrorFlags | 0xa00, aSolverContainer );
aPropOpt.CreateCustomShapeProperties( eShapeType, mXShape ); aPropOpt.CreateCustomShapeProperties( eShapeType, mXShape );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape);
if ( ImplGetText() ) if ( ImplGetText() )
{ {
if ( !aPropOpt.IsFontWork() ) if ( !aPropOpt.IsFontWork() )
...@@ -4387,7 +4387,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4387,7 +4387,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{ {
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
} }
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() ) if ( ImplGetText() )
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False ); aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
} }
...@@ -4425,7 +4425,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4425,7 +4425,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{ {
mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Ellipse, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt ImplCreateShape( ESCHER_ShpInst_Ellipse, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() ) if ( ImplGetText() )
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False ); aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
} }
...@@ -4477,7 +4477,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4477,7 +4477,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
case POLY_CHORD : case POLY_CHORD :
{ {
if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon ) ) if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon ) )
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
} }
break; break;
...@@ -4690,7 +4690,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4690,7 +4690,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
maRect = ImplMapRectangle( aNewRect ); maRect = ImplMapRectangle( aNewRect );
maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() ); maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() ); maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
mnAngle = 0; mnAngle = 0;
} }
else if ( bPolyLine ) else if ( bPolyLine )
...@@ -4750,7 +4750,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4750,7 +4750,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
maRect = ImplMapRectangle( aNewRect ); maRect = ImplMapRectangle( aNewRect );
maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() ); maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() ); maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
mnAngle = 0; mnAngle = 0;
} }
else if ( ( mType == "drawing.GraphicObject" ) || ( mType == "presentation.GraphicObject" ) ) else if ( ( mType == "drawing.GraphicObject" ) || ( mType == "presentation.GraphicObject" ) )
...@@ -4863,7 +4863,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4863,7 +4863,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropertyOptions.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 ); aPropertyOptions.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropertyOptions.AddOpt( ESCHER_Prop_lineColor, 0x8000001 ); aPropertyOptions.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropertyOptions.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 ); aPropertyOptions.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
aPropertyOptions.CreateFillProperties( mXPropSet, sal_True ); aPropertyOptions.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001; sal_uInt32 nLineFlags = 0x90001;
if ( aPropertyOptions.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) ) if ( aPropertyOptions.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line nLineFlags |= 0x10001; // draw dashed line if no line
...@@ -4908,7 +4908,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4908,7 +4908,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
nPlaceHolderAtom = rLayout.nTypeOfTitle; nPlaceHolderAtom = rLayout.nTypeOfTitle;
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterTitle ); aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterTitle );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True ); aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt ); ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj ) if ( mbEmptyPresObj )
...@@ -4957,7 +4957,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -4957,7 +4957,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropOpt2.AddOpt( ESCHER_Prop_lineColor, 0x8000001 ); aPropOpt2.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90001 ); aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90001 );
aPropOpt2.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 ); aPropOpt2.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
aPropOpt2.CreateFillProperties( mXPropSet, sal_True ); aPropOpt2.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001; sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt2.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) ) if ( aPropOpt2.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line nLineFlags |= 0x10001; // draw dashed line if no line
...@@ -5006,7 +5006,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ...@@ -5006,7 +5006,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mpPptEscherEx->OpenContainer( ESCHER_SpContainer ); mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody ); aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
aPropOpt.CreateFillProperties( mXPropSet, sal_True ); aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True ); aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt ); ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj ) if ( mbEmptyPresObj )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment