summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-01-27 15:31:19 +0100
committerDavid Tardon <dtardon@redhat.com>2016-01-28 13:19:32 +0100
commit7e8f24c569abda227a6d7c3a27a0c394f6517e92 (patch)
tree8ced500048604e3d8aa227dc66f65fe915321b40 /sfx2
parent4bc37b7e804fbfe17f8f516487d16ea23a0b246e (diff)
use unique_ptr to manage memory
Change-Id: I2f22dfc6c9ddbaf07145ca553fdb53c12cd94dcb
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewprn.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 04244896abf2..33f0bfe004a2 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -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();