summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/print
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 16:03:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-17 10:16:35 +0200
commit812aa0512d0f77673b4ccda1187cccd0c9352e48 (patch)
treeab58320a31f15e32b6168f82898c020c266d4e17 /vcl/unx/generic/print
parenta9286f445d15207069799655ef59267d5d371c65 (diff)
loplugin:useuniqueptr in PspSalInfoPrinter
Change-Id: I77494fca8f0c326aa35872640b99596597116ef2
Diffstat (limited to 'vcl/unx/generic/print')
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 77abd94f6cbf..617eedc46eb6 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -480,11 +480,6 @@ PspSalInfoPrinter::PspSalInfoPrinter()
PspSalInfoPrinter::~PspSalInfoPrinter()
{
- if( m_pGraphics )
- {
- delete m_pGraphics;
- m_pGraphics = nullptr;
- }
}
void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* )
@@ -524,19 +519,18 @@ SalGraphics* PspSalInfoPrinter::AcquireGraphics()
SalGraphics* pRet = nullptr;
if( ! m_pGraphics )
{
- m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
+ m_pGraphics.reset( GetGenericInstance()->CreatePrintGraphics() );
m_pGraphics->Init(&m_aJobData, &m_aPrinterGfx);
- pRet = m_pGraphics;
+ pRet = m_pGraphics.get();
}
return pRet;
}
void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics )
{
- if( pGraphics == m_pGraphics )
+ if( m_pGraphics.get() == pGraphics )
{
- delete pGraphics;
- m_pGraphics = nullptr;
+ m_pGraphics.reset();
}
}