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