Kaydet (Commit) cdd4a9fa authored tarafından Tamás Zolnai's avatar Tamás Zolnai

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/35073Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 28e61b63
......@@ -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,
......
......@@ -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();
......
......@@ -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,
......
......@@ -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
......
......@@ -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() );
}
}
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment