diff options
Diffstat (limited to 'sw/source/uibase/dbui/dbmgr.cxx')
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 2163096bce98..299eee2ffd00 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -945,17 +945,17 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, bool bPageStylesWithHeaderFooter = false; vcl::Window *pSourceWindow = 0; - CancelableDialog *pProgressDlg = 0; + VclPtr<CancelableDialog> pProgressDlg; if (!IsMergeSilent()) { pSourceWindow = &pSourceShell->GetView().GetEditWin(); if( ! pParent ) pParent = pSourceWindow; if( bMergeShell ) - pProgressDlg = new CreateMonitor( pParent, pParent != pSourceWindow ); + pProgressDlg = VclPtr<CreateMonitor>::Create( pParent, pParent != pSourceWindow ); else { - pProgressDlg = new PrintMonitor( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT ); - static_cast<PrintMonitor*>( pProgressDlg )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22)); + pProgressDlg = VclPtr<PrintMonitor>::Create( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT ); + static_cast<PrintMonitor*>( pProgressDlg.get() )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22)); } pProgressDlg->SetCancelHdl( LINK(this, SwDBManager, PrtCancelHdl) ); pProgressDlg->Show(); @@ -1030,7 +1030,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, int targetDocPageCount = 0; if( !IsMergeSilent() && bMergeShell && lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) ) - static_cast<CreateMonitor*>( pProgressDlg )->SetTotalCount( nDocCount ); + static_cast<CreateMonitor*>( pProgressDlg.get() )->SetTotalCount( nDocCount ); long nStartRow, nEndRow; bool bFreezedLayouts = false; @@ -1094,9 +1094,9 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, aTempFileURL.reset( new INetURLObject(aTempFile->GetURL())); if (!IsMergeSilent()) { if( bMergeShell ) - static_cast<CreateMonitor*>( pProgressDlg )->SetCurrentPosition( nDocNo ); + static_cast<CreateMonitor*>( pProgressDlg.get() )->SetCurrentPosition( nDocNo ); else { - PrintMonitor *pPrintMonDlg = static_cast<PrintMonitor*>( pProgressDlg ); + PrintMonitor *pPrintMonDlg = static_cast<PrintMonitor*>( pProgressDlg.get() ); pPrintMonDlg->m_pPrinter->SetText( createTempFile ? aTempFileURL->GetBase() : OUString( pSourceDocSh->GetTitle( 22 ))); OUString sStat(SW_RES(STR_STATSTR_LETTER)); // Brief sStat += " "; @@ -1411,7 +1411,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs)); } - DELETEZ( pProgressDlg ); + pProgressDlg.disposeAndClear(); // save the single output document if (bMergeShell) |