summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 13:22:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 19:31:14 +0100
commit3bbc0cf67cd5aa0ec5a1997794d21a87830bc618 (patch)
treebd912f9c91d8f96969377168fab9e5c5cc59a895 /vcl
parent7589e8413411aa4e0bf437ec0a7080c577a9c1d9 (diff)
loplugin:makeshared in svgio..writerperfect
Change-Id: I0f8de0f78c7a8fb78d47ee5dfed09019b4eb5288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87357 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/FixedTextureAtlas.cxx2
-rw-r--r--vcl/opengl/PackedTextureAtlas.cxx2
-rw-r--r--vcl/opengl/texture.cxx6
-rw-r--r--vcl/qt5/Qt5Menu.cxx2
-rw-r--r--vcl/qt5/Qt5SvpGraphics.cxx4
-rw-r--r--vcl/qt5/Qt5SvpSurface.cxx4
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/app/settings.cxx4
-rw-r--r--vcl/source/app/svmain.cxx4
-rw-r--r--vcl/source/control/button.cxx2
-rw-r--r--vcl/source/filter/graphicfilter.cxx10
-rw-r--r--vcl/source/filter/wmf/wmf.cxx6
-rw-r--r--vcl/source/gdi/graph.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx2
-rw-r--r--vcl/source/gdi/print.cxx4
-rw-r--r--vcl/source/gdi/print3.cxx2
-rw-r--r--vcl/source/gdi/region.cxx14
-rw-r--r--vcl/source/gdi/virdev.cxx2
-rw-r--r--vcl/source/outdev/font.cxx2
-rw-r--r--vcl/source/outdev/nativecontrols.cxx2
-rw-r--r--vcl/source/window/builder.cxx2
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx14
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx2
-rw-r--r--vcl/unx/gtk3/cairo_gtk3_cairo.cxx5
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx2
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx4
26 files changed, 53 insertions, 54 deletions
diff --git a/vcl/opengl/FixedTextureAtlas.cxx b/vcl/opengl/FixedTextureAtlas.cxx
index 77c659f2bec6..7425942d127d 100644
--- a/vcl/opengl/FixedTextureAtlas.cxx
+++ b/vcl/opengl/FixedTextureAtlas.cxx
@@ -25,7 +25,7 @@ struct FixedTexture
std::vector<bool> maAllocatedSlots;
FixedTexture(int nTextureWidth, int nTextureHeight, int nNumberOfSlots)
- : mpTexture(new ImplOpenGLTexture(nTextureWidth, nTextureHeight, true))
+ : mpTexture(std::make_shared<ImplOpenGLTexture>(nTextureWidth, nTextureHeight, true))
, mnFreeSlots(nNumberOfSlots)
, maAllocatedSlots(nNumberOfSlots, false)
{
diff --git a/vcl/opengl/PackedTextureAtlas.cxx b/vcl/opengl/PackedTextureAtlas.cxx
index f881afe60f16..e56e7207bfa2 100644
--- a/vcl/opengl/PackedTextureAtlas.cxx
+++ b/vcl/opengl/PackedTextureAtlas.cxx
@@ -114,7 +114,7 @@ struct PackedTexture
std::unique_ptr<Node> mpRootNode;
PackedTexture(int nWidth, int nHeight)
- : mpTexture(new ImplOpenGLTexture(nWidth, nHeight, true))
+ : mpTexture(std::make_shared<ImplOpenGLTexture>(nWidth, nHeight, true))
, mpRootNode(new Node(nWidth, nHeight))
{}
};
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 3b575e9bfcfe..d33cd2453832 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -278,21 +278,21 @@ OpenGLTexture::OpenGLTexture(const std::shared_ptr<ImplOpenGLTexture>& rpImpl, t
OpenGLTexture::OpenGLTexture( int nWidth, int nHeight, bool bAllocate )
: maRect( Point( 0, 0 ), Size( nWidth, nHeight ) )
- , mpImpl(new ImplOpenGLTexture(nWidth, nHeight, bAllocate))
+ , mpImpl(std::make_shared<ImplOpenGLTexture>(nWidth, nHeight, bAllocate))
, mnSlotNumber(-1)
{
}
OpenGLTexture::OpenGLTexture( int nX, int nY, int nWidth, int nHeight )
: maRect( Point( 0, 0 ), Size( nWidth, nHeight ) )
- , mpImpl(new ImplOpenGLTexture(nX, nY, nWidth, nHeight))
+ , mpImpl(std::make_shared<ImplOpenGLTexture>(nX, nY, nWidth, nHeight))
, mnSlotNumber(-1)
{
}
OpenGLTexture::OpenGLTexture( int nWidth, int nHeight, int nFormat, int nType, void const * pData )
: maRect( Point( 0, 0 ), Size( nWidth, nHeight ) )
- , mpImpl(new ImplOpenGLTexture(nWidth, nHeight, nFormat, nType, pData))
+ , mpImpl(std::make_shared<ImplOpenGLTexture>(nWidth, nHeight, nFormat, nType, pData))
, mnSlotNumber(-1)
{
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index e2ccd1ffc6af..d66dc72fd916 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -235,7 +235,7 @@ void Qt5Menu::ReinitializeActionGroup(unsigned nPos)
}
else
{
- pCurrentItem->mpActionGroup.reset(new QActionGroup(nullptr));
+ pCurrentItem->mpActionGroup = std::make_shared<QActionGroup>(nullptr);
pCurrentItem->mpActionGroup->setExclusive(true);
}
}
diff --git a/vcl/qt5/Qt5SvpGraphics.cxx b/vcl/qt5/Qt5SvpGraphics.cxx
index fc58bbcfcc15..55de70b2a186 100644
--- a/vcl/qt5/Qt5SvpGraphics.cxx
+++ b/vcl/qt5/Qt5SvpGraphics.cxx
@@ -50,13 +50,13 @@ bool Qt5SvpGraphics::SupportsCairo() const { return true; }
cairo::SurfaceSharedPtr
Qt5SvpGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
{
- return cairo::SurfaceSharedPtr(new cairo::Qt5SvpSurface(rSurface));
+ return std::make_shared<cairo::Qt5SvpSurface>(rSurface);
}
cairo::SurfaceSharedPtr Qt5SvpGraphics::CreateSurface(const OutputDevice& /*rRefDevice*/, int x,
int y, int width, int height) const
{
- return cairo::SurfaceSharedPtr(new cairo::Qt5SvpSurface(this, x, y, width, height));
+ return std::make_shared<cairo::Qt5SvpSurface>(this, x, y, width, height);
}
#endif
diff --git a/vcl/qt5/Qt5SvpSurface.cxx b/vcl/qt5/Qt5SvpSurface.cxx
index 21e0ca03b5b2..4bab429971ba 100644
--- a/vcl/qt5/Qt5SvpSurface.cxx
+++ b/vcl/qt5/Qt5SvpSurface.cxx
@@ -62,10 +62,10 @@ CairoSharedPtr Qt5SvpSurface::getCairo() const
SurfaceSharedPtr Qt5SvpSurface::getSimilar(int cairo_content_type, int width, int height) const
{
- return SurfaceSharedPtr(new Qt5SvpSurface(CairoSurfaceSharedPtr(
+ return std::make_shared<Qt5SvpSurface>(CairoSurfaceSharedPtr(
cairo_surface_create_similar(
m_pSurface.get(), static_cast<cairo_content_t>(cairo_content_type), width, height),
- &cairo_surface_destroy)));
+ &cairo_surface_destroy));
}
void Qt5SvpSurface::flush() const
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index a8f90b24afdd..687c0d63723a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1235,7 +1235,7 @@ private:
std::shared_ptr<VclSizeGroup> m_xGroup;
public:
SalInstanceSizeGroup()
- : m_xGroup(new VclSizeGroup)
+ : m_xGroup(std::make_shared<VclSizeGroup>())
{
}
virtual void add_widget(weld::Widget* pWidget) override
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 30e9616740a3..59962b2bdd30 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -466,7 +466,7 @@ ImplStyleData::ImplStyleData() :
mbAutoMnemonic(true),
meUseImagesInMenus(TRISTATE_INDET),
mnMinThumbSize(16),
- mIconThemeSelector(new vcl::IconThemeSelector()),
+ mIconThemeSelector(std::make_shared<vcl::IconThemeSelector>()),
meContextMenuShortcuts(TRISTATE_INDET),
mnEdgeBlending(35),
maEdgeBlendingTopLeftColor(Color(0xC0, 0xC0, 0xC0)),
@@ -579,7 +579,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mbPreferredUseImagesInMenus(rData.mbPreferredUseImagesInMenus),
mnMinThumbSize(rData.mnMinThumbSize),
mIconThemeScanner(rData.mIconThemeScanner?new vcl::IconThemeScanner(*rData.mIconThemeScanner):nullptr),
- mIconThemeSelector(new vcl::IconThemeSelector(*rData.mIconThemeSelector)),
+ mIconThemeSelector(std::make_shared<vcl::IconThemeSelector>(*rData.mIconThemeSelector)),
mIconTheme(rData.mIconTheme),
mbSkipDisabledInMenus(rData.mbSkipDisabledInMenus),
mbHideDisabledMenuItems(rData.mbHideDisabledMenuItems),
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 998ece19dc21..23663c56ad9d 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -355,8 +355,8 @@ bool InitVCL()
pSVData->maAppData.mxAppFileName = aNativeFileName;
// Initialize global data
- pSVData->maGDIData.mxScreenFontList.reset(new PhysicalFontCollection);
- pSVData->maGDIData.mxScreenFontCache.reset(new ImplFontCache);
+ pSVData->maGDIData.mxScreenFontList = std::make_shared<PhysicalFontCollection>();
+ pSVData->maGDIData.mxScreenFontCache = std::make_shared<ImplFontCache>();
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
g_bIsLeanException = getenv("LO_LEAN_EXCEPTION") != nullptr;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e35ab9de4ef6..7aebb0d1397f 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2082,7 +2082,7 @@ void RadioButton::group(RadioButton &rOther)
if (!m_xGroup)
{
- m_xGroup.reset(new std::vector<VclPtr<RadioButton> >);
+ m_xGroup = std::make_shared<std::vector<VclPtr<RadioButton> >>();
m_xGroup->push_back(this);
}
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 20dd734bb30c..4a2dae41dd20 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1661,7 +1661,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
if(!aMemStream.GetError() )
{
- VectorGraphicDataPtr aVectorGraphicDataPtr(new VectorGraphicData(aNewData, rPath, VectorGraphicDataType::Svg));
+ VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg);
rGraphic = Graphic(aVectorGraphicDataPtr);
bOkay = true;
}
@@ -1674,7 +1674,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
if(!rIStream.GetError())
{
- VectorGraphicDataPtr aVectorGraphicDataPtr(new VectorGraphicData(aNewData, rPath, VectorGraphicDataType::Svg));
+ VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, rPath, VectorGraphicDataType::Svg);
rGraphic = Graphic(aVectorGraphicDataPtr);
bOkay = true;
}
@@ -1744,11 +1744,11 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
{
const bool bIsWmf(aFilterName.equalsIgnoreAsciiCase(IMP_WMF));
const VectorGraphicDataType aDataType(bIsWmf ? VectorGraphicDataType::Wmf : VectorGraphicDataType::Emf);
- VectorGraphicDataPtr aVectorGraphicDataPtr(
- new VectorGraphicData(
+ VectorGraphicDataPtr aVectorGraphicDataPtr =
+ std::make_shared<VectorGraphicData>(
aNewData,
rPath,
- aDataType));
+ aDataType);
if (pExtHeader)
{
diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx
index d0fe5fa0ce22..3b9156ac84a1 100644
--- a/vcl/source/filter/wmf/wmf.cxx
+++ b/vcl/source/filter/wmf/wmf.cxx
@@ -49,11 +49,11 @@ bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF )
// Throw into VectorGraphicData to get the import. Do not care
// too much for type, this will be checked there. Also no path
// needed, it is a temporary object
- VectorGraphicDataPtr aVectorGraphicDataPtr(
- new VectorGraphicData(
+ VectorGraphicDataPtr aVectorGraphicDataPtr =
+ std::make_shared<VectorGraphicData>(
aNewData,
OUString(),
- VectorGraphicDataType::Emf));
+ VectorGraphicDataType::Emf);
// create a Graphic and grep Metafile from it
const Graphic aGraphic(aVectorGraphicDataPtr);
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index ec2de64a74fe..01e99662ff88 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -215,7 +215,7 @@ Graphic::Graphic(const BitmapEx& rBmpEx)
// and we need to be able to see and preserve 'stock' images too.
Graphic::Graphic(const Image& rImage)
// FIXME: should really defer the BitmapEx load.
- : mxImpGraphic(new ImpGraphic(rImage.GetBitmapEx()))
+ : mxImpGraphic(std::make_shared<ImpGraphic>(rImage.GetBitmapEx()))
{
OUString aStock = rImage.GetStock();
if (aStock.getLength())
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 067497301e02..f8292b30fd05 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1906,7 +1906,7 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
aDataType = VectorGraphicDataType::Emf;
}
- VectorGraphicDataPtr aVectorGraphicDataPtr(new VectorGraphicData(aNewData, aPath, aDataType));
+ VectorGraphicDataPtr aVectorGraphicDataPtr = std::make_shared<VectorGraphicData>(aNewData, aPath, aDataType);
rImpGraphic = aVectorGraphicDataPtr;
}
}
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index e80fc25d777b..364f0af35587 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -661,8 +661,8 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
// Init data
ImplUpdatePageData();
- mxFontCollection.reset(new PhysicalFontCollection);
- mxFontCache.reset(new ImplFontCache);
+ mxFontCollection = std::make_shared<PhysicalFontCollection>();
+ mxFontCache = std::make_shared<ImplFontCache>();
mpGraphics->GetDevFontList(mxFontCollection.get());
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 0b2721b718cf..8a96ec81e5c5 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1699,7 +1699,7 @@ void PrinterController::createProgressDialog()
if( bShow && ! Application::IsHeadlessModeEnabled() )
{
- mpImplData->mxProgress.reset(new PrintProgressDialog(getWindow(), getPageCountProtected()));
+ mpImplData->mxProgress = std::make_shared<PrintProgressDialog>(getWindow(), getPageCountProtected());
weld::DialogController::runAsync(mpImplData->mxProgress, [](sal_Int32 /*nResult*/){});
}
}
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 4f830a2195e8..42fc0c0b1c4a 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -390,11 +390,11 @@ void vcl::Region::ImplCreatePolyPolyRegion( const tools::PolyPolygon& rPolyPoly
// width OR height == 1 ? => Rectangular region
if((1 == aRect.GetWidth()) || (1 == aRect.GetHeight()) || rPolyPoly.IsRect())
{
- mpRegionBand.reset(new RegionBand(aRect));
+ mpRegionBand = std::make_shared<RegionBand>(aRect);
}
else
{
- mpPolyPolygon.reset(new tools::PolyPolygon(rPolyPoly));
+ mpPolyPolygon = std::make_shared<tools::PolyPolygon>(rPolyPoly);
}
mbIsNull = false;
@@ -406,7 +406,7 @@ void vcl::Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPoly
{
if(rPolyPoly.count() && !rPolyPoly.getB2DRange().isEmpty())
{
- mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(rPolyPoly));
+ mpB2DPolyPolygon = std::make_shared<basegfx::B2DPolyPolygon>(rPolyPoly);
mbIsNull = false;
}
}
@@ -1269,7 +1269,7 @@ tools::PolyPolygon vcl::Region::GetAsPolyPolygon() const
{
// the polygon needs to be converted, buffer the down conversion
const tools::PolyPolygon aPolyPolgon(*getB2DPolyPolygon());
- const_cast< vcl::Region* >(this)->mpPolyPolygon.reset(new tools::PolyPolygon(aPolyPolgon));
+ const_cast< vcl::Region* >(this)->mpPolyPolygon = std::make_shared<tools::PolyPolygon>(aPolyPolgon);
return *getPolyPolygon();
}
@@ -1278,7 +1278,7 @@ tools::PolyPolygon vcl::Region::GetAsPolyPolygon() const
{
// the BandRegion needs to be converted, buffer the conversion
const tools::PolyPolygon aPolyPolgon(ImplCreatePolyPolygonFromRegionBand());
- const_cast< vcl::Region* >(this)->mpPolyPolygon.reset(new tools::PolyPolygon(aPolyPolgon));
+ const_cast< vcl::Region* >(this)->mpPolyPolygon = std::make_shared<tools::PolyPolygon>(aPolyPolgon);
return *getPolyPolygon();
}
@@ -1297,7 +1297,7 @@ basegfx::B2DPolyPolygon vcl::Region::GetAsB2DPolyPolygon() const
{
// the polygon needs to be converted, buffer the up conversion. This will be preferred from now.
const basegfx::B2DPolyPolygon aB2DPolyPolygon(getPolyPolygon()->getB2DPolyPolygon());
- const_cast< vcl::Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
+ const_cast< vcl::Region* >(this)->mpB2DPolyPolygon = std::make_shared<basegfx::B2DPolyPolygon>(aB2DPolyPolygon);
return *getB2DPolyPolygon();
}
@@ -1306,7 +1306,7 @@ basegfx::B2DPolyPolygon vcl::Region::GetAsB2DPolyPolygon() const
{
// the BandRegion needs to be converted, buffer the conversion
const basegfx::B2DPolyPolygon aB2DPolyPolygon(ImplCreateB2DPolyPolygonFromRegionBand());
- const_cast< vcl::Region* >(this)->mpB2DPolyPolygon.reset(new basegfx::B2DPolyPolygon(aB2DPolyPolygon));
+ const_cast< vcl::Region* >(this)->mpB2DPolyPolygon = std::make_shared<basegfx::B2DPolyPolygon>(aB2DPolyPolygon);
return *getB2DPolyPolygon();
}
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index a2bbcdff8f03..0eeab8b8dd44 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -482,7 +482,7 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
mxFontCollection = pSVData->maGDIData.mxScreenFontList->Clone();
// prepare to use new font lists
- mxFontCache.reset(new ImplFontCache);
+ mxFontCache = std::make_shared<ImplFontCache>();
}
sal_uInt16 VirtualDevice::GetBitCount() const
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 91c52398c7ec..d7e0ecaf50af 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1476,7 +1476,7 @@ void OutputDevice::SetFontCollectionFromSVData()
void OutputDevice::ResetNewFontCache()
{
- mxFontCache.reset(new ImplFontCache{});
+ mxFontCache = std::make_shared<ImplFontCache>();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx
index 51d4f2882ccc..847cbeb39aa9 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/outdev/nativecontrols.cxx
@@ -268,7 +268,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont
}
break;
case ControlType::Generic:
- aResult.reset( new ImplControlValue( rVal ) );
+ aResult = std::make_shared<ImplControlValue>( rVal );
break;
case ControlType::MenuPopup:
{
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 63cbe782d435..5017c52cb000 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1688,7 +1688,7 @@ VclBuilder::customMakeWidget GetCustomMakeWidget(const OString& name)
#endif
if (!pFunction)
{
- pModule.reset(new NoAutoUnloadModule);
+ pModule = std::make_shared<NoAutoUnloadModule>();
bool ok = pModule->loadRelative(&thisModule, sModule);
if (!ok)
{
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 83c09d6a5ec2..864d3fdb8bd7 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -506,7 +506,7 @@ bool X11SalGraphics::SupportsCairo() const
cairo::SurfaceSharedPtr X11SalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
{
- return cairo::SurfaceSharedPtr(new cairo::X11Surface(rSurface));
+ return std::make_shared<cairo::X11Surface>(rSurface);
}
namespace
@@ -531,11 +531,11 @@ cairo::SurfaceSharedPtr X11SalGraphics::CreateSurface( const OutputDevice& rRefD
int x, int y, int width, int height ) const
{
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
- return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)),
- x,y,width,height));
+ return std::make_shared<cairo::X11Surface>(getSysData(static_cast<const vcl::Window&>(rRefDevice)),
+ x,y,width,height);
if( rRefDevice.IsVirtual() )
- return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)),
- x,y,width,height));
+ return std::make_shared<cairo::X11Surface>(getSysData(static_cast<const VirtualDevice&>(rRefDevice)),
+ x,y,width,height);
return cairo::SurfaceSharedPtr();
}
@@ -549,9 +549,9 @@ cairo::SurfaceSharedPtr X11SalGraphics::CreateBitmapSurface( const OutputDevice&
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
{
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
- return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)), rData ));
+ return std::make_shared<cairo::X11Surface>(getSysData(static_cast<const vcl::Window&>(rRefDevice)), rData );
else if( rRefDevice.IsVirtual() )
- return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)), rData ));
+ return std::make_shared<cairo::X11Surface>(getSysData(static_cast<const VirtualDevice&>(rRefDevice)), rData );
}
return cairo::SurfaceSharedPtr();
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 90309c95ea53..e7570538070c 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1064,7 +1064,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
aContext.URL = aPDFUrl;
// create and initialize PDFWriter
- xWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) );
+ xWriter = std::make_shared<vcl::PDFWriter>( aContext, uno::Reference< beans::XMaterialHolder >() );
}
xWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
diff --git a/vcl/unx/gtk3/cairo_gtk3_cairo.cxx b/vcl/unx/gtk3/cairo_gtk3_cairo.cxx
index 4b5f7358d070..2e882ded6231 100644
--- a/vcl/unx/gtk3/cairo_gtk3_cairo.cxx
+++ b/vcl/unx/gtk3/cairo_gtk3_cairo.cxx
@@ -95,12 +95,11 @@ namespace cairo
**/
SurfaceSharedPtr Gtk3Surface::getSimilar(int cairo_content_type, int width, int height ) const
{
- return SurfaceSharedPtr(
- new Gtk3Surface(
+ return std::make_shared<Gtk3Surface>(
CairoSurfaceSharedPtr(
cairo_surface_create_similar( mpSurface.get(),
static_cast<cairo_content_t>(cairo_content_type), width, height ),
- &cairo_surface_destroy )));
+ &cairo_surface_destroy ));
}
void Gtk3Surface::flush() const
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index c4b58aaebc67..2622ccf46d5d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -432,7 +432,7 @@ std::shared_ptr<vcl::unx::GtkPrintWrapper> const &
GtkInstance::getPrintWrapper() const
{
if (!m_xPrintWrapper)
- m_xPrintWrapper.reset(new vcl::unx::GtkPrintWrapper);
+ m_xPrintWrapper = std::make_shared<vcl::unx::GtkPrintWrapper>();
return m_xPrintWrapper;
}
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 9a1a0474efd6..7661ee3ca046 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -3448,12 +3448,12 @@ bool GtkSalGraphics::SupportsCairo() const
cairo::SurfaceSharedPtr GtkSalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
{
- return cairo::SurfaceSharedPtr(new cairo::Gtk3Surface(rSurface));
+ return std::make_shared<cairo::Gtk3Surface>(rSurface);
}
cairo::SurfaceSharedPtr GtkSalGraphics::CreateSurface(const OutputDevice& /*rRefDevice*/, int x, int y, int width, int height) const
{
- return cairo::SurfaceSharedPtr(new cairo::Gtk3Surface(this, x, y, width, height));
+ return std::make_shared<cairo::Gtk3Surface>(this, x, y, width, height);
}
#endif