diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-03-11 16:07:34 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-03-11 17:34:22 +0000 |
commit | cdd4a9fa539bcfc11dda35adda4b290ceab9e0b0 (patch) | |
tree | 8fdc4be9bf097ca0c3ee95c1f2a465e4e451b6b1 | |
parent | 28e61b634353110445e334ccaa415d7fb6629d62 (diff) |
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@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | include/oox/drawingml/shape.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/chartdrawingfragment.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 8 | ||||
-rw-r--r-- | oox/source/ppt/pptshape.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 10 |
6 files changed, 11 insertions, 15 deletions
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 1bc3fb7bbfba..b908046458a6 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 00bc99f7bd8e..d5140c116071 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 e60d487b3525..198986d88da2 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 80a056e1a899..bfcf8a21d832 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 038c2e374767..b8fd28e8e538 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 c3626c42ac83..02944b7096a6 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 ) |