diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-09-15 17:24:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-19 08:46:02 +0200 |
commit | 4b4ad80908d8f583a32e5b9aa61a95f01ecdbfda (patch) | |
tree | 00b398ca44010488c3a1e650b20846cad1ee091f /vcl | |
parent | cde84694f094a317e3bb57aaaf244b0363ef5cc5 (diff) |
std::shared_ptr in AquaSalInfoPrinter can be std::unique_ptr
also simplify the the call to reset
Change-Id: Ie29b5ef754a8caf905e2dddbb56d8f1ffc7a43a0
Reviewed-on: https://gerrit.libreoffice.org/60698
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/osx/salprn.h | 2 | ||||
-rw-r--r-- | vcl/osx/salprn.cxx | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h index 717c8e15e61c..0c7ec1e9edfd 100644 --- a/vcl/inc/osx/salprn.h +++ b/vcl/inc/osx/salprn.h @@ -47,7 +47,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter /// graphics context for Quartz 2D CGContextRef mrContext; /// memory for graphics bitmap context for querying metrics - std::shared_ptr<sal_uInt8> mpContextMemory; + std::unique_ptr<sal_uInt8[]> mpContextMemory; // since changes to NSPrintInfo during a job are ignored // we have to care for some settings ourselves diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index c3d8e52fccd9..7fdd072e836f 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -71,8 +71,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : mpGraphics = new AquaSalGraphics(); const int nWidth = 100, nHeight = 100; - mpContextMemory.reset(static_cast<sal_uInt8*>(std::malloc(nWidth * 4 * nHeight)), - &std::free); + mpContextMemory.reset(new (std::nothrow) sal_uInt8[nWidth * 4 * nHeight]); if (mpContextMemory) { |