[Libreoffice-commits] core.git: include/oox oox/source sc/source

Tamás Zolnai tamas.zolnai at collabora.com
Sat Mar 11 17:35:04 UTC 2017


 include/oox/drawingml/shape.hxx                     |    2 --
 oox/source/drawingml/chart/chartdrawingfragment.cxx |    2 +-
 oox/source/drawingml/shape.cxx                      |    8 +++-----
 oox/source/ppt/pptshape.cxx                         |    2 +-
 oox/source/ppt/slidepersist.cxx                     |    2 +-
 sc/source/filter/oox/drawingfragment.cxx            |   10 +++++-----
 6 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit cdd4a9fa539bcfc11dda35adda4b290ceab9e0b0
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sat Mar 11 16:07:34 2017 +0100

    Passing shaperect to addShape function is useless
    
    Shaperect is ignored by createAndInsert() so it has no effect
    at all. Also when this parameter is set the size and position
    is set using the same shaperect, so don't need to pass it also
    as a parameter.
    
    Change-Id: I35a7953f3eda1bdd19af6f3e77c55b5c7e1f7161
    Reviewed-on: https://gerrit.libreoffice.org/35073
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 1bc3fb7b..b908046 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -175,7 +175,6 @@ public:
                             const css::uno::Reference< css::drawing::XShapes >& rxShapes,
                             const basegfx::B2DHomMatrix& aTransformation,
                             FillProperties& rShapeOrParentShapeFillProps,
-                            const css::awt::Rectangle* pShapeRect = nullptr,
                             ShapeIdMap* pShapeMap = nullptr );
 
     void                addChildren(
@@ -220,7 +219,6 @@ protected:
                             const OUString& rServiceName,
                             const Theme* pTheme,
                             const css::uno::Reference< css::drawing::XShapes >& rxShapes,
-                            const css::awt::Rectangle* pShapeRect,
                             bool bClearText,
                             bool bDoNotInsertEmptyTextBody,
                             basegfx::B2DHomMatrix& aTransformation,
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index 00bc99f..d5140c1 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -222,7 +222,7 @@ void ChartDrawingFragment::onEndElement()
                 mxShape->setSize(awt::Size(aShapeRectEmu32.Width, aShapeRectEmu32.Height));
 
                 basegfx::B2DHomMatrix aMatrix;
-                mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, mxShape->getFillProperties(), &aShapeRectEmu32 );
+                mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, mxShape->getFillProperties() );
             }
         }
         mxShape.reset();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index e60d487..198986d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -243,7 +243,6 @@ void Shape::addShape(
         const Reference< XShapes >& rxShapes,
         const basegfx::B2DHomMatrix& aTransformation,
         FillProperties& rShapeOrParentShapeFillProps,
-        const awt::Rectangle* pShapeRect,
         ShapeIdMap* pShapeMap )
 {
     SAL_INFO("oox.drawingml", "Shape::addShape: id='" << msId << "'");
@@ -254,7 +253,7 @@ void Shape::addShape(
         if( !sServiceName.isEmpty() )
         {
             basegfx::B2DHomMatrix aMatrix( aTransformation );
-            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, false, false, aMatrix, rShapeOrParentShapeFillProps ) );
+            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, false, false, aMatrix, rShapeOrParentShapeFillProps ) );
 
             if( pShapeMap && !msId.isEmpty() )
             {
@@ -264,7 +263,7 @@ void Shape::addShape(
             // if this is a group shape, we have to add also each child shape
             Reference< XShapes > xShapes( xShape, UNO_QUERY );
             if ( xShapes.is() )
-                addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap, aMatrix );
+                addChildren( rFilterBase, *this, pTheme, xShapes, awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap, aMatrix );
 
             if( meFrameType == FRAMETYPE_DIAGRAM )
             {
@@ -393,7 +392,7 @@ void Shape::addChildren(
     std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
     while( aIter != rMaster.maChildren.end() ) {
         (*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
-        (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), nullptr, pShapeMap );
+        (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap );
     }
 }
 
@@ -402,7 +401,6 @@ Reference< XShape > const & Shape::createAndInsert(
         const OUString& rServiceName,
         const Theme* pTheme,
         const css::uno::Reference< css::drawing::XShapes >& rxShapes,
-        const awt::Rectangle* /* pShapeRect */,
         bool bClearText,
         bool bDoNotInsertEmptyTextBody,
         basegfx::B2DHomMatrix& aParentTransformation,
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 80a056e..bfcf8a2 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -331,7 +331,7 @@ void PPTShape::addShape(
             } else
                 setMasterTextListStyle( aMasterTextListStyle );
 
-            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, nullptr, bClearText, mpPlaceholder.get() != nullptr, aTransformation, getFillProperties() ) );
+            Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, bClearText, mpPlaceholder.get() != nullptr, aTransformation, getFillProperties() ) );
             if (!rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ((sal_Int32)mnSubType == XML_title))
              {
                 try
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 038c2e3..b8fd28e 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -147,7 +147,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
             if ( pPPTShape )
                 pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() );
             else
-                (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), nullptr, &getShapeMap() );
+                (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() );
         }
     }
 
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index c3626c4..02944b7 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -272,20 +272,20 @@ void DrawingFragment::onEndElement()
                         getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) );
 
                     // Make sure to set the position and size *before* calling addShape().
-                    mxShape->setPosition(Point(aShapeRectEmu.X, aShapeRectEmu.Y));
-                    mxShape->setSize(Size(aShapeRectEmu.Width, aShapeRectEmu.Height));
+                    mxShape->setPosition(Point(aShapeRectEmu32.X, aShapeRectEmu32.Y));
+                    mxShape->setSize(Size(aShapeRectEmu32.Width, aShapeRectEmu32.Height));
 
                     basegfx::B2DHomMatrix aTransformation;
                     if ( !bIsShapeVisible)
                         mxShape->setHidden(true);
 
-                    mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, mxShape->getFillProperties(), &aShapeRectEmu32 );
+                    mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, aTransformation, mxShape->getFillProperties() );
 
                     /*  Collect all shape positions in the WorksheetHelper base
                         class. But first, scale EMUs to 1/100 mm. */
                     Rectangle aShapeRectHmm(
-                        convertEmuToHmm( aShapeRectEmu.X ), convertEmuToHmm( aShapeRectEmu.Y ),
-                        convertEmuToHmm( aShapeRectEmu.Width ), convertEmuToHmm( aShapeRectEmu.Height ) );
+                        convertEmuToHmm(aShapeRectEmu32.X ), convertEmuToHmm(aShapeRectEmu32.Y ),
+                        convertEmuToHmm(aShapeRectEmu32.Width ), convertEmuToHmm(aShapeRectEmu32.Height ) );
                     extendShapeBoundingBox( aShapeRectHmm );
                     // set cell Anchoring
                     if ( mxAnchor->getEditAs() != ShapeAnchor::ANCHOR_ABSOLUTE )


More information about the Libreoffice-commits mailing list