Kaydet (Commit) 7e8f24c5 authored tarafından David Tardon's avatar David Tardon

use unique_ptr to manage memory

Change-Id: I2f22dfc6c9ddbaf07145ca553fdb53c12cd94dcb
üst 4bc37b7e
......@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <memory>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/view/XRenderable.hpp>
......@@ -817,12 +819,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// execute PrinterSetupDialog
VclPtrInstance<PrinterSetupDialog> pPrintSetupDlg( GetWindow() );
SfxDialogExecutor_Impl* pExecutor = nullptr;
std::unique_ptr<SfxDialogExecutor_Impl> pExecutor;
if (pImp->m_bHasPrintOptions && HasPrintOptionsPage())
{
// additional controls for dialog
pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
pExecutor.reset( new SfxDialogExecutor_Impl( this, pPrintSetupDlg ) );
if ( bPrintOnHelp )
pExecutor->DisableHelp();
pPrintSetupDlg->SetOptionsHdl( pExecutor->GetLink() );
......@@ -844,7 +846,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
}
pPrintSetupDlg.disposeAndClear();
delete pExecutor;
// no recording of PrinterSetup except printer name (is printer dependent)
rReq.Ignore();
......
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