Kaydet (Commit) 307f561e authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#9821 Indirect-leak

Change-Id: I7b4f1a487c49048b7796dba982c5c1d2163cce46
Reviewed-on: https://gerrit.libreoffice.org/59068
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3512079d
......@@ -2785,7 +2785,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportPPT(SvStream &rStream)
::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
SdDrawDocument *pDoc = xDocShRef->GetDoc();
bRet = ImportPPT(pDoc, *xDocStream, *xStorage, aSrcMed);
try
{
bRet = ImportPPT(pDoc, *xDocStream, *xStorage, aSrcMed);
}
catch (...)
{
}
xDocShRef->DoClose();
}
......
......@@ -298,29 +298,27 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
bool bFlipH = aCustomShape2d.IsFlipHorz();
bool bLineGeometryNeededOnly = bTextPathOn;
SdrObject* pRenderedShape = aCustomShape2d.CreateObject( bLineGeometryNeededOnly );
if ( pRenderedShape )
std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedShape(aCustomShape2d.CreateObject(bLineGeometryNeededOnly));
if (xRenderedShape)
{
if ( bTextPathOn )
{
SdrObject* pRenderedFontWork(
std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedFontWork(
EnhancedCustomShapeFontWork::CreateFontWork(
pRenderedShape,
xRenderedShape.get(),
rSdrObjCustomShape));
if ( pRenderedFontWork )
if (xRenderedFontWork)
{
SdrObject::Free( pRenderedShape );
pRenderedShape = pRenderedFontWork;
xRenderedShape = std::move(xRenderedFontWork);
}
}
SdrObject* pRenderedShape3d = EnhancedCustomShape3d::Create3DObject(pRenderedShape, rSdrObjCustomShape);
if ( pRenderedShape3d )
std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedShape3d(EnhancedCustomShape3d::Create3DObject(xRenderedShape.get(), rSdrObjCustomShape));
if (xRenderedShape3d)
{
bFlipV = bFlipH = false;
nRotateAngle = 0;
SdrObject::Free( pRenderedShape );
pRenderedShape = pRenderedShape3d;
xRenderedShape = std::move(xRenderedShape3d);
}
tools::Rectangle aRect(rSdrObjCustomShape.GetSnapRect());
......@@ -336,43 +334,44 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
nTan = -nTan;
}
pRenderedShape->Shear(rSdrObjCustomShape.GetSnapRect().Center(), nShearAngle, nTan, false);
xRenderedShape->Shear(rSdrObjCustomShape.GetSnapRect().Center(), nShearAngle, nTan, false);
}
if(nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
pRenderedShape->NbcRotate(rSdrObjCustomShape.GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ));
xRenderedShape->NbcRotate(rSdrObjCustomShape.GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ));
}
if ( bFlipV )
{
Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
Point aRight( aLeft.X() + 1000, aLeft.Y() );
pRenderedShape->NbcMirror( aLeft, aRight );
xRenderedShape->NbcMirror( aLeft, aRight );
}
if ( bFlipH )
{
Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
Point aBottom( aTop.X(), aTop.Y() + 1000 );
pRenderedShape->NbcMirror( aTop, aBottom );
xRenderedShape->NbcMirror( aTop, aBottom );
}
pRenderedShape->NbcSetStyleSheet(rSdrObjCustomShape.GetStyleSheet(), true);
pRenderedShape->RecalcSnapRect();
xRenderedShape->NbcSetStyleSheet(rSdrObjCustomShape.GetStyleSheet(), true);
xRenderedShape->RecalcSnapRect();
}
if ( mbForceGroupWithText )
{
pRenderedShape = ImplForceGroupWithText(
xRenderedShape.reset(ImplForceGroupWithText(
rSdrObjCustomShape,
pRenderedShape);
xRenderedShape.release()));
}
Reference< drawing::XShape > xShape;
if ( pRenderedShape )
if (xRenderedShape)
{
aCustomShape2d.ApplyGluePoints( pRenderedShape );
aCustomShape2d.ApplyGluePoints(xRenderedShape.get());
SdrObject* pRenderedShape = xRenderedShape.release();
xShape = SvxDrawPage::CreateShapeByTypeAndInventor( pRenderedShape->GetObjIdentifier(),
pRenderedShape->GetObjInventor(), pRenderedShape );
}
......
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