[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/osx vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 19 06:46:27 UTC 2018
vcl/inc/osx/salprn.h | 2 +-
vcl/osx/salprn.cxx | 3 +--
vcl/unx/generic/dtrans/X11_selection.cxx | 2 +-
vcl/unx/generic/dtrans/bmp.cxx | 5 -----
vcl/unx/generic/dtrans/bmp.hxx | 2 --
5 files changed, 3 insertions(+), 11 deletions(-)
New commits:
commit 9fec5ac89d0675d2229b3adf425202fd93f11f8e
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Sep 15 17:42:27 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 19 08:46:16 2018 +0200
inline X11_freeBmp
Change-Id: Ia79d2f7a40e9ee7a91a652536a360cb878b44516
Reviewed-on: https://gerrit.libreoffice.org/60700
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index fd5ed013982a..f7c0b6db6a8e 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -1156,7 +1156,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ
memcpy( rData.getArray(), pBytes, nOutSize );
bSuccess = true;
}
- X11_freeBmp( pBytes );
+ std::free( pBytes );
}
}
}
diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx
index e6748166e132..7f3f27022099 100644
--- a/vcl/unx/generic/dtrans/bmp.cxx
+++ b/vcl/unx/generic/dtrans/bmp.cxx
@@ -350,11 +350,6 @@ sal_uInt8* x11::X11_getBmpFromPixmap(
return pBmp;
}
-void x11::X11_freeBmp( sal_uInt8* pBmp )
-{
- std::free( pBmp );
-}
-
/*
* PixmapHolder
*/
diff --git a/vcl/unx/generic/dtrans/bmp.hxx b/vcl/unx/generic/dtrans/bmp.hxx
index 13797bf29ba0..9547bc2170b6 100644
--- a/vcl/unx/generic/dtrans/bmp.hxx
+++ b/vcl/unx/generic/dtrans/bmp.hxx
@@ -36,8 +36,6 @@ sal_uInt8* X11_getBmpFromPixmap( Display* pDisplay,
Colormap aColormap,
sal_Int32& rOutSize );
-void X11_freeBmp( sal_uInt8* pBmp );
-
class PixmapHolder
{
Display* m_pDisplay;
commit 4b4ad80908d8f583a32e5b9aa61a95f01ecdbfda
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Sep 15 17:24:55 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 19 08:46:02 2018 +0200
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 at collabora.co.uk>
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)
{
More information about the Libreoffice-commits
mailing list