[ooo-build-commit] .: patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Wed Aug 25 02:03:13 PDT 2010


 patches/dev300/apply                             |    1 
 patches/dev300/oox-pptx-import-fix-groups-2.diff |   99 +++++++++++++++++++++++
 2 files changed, 100 insertions(+)

New commits:
commit d32a2be9aa9d382e1af71b5f3dd97f0f419446a9
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Aug 25 10:59:46 2010 +0200

    fixed regression of 1st pptx import groups patch (visible in n#619678)
    
    - scale the children space
    - fix nested groups
    - clean the code
    
    * patches/dev300/apply:
    * patches/dev300/oox-pptx-import-fix-groups-2.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 7a2dbac..4736d94 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3727,6 +3727,7 @@ oox-sc-notes.diff, muthusuba
 
 [ Fixes ]
 oox-pptx-import-fix-customshapes-and-groups.diff, n#621739, rodo
+oox-pptx-import-fix-groups-2.diff, n#619678, rodo
 
 [ GSoC2010 ]
 
diff --git a/patches/dev300/oox-pptx-import-fix-groups-2.diff b/patches/dev300/oox-pptx-import-fix-groups-2.diff
new file mode 100644
index 0000000..010ec6d
--- /dev/null
+++ b/patches/dev300/oox-pptx-import-fix-groups-2.diff
@@ -0,0 +1,99 @@
+diff -rup ../ooo330-m2-orig/oox/inc/oox/drawingml/shape.hxx oox/inc/oox/drawingml/shape.hxx
+--- ../ooo330-m2-orig/oox/inc/oox/drawingml/shape.hxx	2010-08-24 20:25:50.000000000 +0200
++++ oox/inc/oox/drawingml/shape.hxx	2010-08-24 12:41:18.000000000 +0200
+@@ -203,6 +203,9 @@ protected:
+     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
++    com::sun::star::awt::Size   maAbsoluteSize;           // only used for group shapes
++    com::sun::star::awt::Point  maAbsolutePosition;       // only used for group shapes
++    sal_Bool                    mbIsChild;
+     
+     TextBodyPtr                 mpTextBody;
+     LinePropertiesPtr           mpLinePropertiesPtr;
+diff -rup ../ooo330-m2-orig/oox/source/drawingml/shape.cxx oox/source/drawingml/shape.cxx
+--- ../ooo330-m2-orig/oox/source/drawingml/shape.cxx	2010-08-24 20:25:50.000000000 +0200
++++ oox/source/drawingml/shape.cxx	2010-08-25 10:52:08.000000000 +0200
+@@ -88,7 +88,8 @@ void CreateShapeCallback::onXShapeCreate
+ // ============================================================================
+ 
+ Shape::Shape( const sal_Char* pServiceName )
+-: mpLinePropertiesPtr( new LineProperties )
++: mbIsChild( false )
++, mpLinePropertiesPtr( new LineProperties )
+ , mpFillPropertiesPtr( new FillProperties )
+ , mpGraphicPropertiesPtr( new GraphicProperties )
+ , mpCustomShapePropertiesPtr( new CustomShapeProperties )
+@@ -107,6 +108,7 @@ Shape::Shape( const sal_Char* pServiceNa
+ 
+ Shape::Shape( const ShapePtr& pSourceShape )
+ : maChildren()
++, mbIsChild( pSourceShape->mbIsChild )
+ , mpTextBody(pSourceShape->mpTextBody)
+ , mpLinePropertiesPtr( pSourceShape->mpLinePropertiesPtr )
+ , mpFillPropertiesPtr( pSourceShape->mpFillPropertiesPtr )
+@@ -237,45 +239,34 @@ void Shape::addChildren(
+         Shape& rMaster,
+         const Theme* pTheme,
+         const Reference< XShapes >& rxShapes,
+-        const awt::Rectangle& rClientRect,
++        const awt::Rectangle&,
+         ShapeIdMap* pShapeMap )
+ {
+-    // first the global child union needs to be calculated
+-    sal_Int32 nGlobalLeft  = SAL_MAX_INT32;
+-    sal_Int32 nGlobalRight = SAL_MIN_INT32;
+-    sal_Int32 nGlobalTop   = SAL_MAX_INT32;
+-    sal_Int32 nGlobalBottom= SAL_MIN_INT32;
++    awt::Point& aPosition( mbIsChild ? maAbsolutePosition : maPosition );
++    awt::Size& aSize( mbIsChild ? maAbsoluteSize : maSize );
++
+     std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
+     while( aIter != rMaster.maChildren.end() )
+     {
+-        sal_Int32 l = (*aIter)->maPosition.X;
+-        sal_Int32 t = (*aIter)->maPosition.Y;
+-        sal_Int32 r = l + (*aIter)->maSize.Width;
+-        sal_Int32 b = t + (*aIter)->maSize.Height;
+-        if ( nGlobalLeft > l )
+-            nGlobalLeft = l;
+-        if ( nGlobalRight < r )
+-            nGlobalRight = r;
+-        if ( nGlobalTop > t )
+-            nGlobalTop = t;
+-        if ( nGlobalBottom < b )
+-            nGlobalBottom = b;
+-        aIter++;
+-    }
+-    aIter = rMaster.maChildren.begin();
+-    while( aIter != rMaster.maChildren.end() )
+-    {
+         awt::Rectangle aShapeRect;
+         awt::Rectangle* pShapeRect = 0;
+         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;
+-        }
++        double sx = ((double)aSize.Width)/maChSize.Width;
++        double sy = ((double)aSize.Height)/maChSize.Height;
++        rChild.maAbsolutePosition.X = aPosition.X + sx*(rChild.maPosition.X - maChPosition.X);
++        rChild.maAbsolutePosition.Y = aPosition.Y + sy*(rChild.maPosition.Y - maChPosition.Y);
++        rChild.maAbsoluteSize.Width = rChild.maSize.Width*sx;
++        rChild.maAbsoluteSize.Height = rChild.maSize.Height*sy;
++        rChild.mbIsChild = true;
++
++        aShapeRect.X = rChild.maAbsolutePosition.X;
++        aShapeRect.Y = rChild.maAbsolutePosition.Y;
++        aShapeRect.Width = rChild.maAbsoluteSize.Width;
++        aShapeRect.Height = rChild.maAbsoluteSize.Height;
++
++        pShapeRect = &aShapeRect;
++
+         (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
+     }
+ }


More information about the ooo-build-commit mailing list