diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 16:26:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 23:38:37 +0100 |
commit | 6317e10f5b9c347ceb391e049e6d0f3c542f93c4 (patch) | |
tree | 5552a3ccc88bfbdf932735292a008271ab4360fa | |
parent | a334f77792dfff92e3c97f7f61f59d01fc9338cf (diff) |
loplugin:makeshared (clang-cl)
Change-Id: I0c786bf401e514f9d86e33d8ab6366fc5dd1f425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87887
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | canvas/source/directx/dx_9rm.cxx | 3 | ||||
-rw-r--r-- | canvas/source/directx/dx_bitmap.cxx | 12 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvas.cxx | 12 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvascustomsprite.cxx | 7 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvasfont.cxx | 11 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvashelper_texturefill.cxx | 15 | ||||
-rw-r--r-- | canvas/source/directx/dx_devicehelper.cxx | 12 | ||||
-rw-r--r-- | canvas/source/directx/dx_impltools.cxx | 19 | ||||
-rw-r--r-- | canvas/source/directx/dx_spritedevicehelper.cxx | 17 | ||||
-rw-r--r-- | canvas/source/directx/dx_surfacebitmap.cxx | 14 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePicker.cxx | 46 | ||||
-rw-r--r-- | fpicker/source/win32/VistaFilePickerEventHandler.cxx | 7 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 8 |
13 files changed, 101 insertions, 82 deletions
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index 7f058a2a45bc..511e90e9d6e2 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <sal/log.hxx> +#include <memory> #include <string.h> #include <basegfx/numeric/ftools.hxx> @@ -1205,7 +1206,7 @@ namespace dxcanvas IDXRenderModuleSharedPtr createRenderModule( const vcl::Window& rParent ) { - return IDXRenderModuleSharedPtr( new DXRenderModule(rParent) ); + return std::make_shared<DXRenderModule>(rParent); } } diff --git a/canvas/source/directx/dx_bitmap.cxx b/canvas/source/directx/dx_bitmap.cxx index a9192e05e2dc..524e3a6fdd2d 100644 --- a/canvas/source/directx/dx_bitmap.cxx +++ b/canvas/source/directx/dx_bitmap.cxx @@ -19,6 +19,8 @@ #include <sal/config.h> +#include <memory> + #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2irange.hxx> #include <tools/diagnose_ex.h> @@ -56,19 +58,17 @@ namespace dxcanvas // create container for pixel data if(mbAlpha) { - mpBitmap.reset( - new Gdiplus::Bitmap( + mpBitmap = std::make_shared<Gdiplus::Bitmap>( maSize.getX(), maSize.getY(), - PixelFormat32bppARGB)); + PixelFormat32bppARGB); } else { - mpBitmap.reset( - new Gdiplus::Bitmap( + mpBitmap = std::make_shared<Gdiplus::Bitmap>( maSize.getX(), maSize.getY(), - PixelFormat24bppRGB)); + PixelFormat24bppRGB); } mpGraphics.reset( tools::createGraphicsFromBitmap(mpBitmap) ); diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index 3aace1190f08..39864b14e77d 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -18,6 +18,9 @@ */ #include <sal/config.h> + +#include <memory> + #include <sal/log.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -113,9 +116,8 @@ namespace dxcanvas maDeviceHelper.init( pSysData->hDC, pOutDev, *this ); maCanvasHelper.setDevice( *this ); maCanvasHelper.setTarget( - GraphicsProviderSharedPtr( - new GraphicsProviderImpl( - Gdiplus::Graphics::FromHDC(pSysData->hDC)))); + std::make_shared<GraphicsProviderImpl>( + Gdiplus::Graphics::FromHDC(pSysData->hDC))); maArguments.realloc(0); } @@ -184,11 +186,11 @@ namespace dxcanvas throw lang::NoSupportException( "Passed HDC is no mem DC/has no bitmap selected!"); } - mpTarget.reset( new DXBitmap( + mpTarget = std::make_shared<DXBitmap>( BitmapSharedPtr( Gdiplus::Bitmap::FromHBITMAP( hBmp, nullptr) ), - false )); + false ); maCanvasHelper.setTarget( mpTarget ); diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx index ad18d765ae2b..f850342919b5 100644 --- a/canvas/source/directx/dx_canvascustomsprite.cxx +++ b/canvas/source/directx/dx_canvascustomsprite.cxx @@ -19,6 +19,8 @@ #include <sal/config.h> +#include <memory> + #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> #include <cppuhelper/supportsservice.hxx> @@ -46,14 +48,13 @@ namespace dxcanvas ENSURE_OR_THROW( rRefDevice.get(), "CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" ); - mpSurface.reset( - new DXSurfaceBitmap( + mpSurface = std::make_shared<DXSurfaceBitmap>( ::basegfx::B2IVector( ::canvas::tools::roundUp( rSpriteSize.Width ), ::canvas::tools::roundUp( rSpriteSize.Height )), rSurfaceProxy, rRenderModule, - true)); + true); maCanvasHelper.setDevice( *rRefDevice ); maCanvasHelper.setTarget( mpSurface ); diff --git a/canvas/source/directx/dx_canvasfont.cxx b/canvas/source/directx/dx_canvasfont.cxx index e24553c7ca29..aeb3070525c5 100644 --- a/canvas/source/directx/dx_canvasfont.cxx +++ b/canvas/source/directx/dx_canvasfont.cxx @@ -18,6 +18,9 @@ */ #include <sal/config.h> + +#include <memory> + #include <o3tl/char16_t2wchar_t.hxx> #include <com/sun/star/rendering/PanoseWeight.hpp> @@ -57,14 +60,14 @@ namespace dxcanvas mnEmphasisMark(0), maFontMatrix( fontMatrix ) { - mpFontFamily.reset( new Gdiplus::FontFamily(o3tl::toW(rFontRequest.FontDescription.FamilyName.getStr()),nullptr) ); + mpFontFamily = std::make_shared<Gdiplus::FontFamily>(o3tl::toW(rFontRequest.FontDescription.FamilyName.getStr()),nullptr); if( !mpFontFamily->IsAvailable() ) - mpFontFamily.reset( new Gdiplus::FontFamily(L"Arial",nullptr) ); + mpFontFamily = std::make_shared<Gdiplus::FontFamily>(L"Arial",nullptr); - mpFont.reset( new Gdiplus::Font( mpFontFamily.get(), + mpFont = std::make_shared<Gdiplus::Font>( mpFontFamily.get(), static_cast<Gdiplus::REAL>(rFontRequest.CellSize), calcFontStyle( rFontRequest ), - Gdiplus::UnitWorld )); + Gdiplus::UnitWorld ); ::canvas::tools::extractExtraFontProperties(extraFontProperties, mnEmphasisMark); } diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx index 33a6c018670e..504987c64f9a 100644 --- a/canvas/source/directx/dx_canvashelper_texturefill.cxx +++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <memory> #include <tuple> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -376,8 +377,8 @@ namespace dxcanvas tools::graphicsPathFromB2DPolygon( rValues.maGradientPoly )); pGradientPath->Transform( &aMatrix ); - pGradientBrush.reset( - new Gdiplus::PathGradientBrush( pGradientPath.get() ) ); + pGradientBrush + = std::make_shared<Gdiplus::PathGradientBrush>( pGradientPath.get() ); pGradientBrush->SetInterpolationColors( rColors.data(), rStops.data(), rStops.size() ); @@ -489,10 +490,9 @@ namespace dxcanvas if( ::rtl::math::approxEqual( rTexture.Alpha, 1.0 ) ) { - pBrush.reset( - new Gdiplus::TextureBrush( + pBrush = std::make_shared<Gdiplus::TextureBrush>( pBitmap.get(), - bClamp ? Gdiplus::WrapModeClamp : Gdiplus::WrapModeTile ) ); + bClamp ? Gdiplus::WrapModeClamp : Gdiplus::WrapModeTile ); } else { @@ -507,11 +507,10 @@ namespace dxcanvas Gdiplus::Rect aRect(0,0, aBmpSize.Width, aBmpSize.Height); - pBrush.reset( - new Gdiplus::TextureBrush( + pBrush = std::make_shared<Gdiplus::TextureBrush>( pBitmap.get(), aRect, - &aImgAttr ) ); + &aImgAttr ); pBrush->SetWrapMode( bClamp ? Gdiplus::WrapModeClamp : Gdiplus::WrapModeTile ); diff --git a/canvas/source/directx/dx_devicehelper.cxx b/canvas/source/directx/dx_devicehelper.cxx index 767488f75672..1c724bca5513 100644 --- a/canvas/source/directx/dx_devicehelper.cxx +++ b/canvas/source/directx/dx_devicehelper.cxx @@ -19,6 +19,8 @@ #include <sal/config.h> +#include <memory> + #include <basegfx/utils/canvastools.hxx> #include <com/sun/star/lang/NoSupportException.hpp> #include <tools/diagnose_ex.h> @@ -133,10 +135,9 @@ namespace dxcanvas if( !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed - DXBitmapSharedPtr pBitmap( - new DXBitmap( + DXBitmapSharedPtr pBitmap = std::make_shared<DXBitmap>( ::basegfx::unotools::b2ISizeFromIntegerSize2D(size), - false)); + false); // create a 24bit RGB system memory surface return uno::Reference< rendering::XBitmap >(new CanvasBitmap(pBitmap,mpDevice)); @@ -156,10 +157,9 @@ namespace dxcanvas if( !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed - DXBitmapSharedPtr pBitmap( - new DXBitmap( + DXBitmapSharedPtr pBitmap = std::make_shared<DXBitmap>( ::basegfx::unotools::b2ISizeFromIntegerSize2D(size), - true)); + true); // create a 32bit ARGB system memory surface return uno::Reference< rendering::XBitmap >(new CanvasBitmap(pBitmap,mpDevice)); diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 416b46034408..6d7f54e4713b 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <algorithm> +#include <memory> #include <vector> @@ -404,7 +405,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromRealPoint2DSequence( const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; sal_Int32 nCurrPoly; @@ -432,7 +433,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; graphicsPathFromB2DPolygon( pRes, aPoints, rPoly, bNoLineJoin ); @@ -442,7 +443,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; const sal_uInt32 nPolies( rPoly.count() ); @@ -495,9 +496,9 @@ namespace dxcanvas bool drawRGBABits( const std::shared_ptr<Gdiplus::Graphics>& rGraphics, const RawRGBABitmap& rRawRGBAData ) { - BitmapSharedPtr pBitmap( new Gdiplus::Bitmap( rRawRGBAData.mnWidth, + BitmapSharedPtr pBitmap = std::make_shared<Gdiplus::Bitmap>( rRawRGBAData.mnWidth, rRawRGBAData.mnHeight, - PixelFormat32bppARGB ) ); + PixelFormat32bppARGB ); Gdiplus::BitmapData aBmpData; aBmpData.Width = rRawRGBAData.mnWidth; @@ -545,9 +546,9 @@ namespace dxcanvas // TODO(P2): At least for the alpha bitmap case, it // would be possible to generate the corresponding // bitmap directly - pBitmap.reset( new Gdiplus::Bitmap( aBmpSize.Width, + pBitmap = std::make_shared<Gdiplus::Bitmap>( aBmpSize.Width, aBmpSize.Height, - PixelFormat32bppARGB ) ); + PixelFormat32bppARGB ); } else { @@ -555,9 +556,9 @@ namespace dxcanvas // to the VCL bitmap. Also, check whether the VCL // bitmap's system handles can be used to create the // GDI+ bitmap (currently, it does not seem so). - pBitmap.reset( new Gdiplus::Bitmap( aBmpSize.Width, + pBitmap = std::make_shared<Gdiplus::Bitmap>( aBmpSize.Width, aBmpSize.Height, - PixelFormat24bppRGB ) ); + PixelFormat24bppRGB ); } GraphicsSharedPtr pGraphics(createGraphicsFromBitmap(pBitmap)); diff --git a/canvas/source/directx/dx_spritedevicehelper.cxx b/canvas/source/directx/dx_spritedevicehelper.cxx index 2147dd9468f1..ee339c8af0ee 100644 --- a/canvas/source/directx/dx_spritedevicehelper.cxx +++ b/canvas/source/directx/dx_spritedevicehelper.cxx @@ -18,6 +18,9 @@ */ #include <sal/config.h> + +#include <memory> + #include <sal/log.hxx> #include <basegfx/utils/canvastools.hxx> @@ -84,11 +87,11 @@ namespace dxcanvas mpSurfaceProxyManager = ::canvas::createSurfaceProxyManager( mpRenderModule ); // #i60490# ensure backbuffer has sensible minimal size - mpBackBuffer.reset(new DXSurfaceBitmap( + mpBackBuffer = std::make_shared<DXSurfaceBitmap>( ::basegfx::B2ISize(w,h), mpSurfaceProxyManager, mpRenderModule, - false)); + false); // Assumes: SystemChildWindow() has CS_OWNDC DeviceHelper::init(GetDC(mpRenderModule->getHWND()),rWindow.GetOutDev(), rSpriteCanvas); @@ -112,12 +115,11 @@ namespace dxcanvas if( !getDevice() ) return uno::Reference< rendering::XBitmap >(); // we're disposed - DXSurfaceBitmapSharedPtr pBitmap( - new DXSurfaceBitmap( + DXSurfaceBitmapSharedPtr pBitmap = std::make_shared<DXSurfaceBitmap>( ::basegfx::unotools::b2ISizeFromIntegerSize2D(size), mpSurfaceProxyManager, mpRenderModule, - false)); + false); // create a 24bit RGB system memory surface return uno::Reference< rendering::XBitmap >(new CanvasBitmap(pBitmap,getDevice())); @@ -137,12 +139,11 @@ namespace dxcanvas if( !getDevice() ) return uno::Reference< rendering::XBitmap >(); // we're disposed - DXSurfaceBitmapSharedPtr pBitmap( - new DXSurfaceBitmap( + DXSurfaceBitmapSharedPtr pBitmap = std::make_shared<DXSurfaceBitmap>( ::basegfx::unotools::b2ISizeFromIntegerSize2D(size), mpSurfaceProxyManager, mpRenderModule, - true)); + true); // create a 32bit ARGB system memory surface return uno::Reference< rendering::XBitmap >(new CanvasBitmap(pBitmap,getDevice())); diff --git a/canvas/source/directx/dx_surfacebitmap.cxx b/canvas/source/directx/dx_surfacebitmap.cxx index 4fcdcba66d1f..7ca1596bcc96 100644 --- a/canvas/source/directx/dx_surfacebitmap.cxx +++ b/canvas/source/directx/dx_surfacebitmap.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <memory> #include <string.h> #include <com/sun/star/rendering/ColorComponentTag.hpp> @@ -222,19 +223,18 @@ namespace dxcanvas // create container for pixel data if(mbAlpha) { - mpGDIPlusBitmap.reset( - new Gdiplus::Bitmap( + mpGDIPlusBitmap = std::make_shared<Gdiplus::Bitmap>( maSize.getX(), maSize.getY(), PixelFormat32bppARGB - )); + ); mpGraphics.reset( tools::createGraphicsFromBitmap(mpGDIPlusBitmap) ); // create the colorbuffer object, which is basically a simple // wrapper around the directx surface. the colorbuffer is the // interface which is used by the surfaceproxy to support any // kind of underlying structure for the pixel data container. - mpColorBuffer.reset(new GDIColorBuffer(mpGDIPlusBitmap,maSize)); + mpColorBuffer = std::make_shared<GDIColorBuffer>(mpGDIPlusBitmap,maSize); } else { @@ -244,7 +244,7 @@ namespace dxcanvas // wrapper around the directx surface. the colorbuffer is the // interface which is used by the surfaceproxy to support any // kind of underlying structure for the pixel data container. - mpColorBuffer.reset(new DXColorBuffer(mpSurface,maSize)); + mpColorBuffer = std::make_shared<DXColorBuffer>(mpSurface,maSize); } // create a (possibly hardware accelerated) mirror surface. @@ -324,10 +324,10 @@ namespace dxcanvas Gdiplus::PixelFormat nFormat = hasAlpha() ? PixelFormat32bppARGB : PixelFormat32bppRGB; // construct a gdi+ bitmap from the raw pixel data. - pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(), + pResult = std::make_shared<Gdiplus::Bitmap>( maSize.getX(),maSize.getY(), aLockedRect.Pitch, nFormat, - static_cast<BYTE *>(aLockedRect.pBits) )); + static_cast<BYTE *>(aLockedRect.pBits) ); mpSurface->UnlockRect(); } diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx index 34b983c7ae51..67c49f4d1420 100644 --- a/fpicker/source/win32/VistaFilePicker.cxx +++ b/fpicker/source/win32/VistaFilePicker.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> + #include "VistaFilePicker.hxx" #include "WinImplHelper.hxx" @@ -57,7 +61,7 @@ namespace VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR, bool bFolderPicker) : TVistaFilePickerBase (m_aMutex ) , m_xSMGR (xSMGR ) - , m_rDialog (new VistaFilePickerImpl()) + , m_rDialog (std::make_shared<VistaFilePickerImpl>()) , m_aAsyncExecute (m_rDialog ) , m_nFilePickerThreadId (0 ) , m_bInitialized (false ) @@ -71,7 +75,7 @@ VistaFilePicker::~VistaFilePicker() void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_ADD_PICKER_LISTENER); rRequest->setArgument(PROP_PICKER_LISTENER, xListener); @@ -80,7 +84,7 @@ void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< void SAL_CALL VistaFilePicker::removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_REMOVE_PICKER_LISTENER); rRequest->setArgument(PROP_PICKER_LISTENER, xListener); @@ -95,7 +99,7 @@ void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode) { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_MULTISELECTION_MODE); rRequest->setArgument(PROP_MULTISELECTION_MODE, bMode); @@ -106,7 +110,7 @@ void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle) { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_TITLE); rRequest->setArgument(PROP_TITLE, sTitle); @@ -116,7 +120,7 @@ void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle) void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle , const OUString& sFilter) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_APPEND_FILTER); rRequest->setArgument(PROP_FILTER_TITLE, sTitle ); rRequest->setArgument(PROP_FILTER_VALUE, sFilter); @@ -126,7 +130,7 @@ void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle , void SAL_CALL VistaFilePicker::setCurrentFilter(const OUString& sTitle) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_CURRENT_FILTER); rRequest->setArgument(PROP_FILTER_TITLE, sTitle); @@ -135,7 +139,7 @@ void SAL_CALL VistaFilePicker::setCurrentFilter(const OUString& sTitle) OUString SAL_CALL VistaFilePicker::getCurrentFilter() { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_GET_CURRENT_FILTER); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED); @@ -147,7 +151,7 @@ OUString SAL_CALL VistaFilePicker::getCurrentFilter() void SAL_CALL VistaFilePicker::appendFilterGroup(const OUString& /*sGroupTitle*/, const css::uno::Sequence< css::beans::StringPair >& rFilters ) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_APPEND_FILTERGROUP); rRequest->setArgument(PROP_FILTER_GROUP, rFilters); @@ -158,7 +162,7 @@ void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName ) { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_DEFAULT_NAME); rRequest->setArgument(PROP_FILENAME, sName); @@ -169,7 +173,7 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_DIRECTORY); rRequest->setArgument(PROP_DIRECTORY, sDirectory); @@ -180,7 +184,7 @@ OUString SAL_CALL VistaFilePicker::getDisplayDirectory() { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_GET_DIRECTORY); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED); const OUString sDirectory = rRequest->getArgumentOrDefault(PROP_DIRECTORY, OUString()); @@ -202,7 +206,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles() css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_GET_SELECTED_FILES); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED); @@ -224,7 +228,7 @@ void VistaFilePicker::ensureInit() { if (m_bFolderPicker) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_CREATE_FOLDER_PICKER); if ( ! m_aAsyncExecute.isRunning()) m_aAsyncExecute.create(); @@ -247,7 +251,7 @@ void VistaFilePicker::ensureInit() { ensureInit(); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL); // if we want to show a modal window, the calling thread needs to process messages @@ -268,7 +272,7 @@ void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , ::sal_Int16 nControlAction, const css::uno::Any& aValue ) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_CONTROL_VALUE); rRequest->setArgument(PROP_CONTROL_ID , nControlId ); rRequest->setArgument(PROP_CONTROL_ACTION, nControlAction); @@ -280,7 +284,7 @@ void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , ::sal_Int16 nControlAction) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_GET_CONTROL_VALUE); rRequest->setArgument(PROP_CONTROL_ID , nControlId ); rRequest->setArgument(PROP_CONTROL_ACTION, nControlAction); @@ -292,7 +296,7 @@ css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, sal_Bool bEnable ) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_ENABLE_CONTROL); rRequest->setArgument(PROP_CONTROL_ID , nControlId); rRequest->setArgument(PROP_CONTROL_ENABLE, bEnable ); @@ -303,7 +307,7 @@ void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, const OUString& sLabel ) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_SET_CONTROL_LABEL); rRequest->setArgument(PROP_CONTROL_ID , nControlId); rRequest->setArgument(PROP_CONTROL_LABEL, sLabel ); @@ -313,7 +317,7 @@ void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, OUString SAL_CALL VistaFilePicker::getLabel(::sal_Int16 nControlId) { - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (VistaFilePickerImpl::E_GET_CONTROL_LABEL); rRequest->setArgument(PROP_CONTROL_ID, nControlId); @@ -488,7 +492,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An { lArguments[1] >>= xParentWindow; } - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); if (bFileOpenDialog) rRequest->setRequest (VistaFilePickerImpl::E_CREATE_OPEN_DIALOG); else diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/VistaFilePickerEventHandler.cxx index 66b12fd015de..a116a69092c2 100644 --- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> #include "VistaFilePickerEventHandler.hxx" @@ -293,7 +296,7 @@ void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType, ::sal_Int16 nControlID) { // See special handling in ~AsyncRequests for this static - static AsyncRequests aNotify(RequestHandlerRef(new AsyncPickerEvents())); + static AsyncRequests aNotify(std::make_shared<AsyncPickerEvents>()); ::cppu::OInterfaceContainerHelper* pContainer = m_lListener.getContainer( cppu::UnoType<css::ui::dialogs::XFilePickerListener>::get()); if ( ! pContainer) @@ -306,7 +309,7 @@ void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType, { css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener (pIterator.next(), css::uno::UNO_QUERY); - RequestRef rRequest(new Request()); + RequestRef rRequest = std::make_shared<Request>(); rRequest->setRequest (eEventType); rRequest->setArgument(PROP_PICKER_LISTENER, xListener); if ( nControlID ) diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 05c1037bcbe1..875f4924fbf4 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> + #include <svsys.h> #include "gdiimpl.hxx" @@ -2108,7 +2112,7 @@ bool WinSalGraphicsImpl::drawPolyPolygon( // (at least for now...) // create data - pGraphicsPath.reset(new Gdiplus::GraphicsPath()); + pGraphicsPath = std::make_shared<Gdiplus::GraphicsPath>(); for(sal_uInt32 a(0); a < nCount; a++) { @@ -2308,7 +2312,7 @@ bool WinSalGraphicsImpl::drawPolyLine( else { // fill data of buffered data - pGraphicsPath.reset(new Gdiplus::GraphicsPath()); + pGraphicsPath = std::make_shared<Gdiplus::GraphicsPath>(); impAddB2DPolygonToGDIPlusGraphicsPathReal( *pGraphicsPath, |