diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-08 13:32:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-09 13:11:47 +0200 |
commit | 6d008c9e1dbe4240a10c8789860dc30b0cb0b2d5 (patch) | |
tree | 25330d9240ea3ef0687809ab8286c1e2c4b1c75f /vcl/qt5/Qt5Instance_Print.cxx | |
parent | 84efebb5304b2ebbc03e7743b131ce4d5ad10c03 (diff) |
hold and return SalPrinter with std::unique_ptr
and remove DestroyPrinter, doesn't not anything beyond delete'ing the
object
Change-Id: I25e14b962e65a0e131fae3ff5771c82920a4e375
Reviewed-on: https://gerrit.libreoffice.org/55498
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qt5/Qt5Instance_Print.cxx')
-rw-r--r-- | vcl/qt5/Qt5Instance_Print.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Instance_Print.cxx b/vcl/qt5/Qt5Instance_Print.cxx index a0bfed1d2f9f..e1b6bdc158c3 100644 --- a/vcl/qt5/Qt5Instance_Print.cxx +++ b/vcl/qt5/Qt5Instance_Print.cxx @@ -186,17 +186,15 @@ SalInfoPrinter* Qt5Instance::CreateInfoPrinter(SalPrinterQueueInfo* pQueueInfo, void Qt5Instance::DestroyInfoPrinter(SalInfoPrinter* pPrinter) { delete pPrinter; } -SalPrinter* Qt5Instance::CreatePrinter(SalInfoPrinter* pInfoPrinter) +std::unique_ptr<SalPrinter> Qt5Instance::CreatePrinter(SalInfoPrinter* pInfoPrinter) { // create and initialize SalPrinter Qt5Printer* pPrinter = new Qt5Printer(pInfoPrinter); pPrinter->m_aJobData = static_cast<Qt5InfoPrinter*>(pInfoPrinter)->m_aJobData; - return pPrinter; + return std::unique_ptr<SalPrinter>(pPrinter); } -void Qt5Instance::DestroyPrinter(SalPrinter* pPrinter) { delete pPrinter; } - void Qt5Instance::GetPrinterQueueInfo(ImplPrnQueueList* pList) { PrinterInfoManager& rManager(PrinterInfoManager::get()); |