summaryrefslogtreecommitdiff
path: root/vcl/null
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-13 20:15:39 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-14 09:07:28 +0100
commitbc3f70f220091f09ad02c148a6a49fdccb7b85c5 (patch)
treeca6d652a7e1c70e6a144177d2582a61ddc3abe65 /vcl/null
parentfa7389b430f242706b1bcea430f82fffa112fb9b (diff)
VCL move PrinterInfoManager into GenericUnixSalData
... and use a std::unique_ptr. PrinterInfoManager::release() was just called from ~SalData(), so this should make this more clear. Change-Id: Ic4aade2db3813fdc96ede116a50604692ef3dbec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128399 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/null')
-rw-r--r--vcl/null/printerinfomanager.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
index c51ed6a9d73a..24515dbc149e 100644
--- a/vcl/null/printerinfomanager.cxx
+++ b/vcl/null/printerinfomanager.cxx
@@ -32,20 +32,12 @@ namespace psp
using namespace psp;
using namespace osl;
-
PrinterInfoManager& PrinterInfoManager::get()
{
- SalData* pSalData = GetSalData();
- if( ! pSalData->m_pPIManager )
- pSalData->m_pPIManager = new PrinterInfoManager();
- return *pSalData->m_pPIManager;
-}
-
-void PrinterInfoManager::release()
-{
- SalData* pSalData = GetSalData();
- delete pSalData->m_pPIManager;
- pSalData->m_pPIManager = nullptr;
+ GenericUnixSalData* pSalData = GetGenericUnixSalData();
+ if (!pSalData->m_pPrinterInfoManager)
+ pSalData->m_pPrinterInfoManager.reset(new PrinterInfoManager());
+ return *pSalData->m_pPrinterInfoManager;
}
PrinterInfoManager::PrinterInfoManager( Type eType ) :