diff options
author | Release Engineers <releng@openoffice.org> | 2009-05-06 21:51:02 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-05-06 21:51:02 +0000 |
commit | fc22eceb453267c9770779e487d12d7e55620e7d (patch) | |
tree | c7a1b34bd269898d64772b13e4de4fb5a9a77cf5 /svx/source/customshapes | |
parent | 1f121b7ab0c55521c0690a430f221267aeecdcd0 (diff) |
CWS-TOOLING: integrate CWS impress168
2009-04-24 11:26:33 +0200 wg r271204 : i101157
2009-04-24 10:17:59 +0200 wg r271200 : i101157
2009-04-23 15:50:12 +0200 wg r271178 : i101157
2009-04-23 15:16:58 +0200 wg r271176 : i101157
2009-04-23 13:04:41 +0200 wg r271158 : i101157
2009-04-22 15:39:32 +0200 wg r271123 : i101157
2009-04-22 14:27:24 +0200 wg r271111 : i101157
2009-04-22 14:14:02 +0200 wg r271109 : i101157
2009-04-17 14:34:19 +0200 wg r270946 : i101157
2009-04-17 13:49:15 +0200 wg r270939 : i101157
2009-03-31 14:54:52 +0200 sj r270281 : CWS-TOOLING: rebase CWS impress168 to trunk@270033 (milestone: DEV300:m45)
2009-03-26 16:56:44 +0100 sj r270089 : removed invalid file names
2009-03-24 14:02:54 +0100 sj r269944 : CWS-TOOLING: rebase CWS impress168 to trunk@269781 (milestone: DEV300:m44)
2009-03-06 16:32:14 +0100 sj r269020 : #i99970# importing customshapes without group object, taking care of the correct text alignment
2009-02-27 13:53:24 +0100 sj r268591 : #158501,158483# fixed positioning problem of 3d customshapes
2009-02-19 16:02:00 +0100 sj r268292 : #76543# fixed interactive hyperlink program action with relativ url
2009-02-18 15:36:52 +0100 sj r268233 : #158503# added import of circular gradients for ellipse shapes
2009-02-16 19:51:54 +0100 sj r267836 : #i99146# calculating correct text bounds
2009-02-12 13:59:46 +0100 sj r267654 : #i96179# fixed bullet problem
2009-02-10 17:26:41 +0100 sj r267566 : #158476# fixed import of the ribbon shape
2009-02-10 17:10:27 +0100 cl r267561 : #i95364# fixed type detection of linked images
2009-02-09 18:31:59 +0100 cl r267531 : #i98352# removed assertion
2009-02-09 18:31:17 +0100 cl r267530 : #i98355# fixed alien attribute import for sd in binfilter
2009-02-09 18:30:53 +0100 cl r267529 : #i98355# fixed alien attribute import for sd in binfilter
2009-02-09 09:52:15 +0100 cl r267501 : #i98573# fixed build error
2009-02-06 17:02:21 +0100 sj r267476 : #i96179# fixed bullet problem
2009-02-06 14:58:39 +0100 cl r267466 : #i14832# fixed page count field for handout printing
2009-02-06 10:23:01 +0100 cl r267447 : #i98573# fixed GetEditOutlinerParaObject() memory leak
2009-02-05 18:03:34 +0100 cl r267435 : #i98573# fixed GetEditOutlinerParaObject() memory leak
2009-02-05 18:03:08 +0100 cl r267434 : #i85481# added XMultiPropertyStates to text implementations
2009-02-05 18:02:54 +0100 cl r267433 : #i85481# added XMultiPropertyStates to text implementations
2009-02-05 18:02:42 +0100 cl r267432 : #i85481# added XMultiPropertyStates to text implementations
2009-02-04 18:54:46 +0100 sj r267400 : #i33630# fixed arrow size of word import
2009-02-04 15:40:16 +0100 cl r267389 : #i58702# fixed tiled bitmap fill for vcl canvas
2009-02-04 15:39:07 +0100 cl r267388 : #i58702# fixed tiled bitmap fill for vcl canvas
2009-02-04 14:23:27 +0100 cl r267382 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject()
2009-02-04 14:22:34 +0100 cl r267381 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject()
2009-02-04 12:51:50 +0100 cl r267371 : #i14832# added Page Count field to impress
2009-02-04 12:41:31 +0100 cl r267368 : #i14832# added Page Count field to impress
Diffstat (limited to 'svx/source/customshapes')
5 files changed, 113 insertions, 55 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index bcd2a4de09..8141b548fd 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -776,33 +776,11 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : break; case mso_sptCurvedDownArrow : nFlags |= DFF_CUSTOMSHAPE_EXCH; break; case mso_sptRibbon2 : nColorData = 0x30dd0000; break; - case mso_sptRibbon : - { - if ( ( seqAdjustmentValues.getLength() > 1 ) && ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) ) - { - double fValue; - seqAdjustmentValues[ 1 ].Value >>= fValue; - fValue = 21600 - fValue; - seqAdjustmentValues[ 1 ].Value <<= fValue; - } - nFlags |= DFF_CUSTOMSHAPE_FLIP_V; - nColorData = 0x30dd0000; - } - break; + case mso_sptRibbon : nColorData = 0x30dd0000; break; + case mso_sptEllipseRibbon2 : nColorData = 0x30dd0000; break; - case mso_sptEllipseRibbon : // !!!!!!!!!! - { - if ( ( seqAdjustmentValues.getLength() > 1 ) && ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) ) - { - double fValue; - seqAdjustmentValues[ 1 ].Value >>= fValue; - fValue = 21600 - fValue; - seqAdjustmentValues[ 1 ].Value <<= fValue; - } - nFlags |= DFF_CUSTOMSHAPE_FLIP_V; - nColorData = 0x30dd0000; - } - break; + case mso_sptEllipseRibbon : nColorData = 0x30dd0000; break; + case mso_sptVerticalScroll : nColorData = 0x30dd0000; break; case mso_sptHorizontalScroll : nColorData = 0x30dd0000; break; default: diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index f2b603281d..ed94bcf075 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -534,9 +534,9 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con if ( fZRotate != 0.0 ) aNewTransform.rotate( 0.0, 0.0, fZRotate ); if ( bIsMirroredX ) - aNewTransform.scale( -1.0, 0.0, 0.0 ); + aNewTransform.scale( -1.0, 1, 1 ); if ( bIsMirroredY ) - aNewTransform.scale( 0.0, -1.0, 0.0 ); + aNewTransform.scale( 1, -1.0, 1 ); if( fYRotate != 0.0 ) aNewTransform.rotate( 0.0, -fYRotate, 0.0 ); if( fXRotate != 0.0 ) @@ -663,9 +663,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularItem( aSpecularCol ) ); pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularIntensityItem( (sal_uInt16)nIntensity ) ); -// SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer -// pScene->SetModel( pModel ); - pRet->SetSnapRect( CalculateNewSnapRect( pCustomShape, aBoundRect2d, pMap ) ); + pScene->SetLogicRect( CalculateNewSnapRect( pCustomShape, aSnapRect, aBoundRect2d, pMap ) ); // removing placeholder objects std::vector< E3dCompoundObject* >::iterator aObjectListIter( aPlaceholderObjectList.begin() ); @@ -681,10 +679,10 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con return pRet; } -Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rBoundRect, const double* pMap ) +Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap ) { SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); - const Point aCenter( pCustomShape->GetSnapRect().Center() ); + const Point aCenter( rSnapRect.Center() ); double fExtrusionBackward, fExtrusionForward; GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward ); sal_uInt32 i; @@ -717,35 +715,31 @@ Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomS double fXRotate, fYRotate; GetRotateAngle( rGeometryItem, fXRotate, fYRotate ); - double fZRotate = -(360.0-(double)pCustomShape->GetRotateAngle()/100.0) * F_PI180; - // double fRotationAngle = Fix16ToAngle( rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAngle, 0 ) ); // * F_PI180; + double fZRotate = - ((SdrObjCustomShape*)pCustomShape)->GetObjectRotation() * F_PI180; // rotating bound volume basegfx::B3DHomMatrix aMatrix; aMatrix.translate(-aRotationCenter.DirectionX, -aRotationCenter.DirectionY, -aRotationCenter.DirectionZ); - aMatrix.rotate(fXRotate, fYRotate, fZRotate); + if ( fZRotate != 0.0 ) + aMatrix.rotate( 0.0, 0.0, fZRotate ); + if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredX() ) + aMatrix.scale( -1.0, 1, 1 ); + if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredY() ) + aMatrix.scale( 1, -1.0, 1 ); + if( fYRotate != 0.0 ) + aMatrix.rotate( 0.0, fYRotate, 0.0 ); + if( fXRotate != 0.0 ) + aMatrix.rotate( -fXRotate, 0.0, 0.0 ); aMatrix.translate(aRotationCenter.DirectionX, aRotationCenter.DirectionY, aRotationCenter.DirectionZ); aBoundVolume.transform(aMatrix); -// for( i = 0L; i < 8L; i++ ) -// { -// basegfx::B3DPoint aPoint(aBoundVolume.getB3DPoint(i)); -// aPoint.setX(aPoint.getX() - aRotationCenter.DirectionX); -// aPoint.setY(aPoint.getY() - aRotationCenter.DirectionY); -// aPoint.setZ(aPoint.getZ() - aRotationCenter.DirectionZ); -// Rotate( rPoint, fXRotate, fYRotate, fZRotate ); -// aPoint.setX(aPoint.getX() + aRotationCenter.DirectionX); -// aPoint.setY(aPoint.getY() + aRotationCenter.DirectionY); -// aPoint.setZ(aPoint.getZ() + aRotationCenter.DirectionZ); -// aBoundVolume.setB3DPoint(i, aPoint); -// } - - Transformation2D aTransformation2D( pCustomShape, rBoundRect, pMap ); + Transformation2D aTransformation2D( pCustomShape, rSnapRect, pMap ); if ( aTransformation2D.IsParallel() ) aBoundVolume = aTransformation2D.ApplySkewSettings( aBoundVolume ); Polygon aTransformed( 8 ); for ( i = 0L; i < 8L; i++ ) aTransformed[ (sal_uInt16)i ] = aTransformation2D.Transform2D( aBoundVolume.getB3DPoint( i ) ); + return aTransformed.GetBoundRect(); } diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx index dc6a6d77c0..f7f4acd85a 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.hxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx @@ -70,7 +70,7 @@ class EnhancedCustomShape3d friend class Transformation2D; protected : - static Rectangle CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rBoundRect, const double* pMap ); + static Rectangle CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap ); public : static SdrObject* Create3DObject( const SdrObject* pShape2d, const SdrObject* pCustomShape ); diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index 42979df0c8..6c4e61cf49 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -188,8 +188,13 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustom // get the text bounds and set at text object Rectangle aTextBounds = pCustoObj->GetSnapRect(); - if( pCustoObj->GetTextBounds( aTextBounds ) ) - pTextObj->SetSnapRect( aTextBounds ); + SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) ); + if ( pSdrObjCustomShape ) + { + EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape ); + aTextBounds = aCustomShape2d.GetTextRect(); + } + pTextObj->SetSnapRect( aTextBounds ); // if rotated, copy GeoStat, too. const GeoStat& rSourceGeo = pCustoObj->GetGeoStat(); diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index b46bb01a0b..c39ae74bdd 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -4179,6 +4179,87 @@ static const mso_CustomShape msoRibbon2 = (SvxMSDffHandle*)mso_sptRibbon2Handle, sizeof( mso_sptRibbon2Handle ) / sizeof( SvxMSDffHandle ) }; +static const SvxMSDffVertPair mso_sptRibbonVert[] = +{ + { 0, 0 }, { 3 MSO_I, 0 }, + { 4 MSO_I, 11 MSO_I }, { 4 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I }, { 5 MSO_I, 11 MSO_I }, + { 6 MSO_I, 0 }, { 21600, 0 }, { 18 MSO_I, 14 MSO_I }, { 21600, 15 MSO_I }, { 9 MSO_I, 15 MSO_I }, { 9 MSO_I, 16 MSO_I }, { 8 MSO_I, 21600 }, { 1 MSO_I, 21600 }, + { 0 MSO_I, 16 MSO_I }, { 0 MSO_I, 15 MSO_I }, { 0, 15 MSO_I }, { 2700, 14 MSO_I }, + + { 4 MSO_I, 11 MSO_I }, + { 3 MSO_I, 12 MSO_I }, { 1 MSO_I, 12 MSO_I }, + { 0 MSO_I, 13 MSO_I }, { 1 MSO_I, 10 MSO_I }, { 4 MSO_I, 10 MSO_I }, + { 5 MSO_I, 11 MSO_I }, + { 6 MSO_I, 12 MSO_I }, { 8 MSO_I, 12 MSO_I }, + { 9 MSO_I, 13 MSO_I }, { 8 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I }, + { 0 MSO_I, 13 MSO_I }, + { 0 MSO_I, 15 MSO_I }, + { 9 MSO_I, 13 MSO_I }, + { 9 MSO_I, 15 MSO_I } +}; +static const sal_uInt16 mso_sptRibbonSegm[] = +{ + 0x4000, 0x0001, 0xa701, 0x0003, 0xa801, 0x0005, 0xa801, 0x0001, 0xa701, 0x0003, 0x6000, 0x8000, + 0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000, + 0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000, + 0x4000, 0xaa00, 0x0001, 0x8000, + 0x4000, 0xaa00, 0x0001, 0x8000 +}; +static const SvxMSDffCalculationData mso_sptRibbonCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 00 + { 0x2000, { 0x400, 675, 0 } }, // 01 + { 0x2000, { 0x401, 675, 0 } }, // 02 + { 0x2000, { 0x402, 675, 0 } }, // 03 + { 0x2000, { 0x403, 675, 0 } }, // 04 + { 0x8000, { 21600, 0, 0x404 } }, // 05 + { 0x8000, { 21600, 0, 0x403 } }, // 06 + { 0x8000, { 21600, 0, 0x402 } }, // 07 + { 0x8000, { 21600, 0, 0x401 } }, // 08 + { 0x8000, { 21600, 0, 0x400 } }, // 09 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 10 + { 0x2001, { 0x40a, 1, 4 } }, // 11 + { 0x2001, { 0x40b, 2, 1 } }, // 12 + { 0x2001, { 0x40b, 3, 1 } }, // 13 + { 0x8000, { 10800, 0, 0x40c } }, // 14 + { 0x8000, { 21600, 0, 0x40a } }, // 15 + { 0x8000, { 21600, 0, 0x40b } }, // 16 + { 0x0001, { 21600, 1, 2 } }, // 17 + { 0x0000, { 21600, 0, 2700 } }, // 18 + { 0x2000, { 0x411, 0, 2700 } } // 19 +}; +static const sal_Int32 mso_sptRibbonDefault[] = +{ + 2, 5400, 2700 +}; +static const SvxMSDffTextRectangles mso_sptRibbonTextRect[] = +{ + { { 0 MSO_I, 10 MSO_I }, { 9 MSO_I, 21600 } } +}; +static const SvxMSDffVertPair mso_sptRibbonGluePoints[] = +{ + { 17 MSO_I, 10 MSO_I }, { 2700, 14 MSO_I }, { 17 MSO_I, 21600 }, { 18 MSO_I, 14 MSO_I } +}; +static const SvxMSDffHandle mso_sptRibbonHandle[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE, + 0x100, 0, 10800, 10800, 2700, 8100, 0x80000000, 0x7fffffff }, + { MSDFF_HANDLE_FLAGS_RANGE, + 10800, 0x101, 10800, 10800, 0x80000000, 0x7fffffff, 0, 7200 } +}; +static const mso_CustomShape msoRibbon = +{ + (SvxMSDffVertPair*)mso_sptRibbonVert, sizeof( mso_sptRibbonVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptRibbonSegm, sizeof( mso_sptRibbonSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptRibbonCalc, sizeof( mso_sptRibbonCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptRibbonDefault, + (SvxMSDffTextRectangles*)mso_sptRibbonTextRect, sizeof( mso_sptRibbonTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + (SvxMSDffVertPair*)mso_sptRibbonGluePoints, sizeof( mso_sptRibbonGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptRibbonHandle, sizeof( mso_sptRibbonHandle ) / sizeof( SvxMSDffHandle ) +}; + static const SvxMSDffVertPair mso_sptVerticalScrollVert[] = // adjustment1 : 0 - 5400 { { 1 MSO_I, 21600 }, { 0, 11 MSO_I }, { 1 MSO_I, 12 MSO_I }, { 0 MSO_I, 12 MSO_I }, @@ -7717,9 +7798,9 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) case mso_sptSeal24 : pCustomShape = &msoSeal24; break; case mso_sptSeal32 : pCustomShape = &msoSeal32; break; case mso_sptRibbon2 : pCustomShape = &msoRibbon2; break; - case mso_sptRibbon : pCustomShape = &msoRibbon2; break; + case mso_sptRibbon : pCustomShape = &msoRibbon; break; case mso_sptEllipseRibbon2 : pCustomShape = &msoRibbon2; break; // SJ: TODO - case mso_sptEllipseRibbon : pCustomShape = &msoRibbon2; break; // SJ: TODO + case mso_sptEllipseRibbon : pCustomShape = &msoRibbon; break; // SJ: TODO case mso_sptVerticalScroll : pCustomShape = &msoVerticalScroll; break; case mso_sptHorizontalScroll : pCustomShape = &msoHorizontalScroll; break; case mso_sptFlowChartProcess : pCustomShape = &msoFlowChartProcess; break; |