sc/source/ui/view/preview.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 110a62e91fb39ab30706398ab78cde03e8bf6e45 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> Date: Thu Jan 19 17:38:39 2017 +0100 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 <qui...@gmail.com> Tested-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index a171889..3a5b1d0 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 )
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits