[Libreoffice-commits] .: Branch 'ooo-build-3-2-1' - 5 commits - configure.in patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Wed Nov 3 07:54:22 PDT 2010


 configure.in                                                    |    2 
 patches/dev300/apply                                            |   11 -
 patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff |   77 +++++++
 patches/dev300/oox-pptx-import-fix-groups-2.diff                |   99 ++++++++++
 4 files changed, 184 insertions(+), 5 deletions(-)

New commits:
commit fda453dbd2c90a55bf9813b39570e92dbb0ee5f6
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Nov 2 18:38:25 2010 +0100

    make the patch apply
    
    * patches/dev300/apply:
    * patches/dev300/oox-pptx-import-fix-groups-2.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index dfa4963..bfb4022 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -411,17 +411,17 @@ reportdesigner-no-license-m16.diff
 reportdesigner-no-license.diff
 
 [ ExtensionFixes ]
-presenterscreen-no-license.diff
+#presenterscreen-no-license.diff
 presentation-minimizer-no-license.diff
 pdfimport-no-license.diff
-wiki-publisher-no-license.diff
+#wiki-publisher-no-license.diff
 
 # Fixing build breake in apache-common module when you use UTF-8 based locale in the build system
 apache-commons-build-fix-invalid-chars.diff, kami
-build-java-target-extensions.diff, i#93115, pmladek
+#build-java-target-extensions.diff, i#93115, pmladek
 
 # Fix from Andre, allows to step back one animation effect
-slideshow-effect-rewind-sdext.diff, i#48179, thorsten
+#slideshow-effect-rewind-sdext.diff, i#48179, thorsten
 
 [ Fixes ]
 # Fix from Andre, allows to step back one animation effect
diff --git a/patches/dev300/oox-pptx-import-fix-groups-2.diff b/patches/dev300/oox-pptx-import-fix-groups-2.diff
index 010ec6d..2021dec 100644
--- a/patches/dev300/oox-pptx-import-fix-groups-2.diff
+++ b/patches/dev300/oox-pptx-import-fix-groups-2.diff
@@ -34,7 +34,7 @@ diff -rup ../ooo330-m2-orig/oox/source/drawingml/shape.cxx oox/source/drawingml/
  , mpFillPropertiesPtr( pSourceShape->mpFillPropertiesPtr )
 @@ -237,45 +239,34 @@ void Shape::addChildren(
          Shape& rMaster,
-         const Theme* pTheme,
+         const ThemePtr& rxTheme,
          const Reference< XShapes >& rxShapes,
 -        const awt::Rectangle& rClientRect,
 +        const awt::Rectangle&,
@@ -94,6 +94,6 @@ diff -rup ../ooo330-m2-orig/oox/source/drawingml/shape.cxx oox/source/drawingml/
 +
 +        pShapeRect = &aShapeRect;
 +
-         (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
+         (*aIter++)->addShape( rFilterBase, rxTheme, rxShapes, pShapeRect, pShapeMap );
      }
  }
commit 64fbda9b7a9da35fdba7417326130724eeddb7ef
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 77e201a..dfa4963 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -4148,3 +4148,4 @@ netbook-window-decoration-update.diff, n#621116, rodo
 
 [ Fixes ]
 oox-pptx-import-fix-customshapes-and-groups.diff, n#621739, rodo
+oox-pptx-import-fix-groups-2.diff, n#619678, rodo
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 );
+     }
+ }
commit e72c78fb7287120f4228d28497bc7ca4ff3b3c2d
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Nov 2 18:15:29 2010 +0100

    make the patch apply, also remove customashape part as it needs 3.3 changes
    
    * patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff:

diff --git a/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff b/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff
index 747837b..f2e51d8 100644
--- a/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff
+++ b/patches/dev300/oox-pptx-import-fix-customshapes-and-groups.diff
@@ -21,37 +21,10 @@ diff -rup oox/inc/oox/drawingml/shape.hxx oox-broken-with-changes/inc/oox/drawin
      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(
+@@ -262,24 +262,14 @@ void Shape::addChildren(
      {
          awt::Rectangle aShapeRect;
          awt::Rectangle* pShapeRect = 0;
@@ -82,7 +55,7 @@ diff -rup oox/source/drawingml/shape.cxx oox-broken-with-changes/source/drawingm
 +            aShapeRect.Height = maSize.Height + rChild.maSize.Height - maChSize.Height;
 +            pShapeRect = &aShapeRect;
          }
-         (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
+         (*aIter++)->addShape( rFilterBase, rxTheme, 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
commit b3c07971daaf9c1dd2510c0e330547f948a813fb
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Nov 2 18:14:41 2010 +0100

    make it work with libreoffice repo
    
    * configure.in:

diff --git a/configure.in b/configure.in
index 04a4aa0..7f2e819 100644
--- a/configure.in
+++ b/configure.in
@@ -1546,7 +1546,7 @@ OOO_GIT=
 if test \( -z "$with_git" -a -f "$SRCDIR/$CVSTAG-bootstrap.tar.bz2" \) -o "$with_git" = "no"; then
     AC_MSG_RESULT([no])
 else
-    OOO_GIT="git://anongit.freedesktop.org/git/ooo-build"
+    OOO_GIT="git://anongit.freedesktop.org/git/libreoffice"
     RESULT="Clone from $OOO_GIT"
     if test -e "src/clone" ; then
         RESULT="src/clone already set up"
commit 3487993b21575fbcca4b3ecfecbecc681bff6af2
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 d728bb0..77e201a 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -4146,3 +4146,5 @@ calc-copy-manual-row-breaks.diff n#620015, bubli
 [ Netbook ]
 netbook-window-decoration-update.diff, n#621116, rodo
 
+[ 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 Libreoffice-commits mailing list