From 9b8013b20d20a3946146d5287e8d8f8b9ddf694d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 24 Jan 2020 13:21:55 +0200 Subject: loplugin:makeshared in sw Change-Id: I6b297b84edda441c4ec6ea9f89ed553a50783bf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87356 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/html/htmlctxt.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 12 ++++++------ sw/source/filter/html/swhtml.cxx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sw/source/filter/html') diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 48a270b80862..5ed9cf0427ff 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -101,7 +101,7 @@ std::shared_ptr const & HTMLAttrContext_SaveDoc::GetAttrTab( bool { if (!xAttrTab && bCreate) { - xAttrTab.reset(new HTMLAttrTable); + xAttrTab = std::make_shared(); memset(xAttrTab.get(), 0, sizeof(HTMLAttrTable)); } return xAttrTab; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index dc9c5a7e9180..e0926eb9dbb9 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -143,7 +143,7 @@ public: bRestartPRE( false ), bRestartXMP( false ), bRestartListing( false ), - xAttrTab(new HTMLAttrTable) + xAttrTab(std::make_shared()) { memset(xAttrTab.get(), 0, sizeof(HTMLAttrTable)); } @@ -691,7 +691,7 @@ const std::shared_ptr& HTMLTableCnts::CreateLayoutInfo() std::shared_ptr xTableInfo; if (m_xTable) xTableInfo = m_xTable->CreateLayoutInfo(); - m_xLayoutInfo.reset(new SwHTMLTableLayoutCnts(m_pStartNode, xTableInfo, m_bNoBreak, xNextInfo)); + m_xLayoutInfo = std::make_shared(m_pStartNode, xTableInfo, m_bNoBreak, xNextInfo); } return m_xLayoutInfo; @@ -750,7 +750,7 @@ void HTMLTableCell::SetProtected() // Copy background color if (m_xBGBrush) - m_xBGBrush.reset(new SvxBrushItem(*m_xBGBrush)); + m_xBGBrush = std::make_shared(*m_xBGBrush); m_nRowSpan = 1; m_nColSpan = 1; @@ -1096,13 +1096,13 @@ const std::shared_ptr& HTMLTable::CreateLayoutInfo() sal_uInt16 nRightBorderWidth = m_bRightBorder ? GetBorderWidth( m_aRightBorderLine, true ) : 0; - m_xLayoutInfo.reset(new SwHTMLTableLayout( + m_xLayoutInfo = std::make_shared( m_pSwTable, m_nRows, m_nCols, m_bFixedCols, m_bColSpec, nW, m_bPercentWidth, m_nBorder, m_nCellPadding, m_nCellSpacing, m_eTableAdjust, m_nLeftMargin, m_nRightMargin, - nBorderWidth, nLeftBorderWidth, nRightBorderWidth)); + nBorderWidth, nLeftBorderWidth, nRightBorderWidth); bool bExportable = true; sal_uInt16 i; @@ -4488,7 +4488,7 @@ public: CaptionSaveStruct( SwHTMLParser& rParser, const SwPosition& rPos ) : SectionSaveStruct( rParser ), aSavePos( rPos ), - xAttrTab(new HTMLAttrTable) + xAttrTab(std::make_shared()) { rParser.SaveAttrTab(xAttrTab); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 845ca782f394..c67078f24619 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -261,7 +261,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn, : SfxHTMLParser( rIn, bReadNewDoc, pMed ), m_aPathToFile( rPath ), m_sBaseURL( rBaseURL ), - m_xAttrTab(new HTMLAttrTable), + m_xAttrTab(std::make_shared()), m_pNumRuleInfo( new SwHTMLNumRuleInfo ), m_xDoc( pD ), m_pActionViewShell( nullptr ), -- cgit v1.2.3