[Libreoffice-commits] core.git: basctl/source basic/source canvas/source chart2/source configmgr/source connectivity/source cppcanvas/source cppuhelper/source cui/source dbaccess/source desktop/source editeng/source emfio/source extensions/source filter/source include/oox linguistic/source oox/source reportdesign/source sax/source sc/qa sc/source sdext/source sd/qa sd/source sfx2/source slideshow/source starmath/qa svtools/source svx/source sw/qa sw/source unoxml/source vcl/qt5 vcl/source writerfilter/source writerperfect/qa writerperfect/source xmloff/source xmlscript/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 10 12:08:28 UTC 2020
basctl/source/basicide/basides1.cxx | 4
basctl/source/basicide/moduldl2.cxx | 4
basctl/source/dlged/managelang.cxx | 2
basic/source/runtime/runtime.cxx | 4
canvas/source/directx/dx_9rm.cxx | 5 -
canvas/source/tools/surfaceproxymanager.cxx | 6 -
chart2/source/controller/dialogs/DataBrowser.cxx | 4
chart2/source/controller/main/UndoActions.cxx | 2
chart2/source/view/axes/VCartesianCoordinateSystem.cxx | 2
chart2/source/view/main/VLegend.cxx | 2
configmgr/source/lock.cxx | 2
connectivity/source/commontools/RowFunctionParser.cxx | 8 -
connectivity/source/commontools/TTableHelper.cxx | 2
cppcanvas/source/mtfrenderer/bitmapaction.cxx | 15 +--
cppcanvas/source/mtfrenderer/lineaction.cxx | 8 -
cppcanvas/source/mtfrenderer/pointaction.cxx | 4
cppcanvas/source/mtfrenderer/polypolyaction.cxx | 24 ++---
cppcanvas/source/mtfrenderer/textaction.cxx | 42 ++++------
cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 12 +-
cppuhelper/source/servicemanager.cxx | 10 +-
cui/source/dialogs/cuigaldlg.cxx | 4
cui/source/options/optaboutconfig.cxx | 2
dbaccess/source/ui/tabledesign/TableController.cxx | 4
desktop/source/deployment/misc/dp_misc.cxx | 3
editeng/source/editeng/eerdll.cxx | 2
emfio/source/reader/mtftools.cxx | 4
extensions/source/scanner/scanunx.cxx | 2
filter/source/msfilter/msdffimp.cxx | 10 --
include/oox/ole/axcontrol.hxx | 4
include/oox/vml/vmlshapecontainer.hxx | 2
linguistic/source/hyphdsp.cxx | 2
linguistic/source/spelldsp.cxx | 2
linguistic/source/thesdsp.cxx | 2
oox/source/drawingml/diagram/constraintlistcontext.cxx | 2
oox/source/drawingml/textbody.cxx | 2
oox/source/drawingml/textbodycontext.cxx | 2
oox/source/ppt/pptshapegroupcontext.cxx | 2
oox/source/shape/ShapeContextHandler.cxx | 10 --
oox/source/vml/vmlshapecontainer.cxx | 2
reportdesign/source/core/sdr/RptObject.cxx | 12 +-
reportdesign/source/ui/inspection/DataProviderHandler.cxx | 2
reportdesign/source/ui/misc/FunctionHelper.cxx | 2
reportdesign/source/ui/misc/UITools.cxx | 2
reportdesign/source/ui/report/ReportController.cxx | 2
sax/source/tools/fastserializer.cxx | 4
sc/qa/extras/scpdfexport.cxx | 2
sc/qa/unit/helper/qahelper.cxx | 20 ++--
sc/qa/unit/subsequent_export-test.cxx | 6 -
sc/qa/unit/subsequent_filters-test.cxx | 6 -
sc/source/core/data/column.cxx | 3
sc/source/core/data/column3.cxx | 4
sc/source/core/data/document.cxx | 5 -
sc/source/core/data/document10.cxx | 4
sc/source/core/data/dpobject.cxx | 6 -
sc/source/core/data/dpresfilter.cxx | 2
sc/source/core/data/table4.cxx | 2
sc/source/filter/excel/excdoc.cxx | 4
sc/source/filter/excel/xeescher.cxx | 4
sc/source/filter/excel/xiescher.cxx | 2
sc/source/filter/oox/worksheetbuffer.cxx | 2
sc/source/filter/xcl97/xcl97esc.cxx | 2
sc/source/filter/xcl97/xcl97rec.cxx | 2
sc/source/ui/dataprovider/dataprovider.cxx | 8 -
sc/source/ui/docshell/docsh4.cxx | 4
sc/source/ui/miscdlgs/optsolver.cxx | 2
sc/source/ui/view/cellsh2.cxx | 4
sc/source/ui/view/gridwin.cxx | 2
sc/source/ui/view/output.cxx | 2
sc/source/ui/view/tabvwsha.cxx | 4
sc/source/ui/view/viewfun5.cxx | 6 -
sd/qa/unit/filters-test.cxx | 6 -
sd/qa/unit/sdmodeltestbase.hxx | 24 ++---
sd/source/ui/animations/CustomAnimationPane.cxx | 2
sd/source/ui/framework/factories/BasicViewFactory.cxx | 2
sd/source/ui/func/futransf.cxx | 2
sd/source/ui/presenter/PresenterPreviewCache.cxx | 2
sd/source/ui/remotecontrol/Server.cxx | 6 -
sd/source/ui/sidebar/AllMasterPagesSelector.cxx | 2
sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx | 6 -
sd/source/ui/sidebar/MasterPageContainer.cxx | 2
sd/source/ui/sidebar/MasterPageContainerFiller.cxx | 13 +--
sd/source/ui/sidebar/MasterPageDescriptor.cxx | 2
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx | 2
sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 9 --
sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx | 2
sd/source/ui/slidesorter/controller/SlsAnimator.cxx | 6 -
sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 6 -
sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | 2
sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 9 --
sd/source/ui/slidesorter/controller/SlsTransferableData.cxx | 2
sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx | 2
sd/source/ui/view/DocumentRenderer.cxx | 30 ++-----
sd/source/ui/view/drviews2.cxx | 2
sd/source/ui/view/drviews3.cxx | 2
sdext/source/pdfimport/pdfiadaptor.cxx | 3
sdext/source/pdfimport/test/tests.cxx | 2
sdext/source/pdfimport/tree/treevisitorfactory.cxx | 22 ++---
sdext/source/presenter/PresenterPaneBorderPainter.cxx | 3
sdext/source/presenter/PresenterTheme.cxx | 12 +-
sfx2/source/doc/objcont.cxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 2
slideshow/source/engine/expressionnodefactory.cxx | 16 +--
slideshow/source/engine/screenupdater.cxx | 2
slideshow/source/engine/shapes/appletshape.cxx | 7 -
slideshow/source/engine/shapes/drawinglayeranimation.cxx | 5 -
slideshow/source/engine/shapes/gdimtftools.cxx | 2
slideshow/source/engine/shapes/mediashape.cxx | 5 -
slideshow/source/engine/slide/slideimpl.cxx | 18 ++--
slideshow/source/engine/slideview.cxx | 10 +-
slideshow/source/engine/smilfunctionparser.cxx | 5 -
starmath/qa/extras/mmlimport-test.cxx | 4
svtools/source/uno/wizard/wizardshell.cxx | 2
svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 20 ++--
svx/source/dialog/charmap.cxx | 4
svx/source/dialog/rubydialog.cxx | 2
svx/source/dialog/searchcharmap.cxx | 4
svx/source/unodraw/unobrushitemhelper.cxx | 12 +-
svx/source/unodraw/unoshape.cxx | 4
sw/qa/core/filters-test.cxx | 6 -
sw/qa/core/filters-test2.cxx | 7 -
sw/qa/core/uwriter.cxx | 4
sw/source/core/tox/ToxTextGenerator.cxx | 2
sw/source/core/undo/untbl.cxx | 7 -
sw/source/core/undo/untblk.cxx | 4
sw/source/core/unocore/unodraw.cxx | 2
sw/source/core/unocore/unostyle.cxx | 2
sw/source/filter/docx/swdocxreader.cxx | 2
sw/source/filter/html/htmltab.cxx | 4
sw/source/filter/rtf/swparrtf.cxx | 4
sw/source/filter/ww8/wrtw8esh.cxx | 2
sw/source/filter/ww8/wrtw8sty.cxx | 2
sw/source/filter/ww8/ww8par.cxx | 4
sw/source/ui/dbui/mmresultdialogs.cxx | 2
sw/source/ui/vba/vbadocumentproperties.cxx | 4
sw/source/uibase/app/docsh2.cxx | 10 +-
sw/source/uibase/app/docst.cxx | 2
sw/source/uibase/shells/tabsh.cxx | 2
sw/source/uibase/shells/textsh1.cxx | 6 -
sw/source/uibase/shells/txtnum.cxx | 2
unoxml/source/rdf/librdf_repository.cxx | 6 -
vcl/qt5/Qt5Menu.cxx | 2
vcl/source/font/PhysicalFontCollection.cxx | 2
writerfilter/source/dmapper/DomainMapper.cxx | 10 +-
writerfilter/source/dmapper/GraphicImport.cxx | 4
writerfilter/source/dmapper/PageBordersHandler.cxx | 2
writerfilter/source/dmapper/StyleSheetTable.cxx | 6 -
writerfilter/source/dmapper/TablePropertiesHandler.cxx | 12 +-
writerfilter/source/dmapper/TblStylePrHandler.cxx | 2
writerperfect/qa/unit/WPXSvStreamTest.cxx | 2
writerperfect/source/impress/KeynoteImportFilter.cxx | 3
xmloff/source/table/XMLTableExport.cxx | 2
xmloff/source/table/XMLTableImport.cxx | 4
xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 4
153 files changed, 381 insertions(+), 428 deletions(-)
New commits:
commit 175a2063effa1c5a3eab896c6c4b0d07f3588edb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jan 10 12:30:24 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 10 13:07:41 2020 +0100
use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 79c809927fb2..d614dfc560ce 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -745,9 +745,9 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_MANAGE_LANG:
{
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
- std::shared_ptr<ManageLanguageDialog> xDlg(new ManageLanguageDialog(pCurWin ? pCurWin->GetFrameWeld() : nullptr, m_pCurLocalizationMgr));
+ auto xDlg = std::make_shared<ManageLanguageDialog>(pCurWin ? pCurWin->GetFrameWeld() : nullptr, m_pCurLocalizationMgr);
weld::DialogController::runAsync(xDlg, [=](sal_Int32 /*nResult*/){
pRequest->Done();
});
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 0783d697b1ba..48bbe0838f37 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -595,8 +595,8 @@ void LibPage::InsertLib()
// file URLs
Sequence< OUString > aFiles = xFP->getSelectedFiles();
INetURLObject aURLObj( aFiles[0] );
- std::shared_ptr<INetURLObject> xModURLObj(new INetURLObject(aURLObj));
- std::shared_ptr<INetURLObject> xDlgURLObj(new INetURLObject(aURLObj));
+ auto xModURLObj = std::make_shared<INetURLObject>(aURLObj);
+ auto xDlgURLObj = std::make_shared<INetURLObject>(aURLObj);
OUString aBase = aURLObj.getBase();
OUString aModBase( "script" );
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 1d87ab94039f..193dce11dd68 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -138,7 +138,7 @@ void ManageLanguageDialog::ClearLanguageBox()
IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, weld::Button&, void)
{
- std::shared_ptr<SetDefaultLanguageDialog> xDlg(new SetDefaultLanguageDialog(m_xDialog.get(), m_xLocalizationMgr));
+ auto xDlg = std::make_shared<SetDefaultLanguageDialog>(m_xDialog.get(), m_xLocalizationMgr);
weld::DialogController::runAsync(xDlg, [xDlg,this](sal_Int32 nResult)
{
if (!nResult )
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 3a9cb95264d5..0f9f3dfc4fc1 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -405,8 +405,8 @@ std::shared_ptr<SvNumberFormatter> SbiInstance::PrepareNumberFormatter( sal_uInt
eDate = aSysLocale.GetLocaleData().getDateOrder();
}
- std::shared_ptr<SvNumberFormatter> pNumberFormatter(
- new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType ));
+ std::shared_ptr<SvNumberFormatter> pNumberFormatter =
+ std::make_shared<SvNumberFormatter>( comphelper::getProcessComponentContext(), eLangType );
// Several parser methods pass SvNumberFormatter::IsNumberFormat() a number
// format index to parse against. Tell the formatter the proper date
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index ea650b9f9f5f..7f058a2a45bc 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -471,8 +471,7 @@ namespace dxcanvas
::basegfx::B2IVector aPageSize(maPageSize);
while(true)
{
- mpTexture = std::shared_ptr<canvas::ISurface>(
- new DXSurface(*this,aPageSize));
+ mpTexture = std::make_shared<DXSurface>(*this,aPageSize);
if(mpTexture->isValid())
break;
@@ -950,7 +949,7 @@ namespace dxcanvas
if(mpTexture.use_count() == 1)
return mpTexture;
- return std::shared_ptr<canvas::ISurface>( new DXSurface(*this,aSize) );
+ return std::make_shared<DXSurface>(*this,aSize);
}
diff --git a/canvas/source/tools/surfaceproxymanager.cxx b/canvas/source/tools/surfaceproxymanager.cxx
index ef70b824e9e0..126e1bd8c2ad 100644
--- a/canvas/source/tools/surfaceproxymanager.cxx
+++ b/canvas/source/tools/surfaceproxymanager.cxx
@@ -55,7 +55,7 @@ namespace canvas
// not much to do for now, simply allocate a new surface
// proxy from our internal pool and initialize this thing
// properly. we *don't* create a hardware surface for now.
- return std::shared_ptr<ISurfaceProxy>(new SurfaceProxy(pBuffer,mpPageManager));
+ return std::make_shared<SurfaceProxy>(pBuffer,mpPageManager);
}
private:
@@ -66,9 +66,7 @@ namespace canvas
std::shared_ptr<ISurfaceProxyManager> createSurfaceProxyManager( const std::shared_ptr<IRenderModule>& rRenderModule )
{
- return std::shared_ptr<ISurfaceProxyManager>(
- new SurfaceProxyManager(
- rRenderModule));
+ return std::make_shared<SurfaceProxyManager>(rRenderModule);
}
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index d5146749cd4d..7d293852857f 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -652,7 +652,7 @@ void DataBrowser::RenewTable()
for (auto const& elemHeader : aHeaders)
{
- std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( m_pColumnsWin, m_pColorsWin ));
+ auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
Reference< beans::XPropertySet > xSeriesProp( elemHeader.m_xDataSeries, uno::UNO_QUERY );
sal_Int32 nColor = 0;
// @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
@@ -1287,7 +1287,7 @@ void DataBrowser::RenewSeriesHeaders()
for (auto const& elemHeader : aHeaders)
{
- std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( m_pColumnsWin, m_pColorsWin ));
+ auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
Reference< beans::XPropertySet > xSeriesProp(elemHeader.m_xDataSeries, uno::UNO_QUERY);
sal_Int32 nColor = 0;
if( xSeriesProp.is() &&
diff --git a/chart2/source/controller/main/UndoActions.cxx b/chart2/source/controller/main/UndoActions.cxx
index 812e059e7980..301bef28279c 100644
--- a/chart2/source/controller/main/UndoActions.cxx
+++ b/chart2/source/controller/main/UndoActions.cxx
@@ -65,7 +65,7 @@ OUString SAL_CALL UndoElement::getTitle()
void UndoElement::impl_toggleModelState()
{
// get a snapshot of the current state of our model
- std::shared_ptr< ChartModelClone > pNewClone( new ChartModelClone( m_xDocumentModel, m_pModelClone->getFacet() ) );
+ auto pNewClone = std::make_shared<ChartModelClone>( m_xDocumentModel, m_pModelClone->getFacet() );
// apply the previous snapshot to our model
m_pModelClone->applyToModel( m_xDocumentModel );
// remember the new snapshot, for the next toggle
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index 61050a12500f..e7fe42a87124 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -156,7 +156,7 @@ void VCartesianCoordinateSystem::createVAxisList(
if(aAxisProperties.m_bDisplayLabels)
aAxisProperties.m_nNumberFormatKey = getNumberFormatKeyForAxis(xAxis, xChartDoc);
- std::shared_ptr< VAxisBase > apVAxis( new VCartesianAxis(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) );
+ auto apVAxis = std::make_shared<VCartesianAxis>(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount);
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
m_aAxisMap[aFullAxisIndex] = apVAxis;
apVAxis->set3DWallPositions( m_eLeftWallPos, m_eBackWallPos, m_eBottomPos );
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index df5ca49cea74..54958c11281e 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -796,7 +796,7 @@ std::vector<std::shared_ptr<VButton>> lcl_createButtons(
const css::uno::Sequence<chart2::data::PivotTableFieldEntry> aPivotFieldEntries = xPivotTableDataProvider->getColumnFields();
for (chart2::data::PivotTableFieldEntry const & sColumnFieldEntry : aPivotFieldEntries)
{
- std::shared_ptr<VButton> pButton(new VButton);
+ auto pButton = std::make_shared<VButton>();
aButtons.push_back(pButton);
pButton->init(xLegendContainer, xShapeFactory);
awt::Point aNewPosition(x, y);
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
index 3c0e25d432c5..40a7536b8ab7 100644
--- a/configmgr/source/lock.cxx
+++ b/configmgr/source/lock.cxx
@@ -27,7 +27,7 @@ namespace configmgr {
std::shared_ptr<osl::Mutex> const & lock()
{
- static std::shared_ptr<osl::Mutex> theLock(new osl::Mutex);
+ static std::shared_ptr<osl::Mutex> theLock = std::make_shared<osl::Mutex>();
return theLock;
}
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
index d158994d5b5a..b970d93f5a9a 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -157,7 +157,7 @@ public:
void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const
{
OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 );
- mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) );
+ mpContext->maOperandStack.push( std::make_shared<ConstantValueExpression>( new ORowSetValueDecorator( sVal ) ) );
}
};
@@ -174,7 +174,7 @@ public:
}
void operator()( sal_Int32 n ) const
{
- mpContext->maOperandStack.push( std::shared_ptr<ExpressionNode>( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) );
+ mpContext->maOperandStack.push( std::make_shared<ConstantValueExpression>( new ORowSetValueDecorator( n ) ) );
}
};
@@ -212,7 +212,7 @@ public:
rNodeStack.pop();
// create combined ExpressionNode
- std::shared_ptr<ExpressionNode> pNode( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) );
+ auto pNode = std::make_shared<BinaryFunctionExpression>( meFunct, pFirstArg, pSecondArg );
// check for constness
rNodeStack.push( pNode );
}
@@ -260,7 +260,7 @@ public:
std::shared_ptr<ExpressionNode> pArg( std::move(rNodeStack.top()) );
rNodeStack.pop();
- rNodeStack.push( std::shared_ptr<ExpressionNode>( new UnaryFunctionExpression( pArg ) ) );
+ rNodeStack.push( std::make_shared<UnaryFunctionExpression>( pArg ) );
}
};
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index f9e91f180763..5086f7e8500a 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -317,7 +317,7 @@ void OTableHelper::refreshPrimaryKeys(::std::vector< OUString>& _rNames)
if ( xResult.is() )
{
- std::shared_ptr<sdbcx::KeyProperties> pKeyProps(new sdbcx::KeyProperties(OUString(),KeyType::PRIMARY,0,0));
+ auto pKeyProps = std::make_shared<sdbcx::KeyProperties>(OUString(),KeyType::PRIMARY,0,0);
OUString aPkName;
bool bAlreadyFetched = false;
const Reference< XRow > xRow(xResult,UNO_QUERY);
diff --git a/cppcanvas/source/mtfrenderer/bitmapaction.cxx b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
index 94489145faed..84946014ef0b 100644
--- a/cppcanvas/source/mtfrenderer/bitmapaction.cxx
+++ b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
@@ -201,10 +201,7 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
- rDstPoint,
- rCanvas,
- rState ) );
+ return std::make_shared<BitmapAction>(rBmpEx, rDstPoint, rCanvas, rState );
}
std::shared_ptr<Action> BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
@@ -213,11 +210,11 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
- rDstPoint,
- rDstSize,
- rCanvas,
- rState ) );
+ return std::make_shared<BitmapAction>(rBmpEx,
+ rDstPoint,
+ rDstSize,
+ rCanvas,
+ rState );
}
}
}
diff --git a/cppcanvas/source/mtfrenderer/lineaction.cxx b/cppcanvas/source/mtfrenderer/lineaction.cxx
index 7b0ba2080cf3..e032432e6848 100644
--- a/cppcanvas/source/mtfrenderer/lineaction.cxx
+++ b/cppcanvas/source/mtfrenderer/lineaction.cxx
@@ -145,10 +145,10 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new LineAction( rStartPoint,
- rEndPoint,
- rCanvas,
- rState) );
+ return std::make_shared<LineAction>( rStartPoint,
+ rEndPoint,
+ rCanvas,
+ rState);
}
}
diff --git a/cppcanvas/source/mtfrenderer/pointaction.cxx b/cppcanvas/source/mtfrenderer/pointaction.cxx
index 03000f85b329..38896151b52e 100644
--- a/cppcanvas/source/mtfrenderer/pointaction.cxx
+++ b/cppcanvas/source/mtfrenderer/pointaction.cxx
@@ -160,7 +160,7 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState ) );
+ return std::make_shared<PointAction>( rPoint, rCanvas, rState );
}
std::shared_ptr<Action> PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
@@ -168,7 +168,7 @@ namespace cppcanvas
const OutDevState& rState,
const ::Color& rColor )
{
- return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState, rColor ) );
+ return std::make_shared<PointAction>( rPoint, rCanvas, rState, rColor );
}
}
}
diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
index 8fa1582b82c9..15fa4f5bc776 100644
--- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx
+++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
@@ -454,9 +454,9 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- rState.isFillColorSet,
- rState.isLineColorSet ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ rState.isFillColorSet,
+ rState.isLineColorSet );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -464,7 +464,7 @@ namespace cppcanvas
const OutDevState& rState,
const rendering::Texture& rTexture )
{
- return std::shared_ptr<Action>( new TexturedPolyPolyAction( rPoly, rCanvas, rState, rTexture ) );
+ return std::make_shared<TexturedPolyPolyAction>( rPoly, rCanvas, rState, rTexture );
}
std::shared_ptr<Action> PolyPolyActionFactory::createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -474,9 +474,9 @@ namespace cppcanvas
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createLinePolyPolyAction() called with empty line color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- false,
- rState.isLineColorSet ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ false,
+ rState.isLineColorSet );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -486,7 +486,7 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createPolyPolyAction() for strokes called with empty line color" );
- return std::shared_ptr<Action>( new StrokedPolyPolyAction( rPoly, rCanvas, rState, rStrokeAttributes ) );
+ return std::make_shared<StrokedPolyPolyAction>( rPoly, rCanvas, rState, rStrokeAttributes );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -496,10 +496,10 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- rState.isFillColorSet,
- rState.isLineColorSet,
- nTransparency ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ rState.isFillColorSet,
+ rState.isLineColorSet,
+ nTransparency );
}
}
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index f2b50e198606..93e54c11dba5 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -2075,8 +2075,7 @@ namespace cppcanvas
if( rParms.maTextTransformation )
{
- return std::shared_ptr<Action>(
- new OutlineAction(
+ return std::make_shared<OutlineAction>(
rStartPoint,
rReliefOffset,
rReliefColor,
@@ -2088,12 +2087,11 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
}
else
{
- return std::shared_ptr<Action>(
- new OutlineAction(
+ return std::make_shared<OutlineAction>(
rStartPoint,
rReliefOffset,
rReliefColor,
@@ -2104,7 +2102,7 @@ namespace cppcanvas
aCharWidthSeq,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
@@ -2192,31 +2190,31 @@ namespace cppcanvas
// nope
if( rParms.maTextTransformation )
{
- ret = std::shared_ptr<Action>( new TextAction(
+ ret = std::make_shared<TextAction>(
aStartPoint,
rText,
nStartPos,
nLen,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
}
else
{
- ret = std::shared_ptr<Action>( new TextAction(
+ ret = std::make_shared<TextAction>(
aStartPoint,
rText,
nStartPos,
nLen,
rCanvas,
- rState ) );
+ rState );
}
}
else
{
// at least one of the effects requested
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new EffectTextAction(
+ ret = std::make_shared<EffectTextAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2229,9 +2227,9 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new EffectTextAction(
+ ret = std::make_shared<EffectTextAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2243,7 +2241,7 @@ namespace cppcanvas
nLen,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
else
@@ -2258,7 +2256,7 @@ namespace cppcanvas
{
// nope
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new TextArrayAction(
+ ret = std::make_shared<TextArrayAction>(
aStartPoint,
rText,
nStartPos,
@@ -2266,22 +2264,22 @@ namespace cppcanvas
aCharWidths,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new TextArrayAction(
+ ret = std::make_shared<TextArrayAction>(
aStartPoint,
rText,
nStartPos,
nLen,
aCharWidths,
rCanvas,
- rState ) );
+ rState );
}
else
{
// at least one of the effects requested
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new EffectTextArrayAction(
+ ret = std::make_shared<EffectTextArrayAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2295,9 +2293,9 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new EffectTextArrayAction(
+ ret = std::make_shared<EffectTextArrayAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2310,7 +2308,7 @@ namespace cppcanvas
aCharWidths,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
return ret;
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 09e5c200d04d..48be63ed8702 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -465,12 +465,12 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new TransparencyGroupAction(std::move(rGroupMtf),
- std::move(rAlphaGradient),
- rDstPoint,
- rDstSize,
- rCanvas,
- rState ) );
+ return std::make_shared<TransparencyGroupAction>(std::move(rGroupMtf),
+ std::move(rAlphaGradient),
+ rDstPoint,
+ rDstSize,
+ rCanvas,
+ rState );
}
}
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 9f4f541b1388..e9c0ce9907f2 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1391,11 +1391,11 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
assert(implKey.getName().match("/IMPLEMENTATIONS/"));
OUString name(
implKey.getName().copy(RTL_CONSTASCII_LENGTH("/IMPLEMENTATIONS/")));
- std::shared_ptr< Data::Implementation > impl(
- new Data::Implementation(
+ std::shared_ptr< Data::Implementation > impl =
+ std::make_shared<Data::Implementation>(
name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"),
readLegacyRdbString(uri, implKey, "UNO/LOCATION"), "", "", "",
- css::uno::Reference< css::uno::XComponentContext >(), uri));
+ css::uno::Reference< css::uno::XComponentContext >(), uri);
if (!data_.namedImplementations.emplace(name, impl).second)
{
throw css::registry::InvalidRegistryException(
@@ -1520,8 +1520,8 @@ void cppuhelper::ServiceManager::insertLegacyFactory(
}
css::uno::Reference< css::lang::XComponent > comp(
factoryInfo, css::uno::UNO_QUERY);
- std::shared_ptr< Data::Implementation > impl(
- new Data::Implementation(name, f1, f2, comp));
+ std::shared_ptr< Data::Implementation > impl =
+ std::make_shared<Data::Implementation>(name, f1, f2, comp);
Data extra;
if (!name.isEmpty()) {
extra.namedImplementations.emplace(name, impl);
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 265ee489912e..21726bb73c7c 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -793,7 +793,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl, weld::ComboBox&, vo
void TPGalleryThemeProperties::SearchFiles()
{
- std::shared_ptr<SearchProgress> xProgress(new SearchProgress(GetFrameWeld(), this, aURL));
+ auto xProgress = std::make_shared<SearchProgress>(GetFrameWeld(), this, aURL);
aFoundList.clear();
m_xLbxFound->clear();
@@ -846,7 +846,7 @@ void TPGalleryThemeProperties::TakeFiles()
{
if (m_xLbxFound->count_selected_rows() || (bTakeAll && bEntriesFound))
{
- std::shared_ptr<TakeProgress> xTakeProgress(new TakeProgress(GetFrameWeld(), this));
+ auto xTakeProgress = std::make_shared<TakeProgress>(GetFrameWeld(), this);
xTakeProgress->LaunchThread();
weld::DialogController::runAsync(xTakeProgress, [=](sal_Int32 /*nResult*/) {
/* no postprocessing needed, pTakeProgress
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 728c3c68d258..bb1b4fbc196b 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -577,7 +577,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void )
OUString sPropertyType = m_xPrefBox->get_text(*m_xScratchIter, 2);
OUString sPropertyValue = m_xPrefBox->get_text(*m_xScratchIter, 3);
- std::shared_ptr< Prop_Impl > pProperty (new Prop_Impl( pUserData->sPropertyPath, sPropertyName, Any( sPropertyValue ) ) );
+ auto pProperty = std::make_shared<Prop_Impl>( pUserData->sPropertyPath, sPropertyName, Any( sPropertyValue ) );
bool bSaveChanges = false;
bool bOpenDialog = true;
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 06e7b1c9976a..17cd3780ee77 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -927,7 +927,7 @@ bool OTableController::checkColumns(bool _bNew)
{
case RET_YES:
{
- std::shared_ptr<OTableRow> pNewRow(new OTableRow());
+ auto pNewRow = std::make_shared<OTableRow>();
TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo);
if ( !pTypeInfo.get() )
break;
@@ -1503,7 +1503,7 @@ sal_Int32 OTableController::getFirstEmptyRowPosition()
if (!bFoundElem)
{
bool bReadRow = !isAddAllowed();
- std::shared_ptr<OTableRow> pTabEdRow(new OTableRow());
+ auto pTabEdRow = std::make_shared<OTableRow>();
pTabEdRow->SetReadOnly(bReadRow);
nRet = m_vRowList.size();
m_vRowList.push_back( pTabEdRow);
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 7b4aafb3b083..baa5e716f4bd 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -78,8 +78,7 @@ struct UnoRc : public rtl::StaticWithInit<
std::shared_ptr<rtl::Bootstrap> operator () () {
OUString unorc( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("louno") );
::rtl::Bootstrap::expandMacros( unorc );
- std::shared_ptr< ::rtl::Bootstrap > ret(
- new ::rtl::Bootstrap( unorc ) );
+ auto ret = std::make_shared<::rtl::Bootstrap>( unorc );
OSL_ASSERT( ret->getHandle() != nullptr );
return ret;
}
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 9d49d871193c..c2fda0f6c0cf 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -218,7 +218,7 @@ std::shared_ptr<editeng::SharedVclResources> EditDLL::GetSharedVclResources()
SolarMutexGuard g;
auto pLocked(pSharedVcl.lock());
if(!pLocked)
- pSharedVcl = pLocked = std::shared_ptr<editeng::SharedVclResources>(new editeng::SharedVclResources());
+ pSharedVcl = pLocked = std::make_shared<editeng::SharedVclResources>();
return pLocked;
}
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index f50f41a83717..669585526918 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -2109,7 +2109,7 @@ namespace emfio
void MtfTools::Push() // !! to be able to access the original ClipRegion it
{ // is not allowed to use the MetaPushAction()
UpdateClipRegion(); // (the original clip region is on top of the stack) (SJ)
- std::shared_ptr<SaveStruct> pSave( new SaveStruct );
+ auto pSave = std::make_shared<SaveStruct>();
pSave->aLineStyle = maLineStyle;
pSave->aFillStyle = maFillStyle;
@@ -2149,7 +2149,7 @@ namespace emfio
if( !mvSaveStack.empty() )
{
// Backup the current data on the stack
- std::shared_ptr<SaveStruct> pSave( mvSaveStack.back() );
+ std::shared_ptr<SaveStruct>& pSave( mvSaveStack.back() );
maLineStyle = pSave->aLineStyle;
maFillStyle = pSave->aFillStyle;
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index 83df6c32d5d2..bd261d694c85 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -217,7 +217,7 @@ Sequence< ScannerContext > ScannerManager::getAvailableScanners()
if( rSanes.empty() )
{
- std::shared_ptr<SaneHolder> pSaneHolder(new SaneHolder);
+ auto pSaneHolder = std::make_shared<SaneHolder>();
if( Sane::IsSane() )
rSanes.push_back( pSaneHolder );
}
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 97577199628c..dca72ee06689 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4962,8 +4962,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
// otherwise, just finalize here
if (size_t(nCalledByGroup) > maPendingGroupData.size())
{
- std::shared_ptr<DffRecordHeader> rHdClone(new DffRecordHeader(aObjData.rSpHd));
- maPendingGroupData.emplace_back(DffObjData(rHdClone, aObjData), rHdClone );
+ auto xHdClone = std::make_shared<DffRecordHeader>(aObjData.rSpHd);
+ maPendingGroupData.emplace_back(DffObjData(xHdClone, aObjData), xHdClone );
}
else
{
@@ -5374,8 +5374,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
// the object with a frame, otherwise
if( bTextFrame )
{
- std::shared_ptr<SvxMSDffShapeInfo> const pTmpRec(
- new SvxMSDffShapeInfo(0, pImpRec->nShapeId));
+ auto const pTmpRec = std::make_shared<SvxMSDffShapeInfo>(0, pImpRec->nShapeId);
SvxMSDffShapeInfos_ById::const_iterator const it =
m_xShapeInfosById->find(pTmpRec);
@@ -6374,8 +6373,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
SvxMSDffImportData& rData)
{
- std::shared_ptr<SvxMSDffShapeInfo> const pTmpRec(
- new SvxMSDffShapeInfo(0, nId));
+ auto const pTmpRec = std::make_shared<SvxMSDffShapeInfo>(0, nId);
SvxMSDffShapeInfos_ById::const_iterator const it =
m_xShapeInfosById->find(pTmpRec);
diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
index 0be97b5043f3..ec2555a4dfed 100644
--- a/include/oox/ole/axcontrol.hxx
+++ b/include/oox/ole/axcontrol.hxx
@@ -938,7 +938,7 @@ private:
template< typename ModelType >
inline ModelType& EmbeddedControl::createModel()
{
- std::shared_ptr< ModelType > xModel( new ModelType );
+ auto xModel = std::make_shared<ModelType>();
mxModel = xModel;
xModel->setFormComponentMode();
return *xModel;
@@ -947,7 +947,7 @@ inline ModelType& EmbeddedControl::createModel()
template< typename ModelType, typename ParamType >
inline ModelType& EmbeddedControl::createModel( const ParamType& rParam )
{
- std::shared_ptr< ModelType > xModel( new ModelType( rParam ) );
+ auto xModel = std::make_shared<ModelType>( rParam );
mxModel = xModel;
xModel->setFormComponentMode();
return *xModel;
diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx
index ff39d5f7212c..6be9020051c2 100644
--- a/include/oox/vml/vmlshapecontainer.hxx
+++ b/include/oox/vml/vmlshapecontainer.hxx
@@ -125,7 +125,7 @@ private:
template< typename ShapeT >
std::shared_ptr<ShapeT> ShapeContainer::createShape()
{
- std::shared_ptr< ShapeT > xShape( new ShapeT( mrDrawing ) );
+ auto xShape = std::make_shared<ShapeT>( mrDrawing );
maShapes.push_back( xShape );
return xShape;
}
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index f86847008cab..6ede806a526e 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -678,7 +678,7 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale,
}
else
{
- std::shared_ptr< LangSvcEntries_Hyph > pTmpEntry( new LangSvcEntries_Hyph( rSvcImplNames[0] ) );
+ auto pTmpEntry = std::make_shared<LangSvcEntries_Hyph>( rSvcImplNames[0] );
pTmpEntry->aSvcRefs = Sequence< Reference < XHyphenator > >( 1 );
aSvcMap[ nLanguage ] = pTmpEntry;
}
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 42ae281fd917..a1390c916c77 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -779,7 +779,7 @@ void SpellCheckerDispatcher::SetServiceList( const Locale &rLocale,
}
else
{
- std::shared_ptr< LangSvcEntries_Spell > pTmpEntry( new LangSvcEntries_Spell( rSvcImplNames ) );
+ auto pTmpEntry = std::make_shared<LangSvcEntries_Spell>( rSvcImplNames );
pTmpEntry->aSvcRefs = Sequence< Reference < XSpellChecker > >( nLen );
m_aSvcMap[ nLanguage ] = pTmpEntry;
}
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index 968136898cc0..284673d641a7 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -212,7 +212,7 @@ void ThesaurusDispatcher::SetServiceList( const Locale &rLocale,
}
else
{
- std::shared_ptr< LangSvcEntries_Thes > pTmpEntry( new LangSvcEntries_Thes( rSvcImplNames ) );
+ auto pTmpEntry = std::make_shared<LangSvcEntries_Thes>( rSvcImplNames );
pTmpEntry->aSvcRefs = Sequence< Reference < XThesaurus > >( nLen );
aSvcMap[ nLanguage ] = pTmpEntry;
}
diff --git a/oox/source/drawingml/diagram/constraintlistcontext.cxx b/oox/source/drawingml/diagram/constraintlistcontext.cxx
index cc71c89b226a..42cefee41d28 100644
--- a/oox/source/drawingml/diagram/constraintlistcontext.cxx
+++ b/oox/source/drawingml/diagram/constraintlistcontext.cxx
@@ -49,7 +49,7 @@ ConstraintListContext::onCreateContext( ::sal_Int32 aElement,
{
case DGM_TOKEN( constr ):
{
- std::shared_ptr< ConstraintAtom > pNode( new ConstraintAtom(mpNode->getLayoutNode()) );
+ auto pNode = std::make_shared<ConstraintAtom>(mpNode->getLayoutNode());
LayoutAtom::connect(mpNode, pNode);
Constraint& rConstraint = pNode->getConstraint();
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index ab1659d8ada9..219128c7f6e0 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -45,7 +45,7 @@ TextBody::TextBody( const TextBodyPtr& pBody )
TextParagraph& TextBody::addParagraph()
{
- std::shared_ptr< TextParagraph > xPara( new TextParagraph );
+ auto xPara = std::make_shared<TextParagraph>();
maParagraphs.push_back( xPara );
return *xPara;
}
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 0f8c90ab4c89..d0f8769cc962 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -84,7 +84,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
}
case A_TOKEN( fld ): // "CT_TextField" Text Field.
{
- std::shared_ptr< TextField > pField( new TextField );
+ auto pField = std::make_shared<TextField>();
mrParagraph.addRun( pField );
return new TextFieldContext( *this, rAttribs, *pField );
}
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 251fff8ab78e..b445a3eec703 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -101,7 +101,7 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
case PPT_TOKEN( sp ): // Shape
{
- std::shared_ptr<PPTShape> pShape( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) );
+ auto pShape = std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.CustomShape" );
bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false);
pShape->setUseBgFill(bUseBgFill);
if (bUseBgFill)
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 23041d6cee48..acc8624af602 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -123,9 +123,8 @@ uno::Reference<xml::sax::XFastContextHandler> const & ShapeContextHandler::getWp
*rFragmentHandler,
xShape,
pMasterShape,
- ShapePtr(
- new oox::drawingml::Shape(
- "com.sun.star.drawing.CustomShape"))));
+ std::make_shared<oox::drawingml::Shape>(
+ "com.sun.star.drawing.CustomShape")));
break;
default:
break;
@@ -160,8 +159,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
{
if (! mxGraphicShapeContext.is())
{
- std::shared_ptr<ContextHandler2Helper> pFragmentHandler
- (new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
+ auto pFragmentHandler = std::make_shared<ShapeFragmentHandler>(*mxFilterBase, msRelationFragmentPath);
ShapePtr pMasterShape;
switch (Element & 0xffff)
@@ -216,7 +214,7 @@ ShapeContextHandler::getDiagramShapeContext()
{
if (!mxDiagramShapeContext.is())
{
- std::shared_ptr<ContextHandler2Helper> pFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
+ auto pFragmentHandler = std::make_shared<ShapeFragmentHandler>(*mxFilterBase, msRelationFragmentPath);
mpShape.reset(new Shape());
mxDiagramShapeContext.set(new DiagramGraphicDataContext(*pFragmentHandler, mpShape));
}
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index e8008a1f4638..71713d3e7120 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -61,7 +61,7 @@ ShapeContainer::~ShapeContainer()
std::shared_ptr<ShapeType> ShapeContainer::createShapeType()
{
- std::shared_ptr< ShapeType > xShape( new ShapeType( mrDrawing ) );
+ auto xShape = std::make_shared<ShapeType>( mrDrawing );
maTypes.push_back( xShape );
return xShape;
}
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 0c132a93be48..64399bd9117c 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -251,7 +251,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
{
static TPropertyNamePair s_aNameMap = [&]()
{
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair tmp;
tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
@@ -265,7 +265,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
{
static TPropertyNamePair s_aNameMap = [&]()
{
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair tmp;
tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
@@ -277,7 +277,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
- std::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust);
+ auto aParaAdjust = std::make_shared<ParaAdjust>();
tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
return tmp;
}();
@@ -287,7 +287,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
{
static TPropertyNamePair s_aNameMap = [&]()
{
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair tmp;
tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
@@ -298,7 +298,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
tmp.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
- std::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust);
+ auto aParaAdjust = std::make_shared<ParaAdjust>();
tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
return tmp;
}();
@@ -309,7 +309,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
{
static TPropertyNamePair s_aNameMap = [&]()
{
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair tmp;
tmp.emplace(OUString("FillColor"),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter));
tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter));
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 90123eef170e..c6ed5b1836d9 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -146,7 +146,7 @@ void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface
m_xReportComponent.set( xNameCont->getByName("ReportComponent"), uno::UNO_QUERY );
if ( m_xDataProvider.is() )
{
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair aPropertyMediation;
aPropertyMediation.emplace( PROPERTY_MASTERFIELDS, TPropertyConverter(PROPERTY_MASTERFIELDS,aNoConverter) );
aPropertyMediation.emplace( PROPERTY_DETAILFIELDS, TPropertyConverter(PROPERTY_DETAILFIELDS,aNoConverter) );
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx
index 9002e4b8cfb1..f42e65cc204b 100644
--- a/reportdesign/source/ui/misc/FunctionHelper.cxx
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -63,7 +63,7 @@ const formula::IFunctionCategory* FunctionManager::getCategory(sal_uInt32 _nPos)
if ( _nPos >= m_aCategoryIndex.size() )
{
uno::Reference< report::meta::XFunctionCategory> xCategory = m_xMgr->getCategory(_nPos);
- std::shared_ptr< FunctionCategory > pCategory(new FunctionCategory(this,_nPos + 1,xCategory));
+ auto pCategory = std::make_shared<FunctionCategory>(this,_nPos + 1,xCategory);
m_aCategoryIndex.push_back( m_aCategories.emplace(xCategory->getName(),pCategory).first );
}
return m_aCategoryIndex[_nPos]->second.get();
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index dd938af56233..1fe36c88effb 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -1077,7 +1077,7 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula
uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext("org.libreoffice.report.pentaho.SOFunctionManager",_xContext),uno::UNO_QUERY);
if ( xMgr.is() )
{
- std::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) );
+ auto pFormulaManager = std::make_shared<FunctionManager>(xMgr);
ReportFormula aFormula( _in_out_rFormula );
LanguageTag aLangTag(LANGUAGE_SYSTEM);
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 231898b54b4e..21f1a1021a9f 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2953,7 +2953,7 @@ uno::Reference< sdbc::XRowSet > const & OReportController::getRowSet()
xRowSetProp->setPropertyValue( PROPERTY_ACTIVECONNECTION, uno::makeAny( getConnection() ) );
xRowSetProp->setPropertyValue( PROPERTY_APPLYFILTER, uno::makeAny( true ) );
- std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
+ auto aNoConverter = std::make_shared<AnyConverter>();
TPropertyNamePair aPropertyMediation;
aPropertyMediation.emplace( PROPERTY_COMMAND, TPropertyConverter(PROPERTY_COMMAND,aNoConverter) );
aPropertyMediation.emplace( PROPERTY_COMMANDTYPE, TPropertyConverter(PROPERTY_COMMANDTYPE,aNoConverter) );
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index cd07e7425c71..5a846cf516b7 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -478,13 +478,13 @@ namespace sax_fastparser {
{
if (rOrder.hasElements())
{
- std::shared_ptr< ForMerge > pSort( new ForSort(nTag, rOrder) );
+ auto pSort = std::make_shared<ForSort>(nTag, rOrder);
maMarkStack.push( pSort );
maCachedOutputStream.setOutput( pSort );
}
else
{
- std::shared_ptr< ForMerge > pMerge( new ForMerge(nTag) );
+ auto pMerge = std::make_shared<ForMerge>(nTag);
maMarkStack.push( pMerge );
maCachedOutputStream.setOutput( pMerge );
}
diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index 5629ee010b89..070721dcd091 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -146,7 +146,7 @@ std::shared_ptr<utl::TempFile>
ScPDFExportTest::exportToPDF(const uno::Reference<frame::XModel>& xModel, const ScRange& range)
{
// create temp file name
- std::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile());
+ auto pTempFile = std::make_shared<utl::TempFile>();
pTempFile->EnableKillingFile();
OUString sFileURL = pTempFile->GetURL();
// Note: under Windows path path should be with "/" delimiters instead of "\\"
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 73540c9a4233..cc675cdb593d 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -573,11 +573,11 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,
const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
sal_uIntPtr nFilterVersion, const OUString* pPassword )
{
- std::shared_ptr<const SfxFilter> pFilter(new SfxFilter(
+ auto pFilter = std::make_shared<SfxFilter>(
rFilter,
OUString(), nFilterFlags, nClipboardID, rTypeName, OUString(),
- rUserData, "private:factory/scalc"));
- const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion);
+ rUserData, "private:factory/scalc");
+ pFilter->SetVersion(nFilterVersion);
ScDocShellRef xDocShRef = new ScDocShell;
xDocShRef->GetDocument().EnableUserInteraction(false);
@@ -668,11 +668,11 @@ ScDocShellRef ScBootstrapFixture::saveAndReload(
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (nFormatType == ODS_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARCHART_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
rFilter,
OUString(), nFormatType, nExportFormat, rTypeName, OUString(),
- rUserData, "private:factory/scalc*" ));
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ rUserData, "private:factory/scalc*" );
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
pShell->DoSaveAs( aStoreMedium );
pShell->DoClose();
@@ -707,18 +707,18 @@ std::shared_ptr<utl::TempFile> ScBootstrapFixture::saveAs( ScDocShell* pShell, s
OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
- std::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile());
+ auto pTempFile = std::make_shared<utl::TempFile>();
pTempFile->EnableKillingFile();
SfxMedium aStoreMedium( pTempFile->GetURL(), StreamMode::STD_WRITE );
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType;
if (nFormatType == ODS_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARCHART_8;
- std::shared_ptr<SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
aFilterName,
OUString(), nFormatType, nExportFormat, aFilterType, OUString(),
- OUString(), "private:factory/scalc*" ));
- pExportFilter.get()->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ OUString(), "private:factory/scalc*" );
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
pShell->DoSaveAs( aStoreMedium );
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index d10dc4244a0e..1fe48fb464c3 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -417,11 +417,11 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (nFormatType == ODS_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARCHART_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
rFilter,
OUString(), nFormatType, nExportFormat, rTypeName, OUString(),
- rUserData, "private:factory/scalc*" ));
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ rUserData, "private:factory/scalc*" );
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
SfxItemSet* pExportSet = aStoreMedium.GetItemSet();
uno::Sequence< beans::NamedValue > aEncryptionData = comphelper::OStorageHelper::CreatePackageEncryptionData( "test" );
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index e3c7bfae4d82..5c15ee25b470 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -1628,13 +1628,13 @@ void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase)
createFileURL(aFileNameBase, aFileExtension, aFileName);
OUString aFilterType(getFileFormats()[0].pTypeName, strlen(getFileFormats()[0].pTypeName), RTL_TEXTENCODING_UTF8);
- std::shared_ptr<const SfxFilter> pFilter(new SfxFilter(
+ auto pFilter = std::make_shared<SfxFilter>(
aFilterName,
OUString(), getFileFormats()[0].nFormatType,
SotClipboardFormatId::STARCALC_8,
aFilterType, OUString(),
- OUString(), "private:factory/scalc*" ));
- const_cast<SfxFilter*>(pFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ OUString(), "private:factory/scalc*" );
+ pFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
ScDocShellRef xDocSh = new ScDocShell;
SfxMedium* pMedium = new SfxMedium(aFileName, StreamMode::STD_READWRITE);
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 268475df4d1c..5d3cbcbd99e7 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2278,8 +2278,7 @@ class UpdateRefOnNonCopy
// Make sure that the start and end listening contexts share the
// same block position set, else an invalid iterator may ensue.
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(
- new sc::ColumnBlockPositionSet(mpCxt->mrDoc));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(mpCxt->mrDoc);
sc::StartListeningContext aStartCxt(mpCxt->mrDoc, pPosSet);
sc::EndListeningContext aEndCxt(mpCxt->mrDoc, pPosSet, pOldCode.get());
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f417b63d4b0a..29eb7d51a90f 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -345,7 +345,7 @@ void ScColumn::StartListeningUnshared( const std::vector<SCROW>& rNewSharedRows
ScDocument* pDoc = GetDoc();
if (!rNewSharedRows.empty() && !pDoc->IsDelayedFormulaGrouping())
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*pDoc));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDoc);
sc::StartListeningContext aStartCxt(*pDoc, pPosSet);
sc::EndListeningContext aEndCxt(*pDoc, pPosSet);
if (rNewSharedRows.size() >= 2)
@@ -621,7 +621,7 @@ void ScColumn::AttachNewFormulaCell(
{
case sc::ConvertToGroupListening:
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*pDocument));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDocument);
sc::StartListeningContext aStartCxt(*pDocument, pPosSet);
sc::EndListeningContext aEndCxt(*pDocument, pPosSet);
SCROW nStartRow, nEndRow;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3f87a7f24a98..a7071416eb6e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2576,8 +2576,7 @@ void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
{
if (nInsFlag & InsertDeleteFlags::CONTENTS)
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pSet(
- new sc::ColumnBlockPositionSet(*this));
+ auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pSet);
sc::EndListeningContext aEndCxt(*this, pSet, nullptr);
@@ -2701,7 +2700,7 @@ void ScDocument::CopyBlockFromClip(
/* TODO: holding the ColumnSet in a shared_ptr at
* RefUpdateContext would eliminate the need of
* copying it here. */
- std::shared_ptr<const sc::ColumnSet> pColSet( new sc::ColumnSet( aRefCxt.maRegroupCols));
+ auto pColSet = std::make_shared<sc::ColumnSet>( aRefCxt.maRegroupCols);
StartNeededListeners( pColSet);
}
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 2cdc71b3374a..8b1496943081 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -226,7 +226,7 @@ void ScDocument::SwapNonEmpty( sc::TableValues& rValues )
if (!rRange.IsValid())
return;
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*this));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pPosSet);
sc::EndListeningContext aEndCxt(*this, pPosSet);
@@ -501,7 +501,7 @@ void ScDocument::StartAllListeners( const ScRange& rRange )
if (IsClipOrUndo() || GetNoListening())
return;
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*this));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pPosSet);
sc::EndListeningContext aEndCxt(*this, pPosSet);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 8f1756b23e1b..73b236df1f48 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -717,7 +717,7 @@ ScDPTableData* ScDPObject::GetTableData()
// grouping (for cell or database data)
if (pData && pDimData)
{
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(pData, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(pData, pDoc);
pDimData->WriteToData(*pGroupData);
pData = pGroupData;
}
@@ -839,14 +839,14 @@ void ScDPObject::ReloadGroupTableData()
// This is already a group table data. Salvage the source data and
// re-create a new group data.
const shared_ptr<ScDPTableData>& pSource = pData->GetSourceTableData();
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(pSource, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(pSource, pDoc);
pDimData->WriteToData(*pGroupData);
mpTableData = pGroupData;
}
else
{
// This is a source data. Create a group data based on it.
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(mpTableData, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(mpTableData, pDoc);
pDimData->WriteToData(*pGroupData);
mpTableData = pGroupData;
}
diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx
index 1e6da5ee3410..6a1cef68b5a9 100644
--- a/sc/source/core/data/dpresfilter.cxx
+++ b/sc/source/core/data/dpresfilter.cxx
@@ -124,7 +124,7 @@ void ScDPResultTree::add(
if (itMem == rMembersValueNames.end())
{
// New member. Insert it.
- std::shared_ptr<MemberNode> pNode( new MemberNode);
+ auto pNode = std::make_shared<MemberNode>();
std::pair<MembersType::iterator, bool> r =
rMembersValueNames.emplace(aUpperName, pNode);
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 5aab834a1fed..b18752ca3a8a 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1243,7 +1243,7 @@ void ScTable::FillFormulaVertical(
aCol[nCol].DeleteRanges(aSpans, InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::STRING | InsertDeleteFlags::FORMULA | InsertDeleteFlags::OUTLINE);
aCol[nCol].CloneFormulaCell(rSrcCell, sc::CellTextAttr(), aSpans);
- std::shared_ptr<sc::ColumnBlockPositionSet> pSet(new sc::ColumnBlockPositionSet(*pDocument));
+ auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDocument);
sc::StartListeningContext aStartCxt(*pDocument, pSet);
sc::EndListeningContext aEndCxt(*pDocument, pSet);
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 4d9975d034cc..35e333fc4a7f 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -431,7 +431,7 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
}
// WSBOOL needs data from page settings, create it here, add it later
- std::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ auto xPageSett = std::make_shared<XclExpPageSettings>( GetRoot() );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
if( eBiff <= EXC_BIFF5 )
@@ -572,7 +572,7 @@ void ExcTable::FillAsTableXml()
}
// WSBOOL needs data from page settings, create it here, add it later
- std::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ auto xPageSett = std::make_shared<XclExpPageSettings>( GetRoot() );
XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 65fa3f896e31..5bb9d0bb61f8 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1122,7 +1122,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
{
XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() );
ChartExport aChartExport(XML_xdr, pDrawing, mxChartDoc, &rStrm, drawingml::DOCUMENT_XLSX);
- std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc));
+ auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
aChartExport.SetURLTranslator(pURLTransformer);
static sal_Int32 nChartCount = 0;
nChartCount++;
@@ -1489,7 +1489,7 @@ XclExpDffAnchorBase* XclExpObjectManager::CreateDffAnchor() const
std::shared_ptr< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
{
- return std::shared_ptr< XclExpRecordBase >( new XclExpMsoDrawingGroup( *mxEscherEx ) );
+ return std::make_shared<XclExpMsoDrawingGroup>( *mxEscherEx );
}
void XclExpObjectManager::StartSheet()
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index d654f38ab133..82e4ac0ddccb 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -4204,7 +4204,7 @@ void XclImpSheetDrawing::ReadNote( XclImpStream& rStrm )
void XclImpSheetDrawing::ReadTabChart( XclImpStream& rStrm )
{
OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF5 );
- std::shared_ptr< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
+ auto xChartObj = std::make_shared<XclImpChartObj>( GetRoot(), true );
xChartObj->ReadChartSubStream( rStrm );
// insert the chart as raw object without connected DFF data
AppendRawObject( xChartObj );
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx
index 59872603cb7f..ade90452d21f 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -221,7 +221,7 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
{
sal_Int32 nWorksheet = static_cast< sal_Int32 >( maSheetInfos.size() );
IndexNamePair aIndexName = createSheet( rModel.maName, nWorksheet );
- std::shared_ptr< SheetInfo > xSheetInfo( new SheetInfo( rModel, aIndexName.first, aIndexName.second ) );
+ auto xSheetInfo = std::make_shared<SheetInfo>( rModel, aIndexName.first, aIndexName.second );
maSheetInfos.push_back( xSheetInfo );
maSheetInfosByName[ rModel.maName ] = xSheetInfo;
maSheetInfosByName[ lclQuoteName( rModel.maName ) ] = xSheetInfo;
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 5a58fa68d4bd..3cc4881b23c2 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -85,7 +85,7 @@ SvStream* XclEscherExGlobal::ImplQueryPictureStream()
}
XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, XclExpObjectManager& rObjMgr, SvStream& rStrm, const XclEscherEx* pParent ) :
- EscherEx( pParent ? pParent->mxGlobal : std::shared_ptr<EscherExGlobal>( new XclEscherExGlobal( rRoot ) ), &rStrm ),
+ EscherEx( pParent ? pParent->mxGlobal : std::make_shared<XclEscherExGlobal>( rRoot ), &rStrm ),
XclExpRoot( rRoot ),
mrObjMgr( rObjMgr ),
pCurrXclObj( nullptr ),
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index c880da8ab417..dfbe894ab4f8 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1187,7 +1187,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
ShapeExport aDML(XML_xdr, pDrawing, nullptr, &rStrm, drawingml::DOCUMENT_XLSX);
- std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc));
+ auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
aDML.SetURLTranslator(pURLTransformer);
pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx
index e75fb326a64c..737cbdc0af4d 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -279,13 +279,13 @@ std::shared_ptr<DataProvider> DataProviderFactory::getDataProvider(ScDocument* p
if (bInternal)
{
if (rDataProvider == "org.libreoffice.calc.csv")
- return std::shared_ptr<DataProvider>(new CSVDataProvider(pDoc, rDataSource));
+ return std::make_shared<CSVDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.html")
- return std::shared_ptr<DataProvider>(new HTMLDataProvider(pDoc, rDataSource));
+ return std::make_shared<HTMLDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.xml")
- return std::shared_ptr<DataProvider>(new XMLDataProvider(pDoc, rDataSource));
+ return std::make_shared<XMLDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.sql")
- return std::shared_ptr<DataProvider>(new SQLDataProvider(pDoc, rDataSource));
+ return std::make_shared<SQLDataProvider>(pDoc, rDataSource);
}
else
{
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 9ccbf096fc10..0d7724a97b0a 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1689,7 +1689,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg(GetActiveDialogParent(), *pStyleSheet, true));
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, pDlg, pRequest, pStyleSheet, aOldData, aOldName, &rStyleSet, nCurTab, &rCaller, bUndo](sal_Int32 nResult){
if ( nResult == RET_OK )
@@ -1849,7 +1849,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
rStyleSet,
aStr,
nResId));
- std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
+ auto xRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, pDlg, pStyleSheet, xRequest](sal_Int32 nResult){
if ( nResult == RET_OK )
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index ec69d43f0eb8..e99f410b239d 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -789,7 +789,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
// show progress dialog
- std::shared_ptr<ScSolverProgressDialog> xProgress(new ScSolverProgressDialog(m_xDialog.get()));
+ auto xProgress = std::make_shared<ScSolverProgressDialog>(m_xDialog.get());
sal_Int32 nTimeout = 0;
if ( FindTimeout( nTimeout ) )
xProgress->SetTimeLimit( nTimeout );
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index f0a042a702f3..9095a7aa2c2d 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -888,13 +888,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
// cell range picker
vcl::Window* pWin = GetViewData()->GetActiveWin();
weld::Window* pParentWin = pWin ? pWin->GetFrameWeld() : nullptr;
- std::shared_ptr<SfxDialogController> xDlg(new ScValidationDlg(pParentWin, &aArgSet, pTabViewShell));
+ auto xDlg = std::make_shared<ScValidationDlg>(pParentWin, &aArgSet, pTabViewShell);
ScValidationRegisteredDlg aRegisterThatDlgExists(pParentWin, xDlg);
short nResult = xDlg->run();
if ( nResult == RET_OK )
{
- const SfxItemSet* pOutSet = static_cast<ScValidationDlg*>(xDlg.get())->GetOutputItemSet();
+ const SfxItemSet* pOutSet = xDlg->GetOutputItemSet();
if ( pOutSet->GetItemState( FID_VALID_MODE, true, &pItem ) == SfxItemState::SET )
eMode = static_cast<ScValidationMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c6833d7fe2aa..cc9c29661cbb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5156,7 +5156,7 @@ std::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const S
{
ScDocument& rDoc = pDocSh->GetDocument();
- std::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool()));
+ auto pEngine = std::make_shared<ScFieldEditEngine>(&rDoc, rDoc.GetEditPool());
ScSizeDeviceProvider aProv(pDocSh);
pEngine->SetRefDevice(aProv.GetDevice());
pEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 9af78a03f5fa..605057ef91e0 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1022,7 +1022,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
Color aProtectedColor( rColorCfg.GetColorValue( svtools::CALCPROTECTEDBACKGROUND ).nColor );
- std::shared_ptr<SvxBrushItem> pProtectedBackground( new SvxBrushItem( aProtectedColor, ATTR_BACKGROUND ) );
+ auto pProtectedBackground = std::make_shared<SvxBrushItem>( aProtectedColor, ATTR_BACKGROUND );
// iterate through the rows to show
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 37d7fc1e2100..9ec10e64cbf5 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -475,7 +475,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
const ScPatternAttr* pOldAttrs = GetSelectionPattern();
- std::shared_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet()));
+ auto pOldSet = std::make_shared<SfxItemSet>(pOldAttrs->GetItemSet());
std::shared_ptr<SvxNumberInfoItem> pNumberInfoItem;
pOldSet->MergeRange(XATTR_FILLSTYLE, XATTR_FILLCOLOR);
@@ -542,7 +542,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
if (!rName.isEmpty())
pDlg->SetCurPageId(rName);
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([pDlg, pOldSet, pRequest, this](sal_Int32 nResult){
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 0e61a2a8a072..a682420fb071 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -295,11 +295,11 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
else
{
ScAddress aCellPos( nPosX, nPosY, GetViewData().GetTabNo() );
- std::shared_ptr<ScImportExport> pObj(new ScImportExport(GetViewData().GetDocument(), aCellPos));
+ auto pObj = std::make_shared<ScImportExport>(GetViewData().GetDocument(), aCellPos);
pObj->SetOverwriting( true );
- std::shared_ptr<OUString> pStrBuffer(new OUString());
+ auto pStrBuffer = std::make_shared<OUString>();
tools::SvRef<SotStorageStream> xStream;
if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.is() )
{
@@ -341,7 +341,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
{
vcl::Window* pParent = GetActiveWin();
- std::shared_ptr<ScImportStringStream> pStrm(new ScImportStringStream(*pStrBuffer));
+ auto pStrm = std::make_shared<ScImportStringStream>(*pStrBuffer);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
VclPtr<AbstractScImportAsciiDlg> pDlg(
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 52fc6f9d7050..707f8c85110e 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -51,11 +51,11 @@ bool SdFiltersTest::load(const OUString &rFilter, const OUString &rURL,
const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
unsigned int nFilterVersion)
{
- std::shared_ptr<const SfxFilter> pFilter(new SfxFilter(
+ auto pFilter = std::make_shared<SfxFilter>(
rFilter,
OUString(), nFilterFlags, nClipboardID, OUString(), OUString(),
- rUserData, OUString() ));
- const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion);
+ rUserData, OUString() );
+ pFilter->SetVersion(nFilterVersion);
::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ);
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 8fef3182ee3e..bdb800953e01 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -207,15 +207,15 @@ protected:
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (pFormat->nFormatType == ODG_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARDRAW_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
OUString::createFromAscii(pFormat->pFilterName),
OUString(), pFormat->nFormatType, nExportFormat,
OUString::createFromAscii(pFormat->pTypeName),
OUString(),
OUString::createFromAscii(pFormat->pUserData),
- "private:factory/sdraw*" ));
+ "private:factory/sdraw*" );
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
}
else // Impress
@@ -223,15 +223,15 @@ protected:
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (pFormat->nFormatType == ODP_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARIMPRESS_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
OUString::createFromAscii(pFormat->pFilterName),
OUString(), pFormat->nFormatType, nExportFormat,
OUString::createFromAscii(pFormat->pTypeName),
OUString(),
OUString::createFromAscii(pFormat->pUserData),
- "private:factory/simpress*" ));
+ "private:factory/simpress*" );
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
}
pShell->ConvertTo(aStoreMedium);
@@ -247,14 +247,14 @@ protected:
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (pFormat->nFormatType == ODG_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARDRAW_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
OUString::createFromAscii(pFormat->pFilterName),
OUString(), pFormat->nFormatType, nExportFormat,
OUString::createFromAscii(pFormat->pTypeName),
OUString(),
OUString::createFromAscii(pFormat->pUserData),
- "private:factory/sdraw*" ));
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ "private:factory/sdraw*" );
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
}
else // Impress
@@ -262,14 +262,14 @@ protected:
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
if (pFormat->nFormatType == ODP_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARCHART_8;
- std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter(
+ auto pExportFilter = std::make_shared<SfxFilter>(
OUString::createFromAscii(pFormat->pFilterName),
OUString(), pFormat->nFormatType, nExportFormat,
OUString::createFromAscii(pFormat->pTypeName),
OUString(),
OUString::createFromAscii(pFormat->pUserData),
- "private:factory/simpress*" ));
- const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
+ "private:factory/simpress*" );
+ pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
aStoreMedium.SetFilter(pExportFilter);
}
pShell->DoSaveAs(aStoreMedium);
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index f4de034d7877..32c8a3e1d1df 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1636,7 +1636,7 @@ void CustomAnimationPane::showOptions(const OString& rPage)
{
std::unique_ptr<STLPropertySet> xSet = createSelectionSet();
- std::shared_ptr<CustomAnimationDialog> xDlg(new CustomAnimationDialog(GetFrameWeld(), std::move(xSet), rPage));
+ auto xDlg = std::make_shared<CustomAnimationDialog>(GetFrameWeld(), std::move(xSet), rPage);
weld::DialogController::runAsync(xDlg, [xDlg, this](sal_Int32 nResult){
if (nResult )
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 6cd3de93bfa7..a60238eb9273 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -275,7 +275,7 @@ std::shared_ptr<BasicViewFactory::ViewDescriptor> BasicViewFactory::CreateView (
FrameView* pFrameView,
const bool bIsCenterPane)
{
- std::shared_ptr<ViewDescriptor> pDescriptor (new ViewDescriptor);
+ auto pDescriptor = std::make_shared<ViewDescriptor>();
pDescriptor->mpViewShell = CreateViewShell(
rxViewId,
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 96a805040cb9..4984c675ec4c 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -109,7 +109,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if (!pDlg)
return;
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([bWelded, pDlg, pRequest, this](sal_Int32 nResult){
diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx
index 42617e9bd133..b62794a7e929 100644
--- a/sd/source/ui/presenter/PresenterPreviewCache.cxx
+++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx
@@ -277,7 +277,7 @@ const SdrPage* PresenterPreviewCache::PresenterCacheContext::GetPage (CacheKey a
std::shared_ptr<std::vector<CacheKey> >
PresenterPreviewCache::PresenterCacheContext::GetEntryList (bool bVisible)
{
- std::shared_ptr<std::vector<CacheKey> > pKeys (new std::vector<CacheKey>);
+ auto pKeys = std::make_shared<std::vector<CacheKey>>();
if ( ! mxSlides.is())
return pKeys;
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index bf5d0fdc5392..1828b72960b5 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -128,10 +128,10 @@ void RemoteServer::execute()
pSocket->getPeerAddr( aClientAddr );
MutexGuard aGuard( sDataMutex );
- std::shared_ptr< ClientInfoInternal > pClient(
- new ClientInfoInternal(
+ std::shared_ptr< ClientInfoInternal > pClient =
+ std::make_shared<ClientInfoInternal>(
OStringToOUString( aName, RTL_TEXTENCODING_UTF8 ),
- pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) ) );
+ pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) );
mAvailableClients.push_back( pClient );
// Read off any additional non-empty lines
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 1020cde8a4e8..725cc61a6dad 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -83,7 +83,7 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create (
if (pDocument == nullptr)
return nullptr;
- std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
+ auto pContainer = std::make_shared<MasterPageContainer>();
VclPtrInstance<AllMasterPagesSelector> pSelector(
pParent,
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index 835a4532a294..013f84516ebe 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -46,7 +46,7 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
if (pDocument == nullptr)
return nullptr;
- std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
+ auto pContainer = std::make_shared<MasterPageContainer>();
VclPtrInstance<CurrentMasterPagesSelector> pSelector(
pParent,
@@ -137,8 +137,8 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList)
pMasterPage->GetName(),
OUString(),
pMasterPage->IsPrecious(),
- std::shared_ptr<PageObjectProvider>(new ExistingPageProvider(pMasterPage)),
- std::shared_ptr<PreviewProvider>(new PagePreviewProvider())));
+ std::make_shared<ExistingPageProvider>(pMasterPage),
+ std::make_shared<PagePreviewProvider>()));
aToken = mpContainer->PutMasterPage(pDescriptor);
}
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index 18ad57d14a3c..95f68f316ca6 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -521,7 +521,7 @@ void MasterPageContainer::Implementation::LateInit()
std::shared_ptr<MasterPageContainerQueue::ContainerAdapter>(Instance())));
mpFillerTask = ::sd::tools::TimerBasedTaskExecution::Create(
- std::shared_ptr<tools::AsynchronousTask>(new MasterPageContainerFiller(*this)),
+ std::make_shared<MasterPageContainerFiller>(*this),
5,
50);
diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
index d007e524f969..5dc90ac29491 100644
--- a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
@@ -46,8 +46,8 @@ MasterPageContainerFiller::MasterPageContainerFiller (ContainerAdapter& rpAdapte
OUString(),
OUString(),
false,
- std::shared_ptr<PageObjectProvider>(new DefaultPageObjectProvider()),
- std::shared_ptr<PreviewProvider>(new PagePreviewProvider())));
+ std::make_shared<DefaultPageObjectProvider>(),
+ std::make_shared<PagePreviewProvider>()));
mrContainerAdapter.PutMasterPage(pDescriptor);
}
@@ -147,18 +147,15 @@ MasterPageContainerFiller::State MasterPageContainerFiller::AddTemplate()
mpLastAddedEntry->msTitle,
OUString(),
false,
- std::shared_ptr<PageObjectProvider>(
- new TemplatePageObjectProvider(mpLastAddedEntry->msPath)),
- std::shared_ptr<PreviewProvider>(
- new TemplatePreviewProvider(mpLastAddedEntry->msPath))));
+ std::make_shared<TemplatePageObjectProvider>(mpLastAddedEntry->msPath),
+ std::make_shared<TemplatePreviewProvider>(mpLastAddedEntry->msPath)));
// For user supplied templates we use a different preview provider:
// The preview in the document shows not only shapes on the master
// page but also shapes on the foreground. This is misleading and
// therefore these previews are discarded and created directly from
// the page objects.
if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER)
- pDescriptor->mpPreviewProvider = std::shared_ptr<PreviewProvider>(
- new PagePreviewProvider());
+ pDescriptor->mpPreviewProvider = std::make_shared<PagePreviewProvider>();
mrContainerAdapter.PutMasterPage(pDescriptor);
++mnIndex;
diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
index 0f9d21a81c2c..2d77511f067e 100644
--- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx
+++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
@@ -176,7 +176,7 @@ int MasterPageDescriptor::UpdatePageObject (
// will create the real one.
maSmallPreview = Image();
maLargePreview = Image();
- mpPreviewProvider = std::shared_ptr<PreviewProvider>(new PagePreviewProvider());
+ mpPreviewProvider = std::make_shared<PagePreviewProvider>();
}
else
{
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index 4e846dad20aa..7a2568375f99 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -37,7 +37,7 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
if (pDocument == nullptr)
return nullptr;
- std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
+ auto pContainer = std::make_shared<MasterPageContainer>();
VclPtrInstance<RecentMasterPagesSelector> pSelector(
pParent,
diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
index c6f0b02b07a4..d1f4ab532d82 100644
--- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
+++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
@@ -144,10 +144,8 @@ void RecentlyUsedMasterPages::LoadPersistentValues()
OUString(),
sName,
false,
- std::shared_ptr<PageObjectProvider>(
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list