diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-01-19 17:38:39 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-01-20 14:26:02 +0000 |
commit | 110a62e91fb39ab30706398ab78cde03e8bf6e45 (patch) | |
tree | 83c733b2a8ccaa7675449d2d622b5a30503d240d /sc | |
parent | e71ed748acd040b68d9a1910b75ea0550e0c2008 (diff) |
sc: use unique_ptr and make_unique instead of new/delete
Change-Id: Iafaf78d17fc5d6dffbd4e541f802b7090dcfda68
Reviewed-on: https://gerrit.libreoffice.org/33344
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/preview.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index a17188932b46..3a5b1d043d5e 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -32,6 +32,7 @@ #include <tools/multisel.hxx> #include <vcl/waitobj.hxx> #include <vcl/settings.hxx> +#include <o3tl/make_unique.hxx> #include "preview.hxx" #include "prevwsh.hxx" @@ -391,11 +392,11 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) { ScPrintOptions aOptions = pScMod->GetPrintOptions(); - ScPrintFunc* pPrintFunc; + std::unique_ptr<ScPrintFunc> pPrintFunc; if (bStateValid) - pPrintFunc = new ScPrintFunc( this, pDocShell, aState, &aOptions ); + pPrintFunc = o3tl::make_unique<ScPrintFunc>( this, pDocShell, aState, &aOptions ); else - pPrintFunc = new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ); + pPrintFunc = o3tl::make_unique<ScPrintFunc>( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ); pPrintFunc->SetOffset(aOffset); pPrintFunc->SetManualZoom(nZoom); @@ -478,7 +479,6 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) aState.nDocPages = nTotalPages; bStateValid = true; } - delete pPrintFunc; } if ( bDoPrint ) |