summaryrefslogtreecommitdiff
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
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>
-rw-r--r--svgio/source/svgreader/svgmasknode.cxx3
-rw-r--r--toolkit/source/awt/vclxprinter.cxx2
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx2
-rw-r--r--ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx2
-rw-r--r--unotools/source/config/useroptions.cxx2
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.cxx2
-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
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx6
-rw-r--r--writerfilter/source/filter/WriterFilter.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx4
-rw-r--r--writerperfect/qa/unit/WPXSvStreamTest.cxx2
-rw-r--r--writerperfect/source/impress/KeynoteImportFilter.cxx2
38 files changed, 70 insertions, 72 deletions
diff --git a/svgio/source/svgreader/svgmasknode.cxx b/svgio/source/svgreader/svgmasknode.cxx
index 286a1088ab60..035678d09b57 100644
--- a/svgio/source/svgreader/svgmasknode.cxx
+++ b/svgio/source/svgreader/svgmasknode.cxx
@@ -272,8 +272,7 @@ namespace svgio
const drawinglayer::primitive2d::Primitive2DReference xInverseMask(
new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
aMaskTarget,
- basegfx::BColorModifierSharedPtr(
- new basegfx::BColorModifier_luminance_to_alpha())));
+ std::make_shared<basegfx::BColorModifier_luminance_to_alpha>()));
aMaskTarget = drawinglayer::primitive2d::Primitive2DContainer { xInverseMask };
}
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index e18925f7013d..23dce1b42823 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -254,7 +254,7 @@ sal_Bool VCLXPrinter::start( const OUString& /*rJobName*/, sal_Int16 /*nCopies*/
if (mxPrinter.get())
{
maInitJobSetup = mxPrinter->GetJobSetup();
- mxListener.reset(new vcl::OldStylePrintAdaptor(mxPrinter, nullptr));
+ mxListener = std::make_shared<vcl::OldStylePrintAdaptor>(mxPrinter, nullptr);
}
return true;
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index 8b01545601bf..46cfe583f673 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -243,7 +243,7 @@ void UnoControlHolderList::replaceControlById( ControlIdentifier _nId, const uno
if ( pos == maControls.end() )
return;
- pos->second.reset( new UnoControlHolder( pos->second->getName(), _rxNewControl ) );
+ pos->second = std::make_shared<UnoControlHolder>( pos->second->getName(), _rxNewControl );
}
diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
index 062cf2d5683f..3051d3e465c7 100644
--- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
@@ -426,7 +426,7 @@ bool DataSupplier::getData()
}
std::shared_ptr<ContentProperties> const
- pContentProperties(new ContentProperties(rRes));
+ pContentProperties = std::make_shared<ContentProperties>(rRes);
// Check resource against open mode.
switch ( m_pImpl->m_nOpenMode )
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index f6a06747e78c..66f354ef5ae5 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -266,7 +266,7 @@ SvtUserOptions::SvtUserOptions ()
if (xSharedImpl.expired())
{
- xImpl.reset(new Impl);
+ xImpl = std::make_shared<Impl>();
xSharedImpl = xImpl;
ItemHolder1::holdConfigItem(EItem::UserOptions);
}
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index cfccb4d91b33..f9ade49966e2 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -482,7 +482,7 @@ void LocaleDataWrapper::getSecondaryCalendarImpl()
auto pCal = std::find_if(xCals.begin(), xCals.end(),
[](const Calendar2& rCal) { return !rCal.Default; });
if (pCal != xCals.end())
- xSecondaryCalendar.reset( new Calendar2( *pCal));
+ xSecondaryCalendar = std::make_shared<Calendar2>( *pCal);
}
bSecondaryCalendarValid = true;
}
@@ -531,7 +531,7 @@ void LocaleDataWrapper::getDefaultCalendarImpl()
if (pCal == xCals.end())
pCal = xCals.begin();
}
- xDefaultCalendar.reset( new Calendar2( *pCal));
+ xDefaultCalendar = std::make_shared<Calendar2>( *pCal);
}
}
diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx
index 332249049b84..66d14d0cfa18 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.cxx
@@ -76,7 +76,7 @@ public:
ScVbaCommandBars::ScVbaCommandBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< frame::XModel >& xModel ) : CommandBars_BASE( xParent, xContext, xIndexAccess )
{
- m_pCBarHelper.reset( new VbaCommandBarHelper( mxContext, xModel ) );
+ m_pCBarHelper = std::make_shared<VbaCommandBarHelper>( mxContext, xModel );
m_xNameAccess = m_pCBarHelper->getPersistentWindowState();
}
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
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 79a9a25f0ea0..c4245715ff8e 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -443,9 +443,9 @@ void DomainMapperTableManager::startLevel( )
m_aCellWidths.back()->pop_back();
}
- IntVectorPtr pNewGrid( new vector<sal_Int32> );
- IntVectorPtr pNewSpans( new vector<sal_Int32> );
- IntVectorPtr pNewCellWidths( new vector<sal_Int32> );
+ IntVectorPtr pNewGrid = std::make_shared<vector<sal_Int32>>();
+ IntVectorPtr pNewSpans = std::make_shared<vector<sal_Int32>>();
+ IntVectorPtr pNewCellWidths = std::make_shared<vector<sal_Int32>>();
TablePositionHandlerPtr pNewPositionHandler;
m_aTableGrid.push_back( pNewGrid );
m_aGridSpans.push_back( pNewSpans );
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 4b4ccbb2a431..7afc9c536637 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -249,8 +249,8 @@ sal_Bool WriterFilter::filter(const uno::Sequence<beans::PropertyValue>& rDescri
writerfilter::ooxml::OOXMLStream::Pointer_t pVBAProjectStream(
writerfilter::ooxml::OOXMLDocumentFactory::createStream(
pDocStream, writerfilter::ooxml::OOXMLStream::VBAPROJECT));
- oox::StorageRef xVbaPrjStrg(
- new ::oox::ole::OleStorage(m_xContext, pVBAProjectStream->getDocumentStream(), false));
+ oox::StorageRef xVbaPrjStrg = std::make_shared<::oox::ole::OleStorage>(
+ m_xContext, pVBAProjectStream->getDocumentStream(), false);
if (xVbaPrjStrg.get() && xVbaPrjStrg->isStorage())
{
::oox::ole::VbaProject aVbaProject(m_xContext, xModel, "Writer");
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8bd50d702c98..bb491e363ae9 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -321,7 +321,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
if (xDocumentPropertiesSupplier.is())
m_xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
- m_pGraphicHelper.reset(new oox::GraphicHelper(m_xContext, xFrame, oox::StorageRef()));
+ m_pGraphicHelper = std::make_shared<oox::GraphicHelper>(m_xContext, xFrame, oox::StorageRef());
m_pTokenizer = new RTFTokenizer(*this, m_pInStream.get(), m_xStatusIndicator);
m_pSdrImport = new RTFSdrImport(*this, m_xDstDoc);
@@ -1169,7 +1169,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
{
if (m_aStates.top().getInternalState() == RTFInternalState::BIN)
{
- m_pBinaryData.reset(new SvMemoryStream());
+ m_pBinaryData = std::make_shared<SvMemoryStream>();
m_pBinaryData->WriteChar(ch);
for (int i = 0; i < m_aStates.top().getBinaryToRead() - 1; ++i)
{
diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index cbd0899b54bd..87ad21f84cde 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -78,7 +78,7 @@ shared_ptr<RVNGInputStream> lcl_createStream()
shared_ptr<RVNGInputStream> pInputStream;
if (xInputStream.is())
- pInputStream.reset(new WPXSvInputStream(xInputStream));
+ pInputStream = std::make_shared<WPXSvInputStream>(xInputStream);
return pInputStream;
}
diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx
index d83f8acea431..0ffccf9f38d5 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -129,7 +129,7 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
{
if (aContent.isFolder())
{
- input.reset(new writerperfect::DirectoryStream(xContent));
+ input = std::make_shared<writerperfect::DirectoryStream>(xContent);
bIsPackage = true;
}
}