[ooo-build-commit] .: patches/dev300
Radek DoulÃk
rodo at kemper.freedesktop.org
Fri Aug 13 09:26:47 PDT 2010
patches/dev300/apply | 2
patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff | 104 ++++++++++
2 files changed, 106 insertions(+)
New commits:
commit 633bfee976edf07e663c27f173998a7e5fe9f429
Author: Radek Doulik <rodo at novell.com>
Date: Fri Aug 13 18:24:11 2010 +0200
partial fix for n#621739
- fixes untis translation from EMU for custom shapes adjustment guides
- fixes group shapes geometry calculation
* patches/dev300/apply:
* patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 14e1b7a..15efb81 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3667,3 +3667,5 @@ oox-ooo330-import-fix.diff, muthusuba
[ CalcFixes >= ooo330-m2 ]
sc-ooo330-m2-fixes.diff, muthusuba
+[ Fixes ]
+oox-pptx-import-fix-customshapes-and-groups.diff, n#621739, rodo
diff --git a/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff b/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff
new file mode 100644
index 0000000..747837b
--- /dev/null
+++ b/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff
@@ -0,0 +1,104 @@
+diff -rup oox/inc/oox/drawingml/shape.hxx oox-broken-with-changes/inc/oox/drawingml/shape.hxx
+--- oox/inc/oox/drawingml/shape.hxx 2010-08-13 18:05:48.000000000 +0200
++++ oox-broken-with-changes/inc/oox/drawingml/shape.hxx 2010-08-13 13:43:49.000000000 +0200
+@@ -127,6 +127,9 @@ public:
+ void setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
+ const com::sun::star::awt::Size& getSize() const { return maSize; }
+
++ void setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
++ void setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
++
+ void setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
+ void setFlip( sal_Bool bFlipH, sal_Bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
+ void addChild( const ShapePtr pChildPtr ) { maChildren.push_back( pChildPtr ); }
+@@ -198,6 +201,9 @@ protected:
+ ShapeIdMap* pShapeMap );
+
+ std::vector< ShapePtr > maChildren; // only used for group shapes
++ com::sun::star::awt::Size maChSize; // only used for group shapes
++ com::sun::star::awt::Point maChPosition; // only used for group shapes
++
+ TextBodyPtr mpTextBody;
+ LinePropertiesPtr mpLinePropertiesPtr;
+ FillPropertiesPtr mpFillPropertiesPtr;
+diff -rup oox/source/drawingml/customshapegeometry.cxx oox-broken-with-changes/source/drawingml/customshapegeometry.cxx
+--- oox/source/drawingml/customshapegeometry.cxx 2010-08-13 18:05:48.000000000 +0200
++++ oox-broken-with-changes/source/drawingml/customshapegeometry.cxx 2010-08-12 16:09:04.000000000 +0200
+@@ -403,7 +403,7 @@ static EnhancedCustomShapeParameter GetA
+ }
+ if ( ( n >= '0' ) && ( n <= '9' ) )
+ { // seems to be a ST_Coordinate
+- aRet.Value = Any( rValue.toInt32() );
++ aRet.Value = Any( (sal_Int32)(rValue.toInt32() / 5) );
+ aRet.Type = EnhancedCustomShapeParameterType::NORMAL;
+ }
+ else
+diff -rup oox/source/drawingml/customshapeproperties.cxx oox-broken-with-changes/source/drawingml/customshapeproperties.cxx
+--- oox/source/drawingml/customshapeproperties.cxx 2010-08-13 18:05:48.000000000 +0200
++++ oox-broken-with-changes/source/drawingml/customshapeproperties.cxx 2010-08-12 16:20:12.000000000 +0200
+@@ -131,6 +131,11 @@ void CustomShapeProperties::pushToPropSe
+ aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
+ aAdjustmentSeq[ nAdjustmentIndex ] = aAdjustmentVal;
+ }
++ } else {
++ EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
++ aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32();
++ aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
++ aAdjustmentSeq[ 0 ] = aAdjustmentVal;
+ }
+ aIter++;
+ }
+diff -rup oox/source/drawingml/shape.cxx oox-broken-with-changes/source/drawingml/shape.cxx
+--- oox/source/drawingml/shape.cxx 2010-08-13 18:05:48.000000000 +0200
++++ oox-broken-with-changes/source/drawingml/shape.cxx 2010-08-13 18:06:54.000000000 +0200
+@@ -267,24 +267,14 @@ void Shape::addChildren(
+ {
+ awt::Rectangle aShapeRect;
+ awt::Rectangle* pShapeRect = 0;
+- if ( ( nGlobalLeft != SAL_MAX_INT32 ) && ( nGlobalRight != SAL_MIN_INT32 ) && ( nGlobalTop != SAL_MAX_INT32 ) && ( nGlobalBottom != SAL_MIN_INT32 ) )
+- {
+- sal_Int32 nGlobalWidth = nGlobalRight - nGlobalLeft;
+- sal_Int32 nGlobalHeight = nGlobalBottom - nGlobalTop;
+- if ( nGlobalWidth && nGlobalHeight )
+- {
+- double fWidth = (*aIter)->maSize.Width;
+- double fHeight= (*aIter)->maSize.Height;
+- double fXScale = (double)rClientRect.Width / (double)nGlobalWidth;
+- double fYScale = (double)rClientRect.Height / (double)nGlobalHeight;
+- aShapeRect.X = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.X - nGlobalLeft ) * fXScale ) + rClientRect.X );
+- aShapeRect.Y = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.Y - nGlobalTop ) * fYScale ) + rClientRect.Y );
+- fWidth *= fXScale;
+- fHeight *= fYScale;
+- aShapeRect.Width = static_cast< sal_Int32 >( fWidth );
+- aShapeRect.Height = static_cast< sal_Int32 >( fHeight );
+- pShapeRect = &aShapeRect;
+- }
++ Shape& rChild = *(*aIter);
++
++ if ( rChild.maSize.Width != maSize.Width || rChild.maSize.Height != maSize.Height || rChild.maPosition.X != maPosition.X || rChild.maPosition.Y != maPosition.Y ) {
++ aShapeRect.X = maPosition.X + rChild.maPosition.X - maChPosition.X;
++ aShapeRect.Y = maPosition.Y + rChild.maPosition.Y - maChPosition.Y;
++ aShapeRect.Width = maSize.Width + rChild.maSize.Width - maChSize.Width;
++ aShapeRect.Height = maSize.Height + rChild.maSize.Height - maChSize.Height;
++ pShapeRect = &aShapeRect;
+ }
+ (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
+ }
+diff -rup oox/source/drawingml/transform2dcontext.cxx oox-broken-with-changes/source/drawingml/transform2dcontext.cxx
+--- oox/source/drawingml/transform2dcontext.cxx 2010-08-13 18:05:47.000000000 +0200
++++ oox-broken-with-changes/source/drawingml/transform2dcontext.cxx 2010-08-13 13:42:16.000000000 +0200
+@@ -64,11 +64,12 @@ Reference< XFastContextHandler > Transfo
+ case NMSP_DRAWINGML|XML_ext: // horz/vert size
+ mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
+ break;
+-/* todo: what to do?
+ case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children
++ mrShape.setChildPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) );
++ break;
+ case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children
++ mrShape.setChildSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
+ break;
+-*/
+ }
+
+ return 0;
More information about the ooo-build-commit
mailing list