summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-01-26 12:54:19 +0100
committerMichael Stahl <mstahl@redhat.com>2016-01-26 17:51:28 +0100
commiteb63ac518167601896afe0c336e2562efa0f43f2 (patch)
treef012ab389780da395edbe8c10b7023f3d870d03c /desktop
parent39963be8679ceef5d08eda9e04e97b6fbb079b71 (diff)
vcl: actually that shared_array was a scam
The only things passed as buffers there were null pointers and shared_arrays that had the deletion explicitly disabled with a struct NoDelete, so it's sufficient to just pass a pointer. Change-Id: I68d618782aa654242048516d2e910b8136b16e2d
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx18
1 files changed, 2 insertions, 16 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 53d84f7d3c60..88b5d1fc70b4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -101,17 +101,6 @@ typedef struct
const char *filterName;
} ExtensionMap;
-// We need a shared_ptr for passing into the BitmapDevice (via
-// VirtualDevice.SetOutputSizePixelScaleOffsetAndBuffer which goes via the
-// SvpVirtualDevice, ending up in the cairo surface. However as we're
-// given the array externally we can't delete it, and hence need to override
-// shared_ptr's default of deleting its pointer.
-template<typename T>
-struct NoDelete
-{
- void operator()(T* /* p */) {}
-};
-
static const ExtensionMap aWriterExtensionMap[] =
{
{ "doc", "MS Word 97" },
@@ -924,11 +913,9 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
#endif
- std::shared_ptr<sal_uInt8> aBuffer( pBuffer, NoDelete<sal_uInt8>() );
-
pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
- aBuffer);
+ pBuffer);
pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
@@ -1569,12 +1556,11 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
unsigned char* pBuffer = static_cast<unsigned char*>(malloc(4 * nFontWidth * nFontHeight));
memset(pBuffer, 0, nFontWidth * nFontHeight * 4);
- std::shared_ptr<sal_uInt8> aBuffer(pBuffer, NoDelete<sal_uInt8>());
aDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
aDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nFontWidth, nFontHeight), Fraction(1.0), Point(),
- aBuffer);
+ pBuffer);
aDevice->DrawText(Point(0,0), aFontName);
return pBuffer;