vcl: replace boost::shared_array with std::shared_ptr

The boost::bind here looks totally pointless too.

No idea why this uses rtl_allocateMemory, let's keep that.

Change-Id: If51ba9837a318f11094ee39225233212a848a955
Reviewed-on: https://gerrit.libreoffice.org/23502
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Michael Stahl
2016-03-24 23:04:42 +01:00
parent 017a864caf
commit 4b039f27a2
2 changed files with 8 additions and 9 deletions

View File

@@ -24,8 +24,7 @@
#include "salprn.hxx" #include "salprn.hxx"
#include <boost/shared_array.hpp> #include <memory>
class AquaSalGraphics; class AquaSalGraphics;
@@ -48,7 +47,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
/// graphics context for Quartz 2D /// graphics context for Quartz 2D
CGContextRef mrContext; CGContextRef mrContext;
/// memory for graphics bitmap context for querying metrics /// memory for graphics bitmap context for querying metrics
boost::shared_array< sal_uInt8 > maContextMemory; std::shared_ptr<sal_uInt8> mpContextMemory;
// since changes to NSPrintInfo during a job are ignored // since changes to NSPrintInfo during a job are ignored
// we have to care for some settings ourselves // we have to care for some settings ourselves

View File

@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <boost/bind.hpp>
#include "officecfg/Office/Common.hxx" #include "officecfg/Office/Common.hxx"
#include <vcl/print.hxx> #include <vcl/print.hxx>
@@ -78,12 +76,14 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
mpGraphics = new AquaSalGraphics(); mpGraphics = new AquaSalGraphics();
const int nWidth = 100, nHeight = 100; const int nWidth = 100, nHeight = 100;
maContextMemory.reset( static_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ), mpContextMemory.reset(static_cast<sal_uInt8*>(rtl_allocateMemory(nWidth * 4 * nHeight)),
boost::bind( rtl_freeMemory, _1 ) ); &rtl_freeMemory);
if( maContextMemory ) if (mpContextMemory)
{ {
mrContext = CGBitmapContextCreate( maContextMemory.get(), nWidth, nHeight, 8, nWidth * 4, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst ); mrContext = CGBitmapContextCreate(mpContextMemory.get(),
nWidth, nHeight, 8, nWidth * 4,
GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst);
if( mrContext ) if( mrContext )
SetupPrinterGraphics( mrContext ); SetupPrinterGraphics( mrContext );
} }