diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 12:30:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 13:07:41 +0100 |
commit | 175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch) | |
tree | 4a252a7e9e6e714343e9ff21c3d78c8e41086009 /sw | |
parent | ddf901664d3dd12191f98b77182652a6889f2b26 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/filters-test.cxx | 6 | ||||
-rw-r--r-- | sw/qa/core/filters-test2.cxx | 7 | ||||
-rw-r--r-- | sw/qa/core/uwriter.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/tox/ToxTextGenerator.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/docx/swdocxreader.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocumentproperties.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtnum.cxx | 2 |
21 files changed, 39 insertions, 41 deletions
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 14aa0aa39c56..5db4e52fcb9e 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -75,11 +75,11 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport) { - 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); SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sw/qa/core/filters-test2.cxx b/sw/qa/core/filters-test2.cxx index 6ce9376f681c..e2c3e7e7766f 100644 --- a/sw/qa/core/filters-test2.cxx +++ b/sw/qa/core/filters-test2.cxx @@ -74,10 +74,9 @@ bool SwFiltersTest2::filter(const OUString& rFilter, const OUString& rURL, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport) { - std::shared_ptr<const SfxFilter> pFilter(new SfxFilter(rFilter, OUString(), nFilterFlags, - nClipboardID, OUString(), OUString(), - rUserData, OUString())); - const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion); + auto pFilter = std::make_shared<SfxFilter>(rFilter, OUString(), nFilterFlags, nClipboardID, + OUString(), OUString(), rUserData, OUString()); + pFilter->SetVersion(nFilterVersion); SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 22cd289c7f27..1d7c131c4d5a 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -208,10 +208,10 @@ void SwDocTest::testFileNameFields() OUString sFileURL = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); SfxMedium aDstMed(sFileURL, StreamMode::STD_READWRITE); - std::shared_ptr<SfxFilter> pFilter(new SfxFilter( + auto pFilter = std::make_shared<SfxFilter>( "Text", OUString(), SfxFilterFlags::NONE, SotClipboardFormatId::NONE, OUString(), OUString(), - "TEXT", OUString() )); + "TEXT", OUString() ); aDstMed.SetFilter(pFilter); m_xDocShRef->DoSaveAs(aDstMed); diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index d5795458ca8f..67887904e891 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -275,7 +275,7 @@ ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector<std::unique_ptr<Sw /*static*/ std::shared_ptr<SfxItemSet> ToxTextGenerator::CollectAttributesForTox(const SwTextAttr& hint, SwAttrPool& pool) { - std::shared_ptr<SfxItemSet> retval(new SfxItemSet(pool)); + auto retval = std::make_shared<SfxItemSet>(pool); if (hint.Which() != RES_TXTATR_AUTOFMT) { return retval; } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index a5b68cd902d6..8c212feb8962 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -891,8 +891,8 @@ sal_uInt16 SaveTable::AddFormat( SwFrameFormat* pFormat, bool bIsLine ) if( SIZE_MAX == nRet ) { // Create copy of ItemSet - std::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFormat->GetAttrSet().GetPool(), - bIsLine ? aTableLineSetRange : aTableBoxSetRange ) ); + auto pSet = std::make_shared<SfxItemSet>( *pFormat->GetAttrSet().GetPool(), + bIsLine ? aTableLineSetRange : aTableBoxSetRange ); pSet->Put( pFormat->GetAttrSet() ); // When a formula is set, never save the value. It possibly must be // recalculated. @@ -1418,8 +1418,7 @@ SwUndoTableAutoFormat::~SwUndoTableAutoFormat() void SwUndoTableAutoFormat::SaveBoxContent( const SwTableBox& rBox ) { - std::shared_ptr<SwUndoTableNumFormat> const p(new SwUndoTableNumFormat(rBox)); - m_Undos.push_back(p); + m_Undos.push_back(std::make_shared<SwUndoTableNumFormat>(rBox)); } void diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 365736807059..cd1315b59cd0 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -142,8 +142,8 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, if( !m_pFrameFormats || m_pFrameFormats->end() == ( it = std::find( m_pFrameFormats->begin(), m_pFrameFormats->end(), pFormat ) ) ) { - std::shared_ptr<SwUndoInsLayFormat> const pFlyUndo( - new SwUndoInsLayFormat(pFormat, 0, 0)); + std::shared_ptr<SwUndoInsLayFormat> const pFlyUndo = + std::make_shared<SwUndoInsLayFormat>(pFormat, 0, 0); m_FlyUndos.push_back(pFlyUndo); } else diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index e6a7cfa6c3ea..685f29fbd1da 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -865,7 +865,7 @@ namespace { void lcl_addShapePropertyEventFactories( SdrObject& _rObj, SwXShape& _rShape ) { - std::shared_ptr<svx::IPropertyValueProvider> pProvider( new svx::PropertyValueProvider( _rShape, "AnchorType" ) ); + auto pProvider = std::make_shared<svx::PropertyValueProvider>( _rShape, "AnchorType" ); _rObj.getShapePropertyChangeNotifier().registerProvider( svx::ShapeProperty::TextDocAnchor, pProvider ); } } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 6793e74602f0..0b0e1536f34a 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3782,7 +3782,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut std::pair< sal_uInt16, text::RubyAdjust > aPair( pRubyItem->GetPosition(), pRubyItem->GetAdjustment() ); if ( aRubyMap.insert( aPair ).second ) { - std::shared_ptr<SfxItemSet> pItemSet( new SfxItemSet( rAttrPool, svl::Items<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY>{} ) ); + auto pItemSet = std::make_shared<SfxItemSet>( rAttrPool, svl::Items<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY>{} ); pItemSet->Put( *pRubyItem ); mAutoStyles.push_back( pItemSet ); } diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx index 93cda1a66982..f13127fcabd7 100644 --- a/sw/source/filter/docx/swdocxreader.cxx +++ b/sw/source/filter/docx/swdocxreader.cxx @@ -50,7 +50,7 @@ ErrCode SwDOCXReader::Read(SwDoc& rDoc, const OUString& /* rBaseURL */, SwPaM& r return ERR_SWG_READ_ERROR; // We want to work in an empty paragraph. - std::shared_ptr<SwNodeIndex> pSttNdIdx(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx = std::make_shared<SwNodeIndex>(rDoc.GetNodes()); const SwPosition* pPos = rPam.GetPoint(); rDoc.getIDocumentContentOperations().SplitNode(*pPos, false); rDoc.SetTextFormatColl(rPam, rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, false)); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 6d5fadbde1a6..dc9c5a7e9180 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1616,8 +1616,8 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, const SwStartNode* pPrevStartNd = GetPrevBoxStartNode( nTopRow, nStartCol ); - std::shared_ptr<HTMLTableCnts> xCnts(new HTMLTableCnts( - m_pParser->InsertTableSection(pPrevStartNd))); + auto xCnts = std::make_shared<HTMLTableCnts>( + m_pParser->InsertTableSection(pPrevStartNd)); const std::shared_ptr<SwHTMLTableLayoutCnts> xCntsLayoutInfo = xCnts->CreateLayoutInfo(); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 394da93ad3a0..11fa1ea8744b 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -60,7 +60,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam // the end position. const uno::Reference<text::XTextRange> xInsertPosition = SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr); - std::shared_ptr<SwNodeIndex> pSttNdIdx(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx = std::make_shared<SwNodeIndex>(rDoc.GetNodes()); const SwPosition* pPos = rPam.GetPoint(); // Step 2: Split once and remember the node that has been split. @@ -69,7 +69,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam // Step 3: Split again. rDoc.getIDocumentContentOperations().SplitNode(*pPos, false); - std::shared_ptr<SwNodeIndex> pSttNdIdx2(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx2 = std::make_shared<SwNodeIndex>(rDoc.GetNodes()); *pSttNdIdx2 = pPos->nNode.GetIndex(); // Step 4: Insert all content into the new node diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 4001977502c3..b01944d89467 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1513,7 +1513,7 @@ SvStream* SwEscherExGlobal::ImplQueryPictureStream() } SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) - : EscherEx( std::shared_ptr<EscherExGlobal>( new SwEscherExGlobal ), pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) + : EscherEx( std::make_shared<SwEscherExGlobal>(), pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) { Init(); } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index b0dd924a1aa7..40a4729a2286 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1792,7 +1792,7 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) for (const WW8_SepInfo & rSepInfo : aSects) { - std::shared_ptr<WW8_PdAttrDesc> const pAttrDesc(new WW8_PdAttrDesc); + auto pAttrDesc = std::make_shared<WW8_PdAttrDesc>(); m_SectionAttributes.push_back(pAttrDesc); rWrt.SectionProperties( rSepInfo, pAttrDesc.get() ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 97dd8ae286d2..12315b438d3e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -801,8 +801,8 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, // with a Frame, else if( bIsSimpleDrawingTextBox ) { - std::shared_ptr<SvxMSDffShapeInfo> const xTmpRec( - new SvxMSDffShapeInfo(0, pImpRec->nShapeId)); + std::shared_ptr<SvxMSDffShapeInfo> const xTmpRec = + std::make_shared<SvxMSDffShapeInfo>(0, pImpRec->nShapeId); SvxMSDffShapeInfos_ById::const_iterator const it = GetShapeInfos()->find(xTmpRec); diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 19047d79f974..c271f1435632 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -619,7 +619,7 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void) } SwView* pSourceView = xConfigItem->GetSourceView(); - std::shared_ptr<SaveMonitor> xSaveMonitor(new SaveMonitor(m_xDialog.get())); + auto xSaveMonitor = std::make_shared<SaveMonitor>(m_xDialog.get()); xSaveMonitor->m_xDocName->set_label(pSourceView->GetDocShell()->GetTitle(22)); xSaveMonitor->m_xPrinter->set_label( INetURLObject( sPath ).getFSysPath( FSysStyle::Detect ) ); m_bCancelSaving = false; diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index c784e0bb6b99..cb6f6ea800be 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -401,8 +401,8 @@ class BuiltInIndexHelper public: explicit BuiltInIndexHelper( const uno::Reference< frame::XModel >& xModel ) { - std::shared_ptr< PropertGetSetHelper > aStandardHelper( new BuiltinPropertyGetSetHelper( xModel ) ); - std::shared_ptr< PropertGetSetHelper > aUsingStatsHelper( new StatisticPropertyGetSetHelper( xModel ) ); + auto aStandardHelper = std::make_shared<BuiltinPropertyGetSetHelper>( xModel ); + auto aUsingStatsHelper = std::make_shared<StatisticPropertyGetSetHelper>( xModel ); m_docPropInfoMap[ word::WdBuiltInProperty::wdPropertyTitle ] = DocPropInfo::createDocPropInfo( "Title", "Title", aStandardHelper ); m_docPropInfoMap[ word::WdBuiltInProperty::wdPropertySubject ] = DocPropInfo::createDocPropInfo( "Subject", "Subject", aStandardHelper ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index d20e923f2584..95f13f4cfd03 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1211,7 +1211,7 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_CLASSIFICATION_DIALOG: { - std::shared_ptr<svx::ClassificationDialog> xDialog(new svx::ClassificationDialog(GetView()->GetFrameWeld(), false)); + auto xDialog = std::make_shared<svx::ClassificationDialog>(GetView()->GetFrameWeld(), false); SwWrtShell* pShell = GetWrtShell(); std::vector<svx::ClassificationResult> aInput = pShell->CollectAdvancedClassification(); @@ -1226,10 +1226,10 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_PARAGRAPH_SIGN_CLASSIFY_DLG: { SwWrtShell* pShell = GetWrtShell(); - std::shared_ptr<svx::ClassificationDialog> xDialog(new svx::ClassificationDialog(GetView()->GetFrameWeld(), true, [pShell]() + auto xDialog = std::make_shared<svx::ClassificationDialog>(GetView()->GetFrameWeld(), true, [pShell]() { pShell->SignParagraph(); - })); + }); std::vector<svx::ClassificationResult> aInput = pShell->CollectParagraphClassification(); xDialog->setupValues(aInput); @@ -1265,8 +1265,8 @@ void SwDocShell::Execute(SfxRequest& rReq) { SfxViewShell* pViewShell = GetView() ? GetView() : SfxViewShell::Current(); SfxBindings& rBindings( pViewShell->GetViewFrame()->GetBindings() ); - std::shared_ptr<SwWatermarkDialog> xDlg(new SwWatermarkDialog(pViewShell->GetViewFrame()->GetWindow().GetFrameWeld(), - rBindings)); + auto xDlg = std::make_shared<SwWatermarkDialog>(pViewShell->GetViewFrame()->GetWindow().GetFrameWeld(), + rBindings); weld::DialogController::runAsync(xDlg, [](sal_Int32 /*nResult*/){}); } } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 61cb6a0df6cd..249b549dcb0e 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -890,7 +890,7 @@ void SwDocShell::Edit( SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); VclPtr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(GetView()->GetFrameWeld(), *xTmp, nFamily, sPage, pCurrShell, bNew)); - std::shared_ptr<ApplyStyle> pApplyStyleHelper(new ApplyStyle(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified)); + auto pApplyStyleHelper = std::make_shared<ApplyStyle>(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified); pDlg->SetApplyHdl(LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl)); std::shared_ptr<SfxRequest> pRequest; diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 9ee2f5784703..c6e1ae74877f 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -593,7 +593,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if (pItem) pDlg->SetCurPageId(OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8)); - 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, pRequest, pTableRep, &rBindings, &rSh](sal_Int32 nResult){ diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 08097faf0205..ee09143f510e 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -113,7 +113,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); - std::shared_ptr<SfxItemSet> pCoreSet(new SfxItemSet( + auto pCoreSet = std::make_shared<SfxItemSet>( rWrtSh.GetView().GetPool(), svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, @@ -123,7 +123,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, SID_HTML_MODE, SID_HTML_MODE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - FN_PARAM_SELECTION, FN_PARAM_SELECTION>{})); + FN_PARAM_SELECTION, FN_PARAM_SELECTION>{}); rWrtSh.GetCurAttr(*pCoreSet); bool bSel = rWrtSh.HasSelection(); @@ -1069,7 +1069,7 @@ void SwTextShell::Execute(SfxRequest &rReq) } else if (pDlg) { - 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, &rWrtSh, pRequest, nDefDist](sal_Int32 nResult){ diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 3b2fb5ab1457..aadc698ac024 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -185,7 +185,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) if ( pPageItem ) pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) ); - 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([aSet, pDlg, pNumRuleAtCurrentSelection, pRequest, this](sal_Int32 nResult){ |