[Libreoffice-commits] core.git: fpicker/source vcl/inc vcl/win
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 8 19:54:58 UTC 2021
fpicker/source/win32/VistaFilePickerImpl.cxx | 6 +++++-
vcl/inc/win/salbmp.h | 4 ++--
vcl/win/gdi/salbmp.cxx | 12 ++++++------
3 files changed, 13 insertions(+), 9 deletions(-)
New commits:
commit 19caafc967441982ba47a1016dbb1b8bf70d675e
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Mar 8 17:37:59 2021 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Mar 8 20:54:14 2021 +0100
loplugin:makeshared (clang-cl)
Change-Id: I902c4438adb89970db749ca06a13bfc484925851
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112177
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx
index b8642dd1f010..dbbe72e18ee4 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <memory>
+
#include "VistaFilePickerImpl.hxx"
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
@@ -494,7 +498,7 @@ template <class TDialogImplClass> void VistaFilePickerImpl::impl_sta_CreateDialo
{
// SYNCHRONIZED->
osl::ClearableMutexGuard aLock(m_aMutex);
- m_pDialog.reset(new TDialogImplClass);
+ m_pDialog = std::make_shared<TDialogImplClass>();
}
diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h
index 80ddb38bfd9e..bb589cc4b2f8 100644
--- a/vcl/inc/win/salbmp.h
+++ b/vcl/inc/win/salbmp.h
@@ -42,8 +42,8 @@ private:
sal_uInt16 mnBitCount;
- std::unique_ptr<Gdiplus::Bitmap> ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource);
- std::unique_ptr<Gdiplus::Bitmap> ImplCreateGdiPlusBitmap();
+ std::shared_ptr<Gdiplus::Bitmap> ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource);
+ std::shared_ptr<Gdiplus::Bitmap> ImplCreateGdiPlusBitmap();
public:
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 0d9dba981ae7..e807a2faef61 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -233,9 +233,9 @@ std::shared_ptr< Gdiplus::Bitmap > WinSalBitmap::ImplGetGdiPlusBitmap(const WinS
return aRetval;
}
-std::unique_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap()
+std::shared_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap()
{
- std::unique_ptr<Gdiplus::Bitmap> pRetval;
+ std::shared_ptr<Gdiplus::Bitmap> pRetval;
WinSalBitmap* pSalRGB = this;
std::unique_ptr<WinSalBitmap> pExtraWinSalRGB;
@@ -271,7 +271,7 @@ std::unique_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap()
const sal_uInt32 nW(pRGB->mnWidth);
const sal_uInt32 nH(pRGB->mnHeight);
- pRetval.reset(new Gdiplus::Bitmap(nW, nH, PixelFormat24bppRGB));
+ pRetval = std::make_shared<Gdiplus::Bitmap>(nW, nH, PixelFormat24bppRGB);
if ( pRetval->GetLastStatus() == Gdiplus::Ok )
{
@@ -315,9 +315,9 @@ std::unique_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap()
return pRetval;
}
-std::unique_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource)
+std::shared_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource)
{
- std::unique_ptr<Gdiplus::Bitmap> pRetval;
+ std::shared_ptr<Gdiplus::Bitmap> pRetval;
WinSalBitmap* pSalRGB = this;
std::unique_ptr<WinSalBitmap> pExtraWinSalRGB;
@@ -388,7 +388,7 @@ std::unique_ptr<Gdiplus::Bitmap> WinSalBitmap::ImplCreateGdiPlusBitmap(const Win
const sal_uInt32 nW(pRGB->mnWidth);
const sal_uInt32 nH(pRGB->mnHeight);
- pRetval.reset(new Gdiplus::Bitmap(nW, nH, PixelFormat32bppARGB));
+ pRetval = std::make_shared<Gdiplus::Bitmap>(nW, nH, PixelFormat32bppARGB);
if ( pRetval->GetLastStatus() == Gdiplus::Ok ) // 2nd place to secure with new Gdiplus::Bitmap
{
More information about the Libreoffice-commits
mailing list