wrap some more dialog pointers in VclPtr
and fix a couple of memory leaks in the process, some of them were not being deleted at all Change-Id: Icb5c948662ad3ba878eadfbc807f93cc35cfb228 Reviewed-on: https://gerrit.libreoffice.org/30651 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1079,8 +1079,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
|
||||
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
|
||||
|
||||
AbstractScDPShowDetailDlg* pDlg = pFact->CreateScDPShowDetailDlg(
|
||||
pTabViewShell->GetDialogParent(), *pDPObj, nOrientation );
|
||||
ScopedVclPtr<AbstractScDPShowDetailDlg> pDlg( pFact->CreateScDPShowDetailDlg(
|
||||
pTabViewShell->GetDialogParent(), *pDPObj, nOrientation ) );
|
||||
OSL_ENSURE(pDlg, "Dialog create fail!");
|
||||
if ( pDlg->Execute() == RET_OK )
|
||||
{
|
||||
@@ -1120,9 +1120,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
|
||||
OSL_ENSURE( pFact, "ScAbstractFactory create fail!" );
|
||||
Date aNullDate( *GetViewData()->GetDocument()->GetFormatTable()->GetNullDate() );
|
||||
AbstractScDPDateGroupDlg* pDlg = pFact->CreateScDPDateGroupDlg(
|
||||
ScopedVclPtr<AbstractScDPDateGroupDlg> pDlg( pFact->CreateScDPDateGroupDlg(
|
||||
pTabViewShell->GetDialogParent(),
|
||||
aNumInfo, nParts, aNullDate );
|
||||
aNumInfo, nParts, aNullDate ) );
|
||||
OSL_ENSURE( pDlg, "Dialog create fail!" );
|
||||
if( pDlg->Execute() == RET_OK )
|
||||
{
|
||||
@@ -1134,8 +1134,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
{
|
||||
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
|
||||
OSL_ENSURE( pFact, "ScAbstractFactory create fail!" );
|
||||
AbstractScDPNumGroupDlg* pDlg = pFact->CreateScDPNumGroupDlg(
|
||||
pTabViewShell->GetDialogParent(), aNumInfo );
|
||||
ScopedVclPtr<AbstractScDPNumGroupDlg> pDlg( pFact->CreateScDPNumGroupDlg(
|
||||
pTabViewShell->GetDialogParent(), aNumInfo ) );
|
||||
OSL_ENSURE( pDlg, "Dialog create fail!" );
|
||||
if( pDlg->Execute() == RET_OK )
|
||||
pTabViewShell->NumGroupDataPilot( pDlg->GetGroupInfo() );
|
||||
|
@@ -125,7 +125,7 @@ SwFieldDataOnlyDlgWrapper::SwFieldDataOnlyDlgWrapper( vcl::Window* _pParent, sal
|
||||
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
||||
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
||||
|
||||
AbstractSwFieldDlg* pDlg = pFact->CreateSwFieldDlg(pB, this, _pParent);
|
||||
VclPtr<AbstractSwFieldDlg> pDlg = pFact->CreateSwFieldDlg(pB, this, _pParent);
|
||||
OSL_ENSURE(pDlg, "Dialog creation failed!");
|
||||
pDlgInterface = pDlg;
|
||||
|
||||
|
@@ -1138,7 +1138,7 @@ void SwView::Execute(SfxRequest &rReq)
|
||||
SfxViewFrame* pTmpFrame = GetViewFrame();
|
||||
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
||||
OSL_ENSURE(pFact, "Dialog creation failed!");
|
||||
AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg(&pTmpFrame->GetWindow());
|
||||
ScopedVclPtr<AbstractMailMergeCreateFromDlg> pDlg( pFact->CreateMailMergeCreateFromDlg(&pTmpFrame->GetWindow()) );
|
||||
OSL_ENSURE(pDlg, "Dialog creation failed!");
|
||||
if(RET_OK == pDlg->Execute())
|
||||
bUseCurrentDocument = pDlg->IsThisDocument();
|
||||
@@ -2340,7 +2340,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
|
||||
//take an existing data source or create a new one?
|
||||
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
||||
OSL_ENSURE(pFact, "Dialog creation failed!");
|
||||
AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow());
|
||||
ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg( pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow()) );
|
||||
OSL_ENSURE(pConnectionsDlg, "Dialog creation failed!");
|
||||
if(RET_OK == pConnectionsDlg->Execute())
|
||||
bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
|
||||
|
@@ -308,7 +308,7 @@ void VclContainer::Command(const CommandEvent& rCEvt)
|
||||
{
|
||||
// open screenshot annotation dialog
|
||||
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
|
||||
AbstractScreenshotAnnotationDlg* pTmp = pFact->CreateScreenshotAnnotationDlg(
|
||||
VclPtr<AbstractScreenshotAnnotationDlg> pTmp = pFact->CreateScreenshotAnnotationDlg(
|
||||
Application::GetDefDialogParent(),
|
||||
*pParentDialog);
|
||||
ScopedVclPtr<AbstractScreenshotAnnotationDlg> pDialog(pTmp);
|
||||
|
Reference in New Issue
Block a user