From e00c87caa399d37426d839f5264a747c115d0b12 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 30 Apr 2020 12:22:14 +0200 Subject: loplugin:makeshared in sw Change-Id: I58d91e75ef96beaab7ec34df519ae3a376dce976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93201 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/attr/format.cxx | 6 ++-- sw/source/core/docnode/ndtbl1.cxx | 2 +- sw/source/core/inc/unoparaframeenum.hxx | 4 +-- sw/source/core/unocore/unoframe.cxx | 2 +- sw/source/core/unocore/unoobj2.cxx | 4 +-- sw/source/filter/basflt/fltini.cxx | 2 +- sw/source/filter/basflt/fltshell.cxx | 4 +-- sw/source/filter/inc/fltshell.hxx | 2 +- sw/source/filter/ww8/docxexport.cxx | 4 +-- sw/source/filter/ww8/rtfexport.cxx | 2 +- sw/source/filter/ww8/wrtww8.cxx | 9 +++--- sw/source/filter/ww8/wrtww8.hxx | 2 +- sw/source/filter/ww8/ww8par.cxx | 6 ++-- sw/source/filter/ww8/ww8par5.cxx | 2 +- sw/source/filter/ww8/ww8par6.cxx | 2 +- sw/source/ui/dialog/swdlgfact.cxx | 50 ++++++++++++++--------------- sw/source/ui/dialog/swdlgfact.hxx | 22 ++++++------- sw/source/uibase/inc/swrenamexnameddlg.hxx | 4 +-- sw/source/uibase/shells/frmsh.cxx | 6 ++-- sw/source/uibase/shells/tabsh.cxx | 4 +-- sw/source/uibase/shells/textsh.cxx | 2 +- sw/source/uibase/uiview/formatclipboard.cxx | 9 +++--- sw/source/uibase/uiview/viewtab.cxx | 2 +- 23 files changed, 74 insertions(+), 78 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index c856abb50b34..30f72d7fc3ac 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -380,7 +380,7 @@ const SfxPoolItem& SwFormat::GetFormatAttr( sal_uInt16 nWhich, bool bInParents ) { // FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] SAL_INFO("sw.core", "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes or makeBackgroundBrushItem (simple fallback is in place and used)"); - static std::shared_ptr aSvxBrushItem; //(std::make_shared(RES_BACKGROUND)); + static std::unique_ptr aSvxBrushItem; //(std::make_shared(RES_BACKGROUND)); // fill the local static SvxBrushItem from the current ItemSet so that // the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used @@ -407,7 +407,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons // if yes, fill the local SvxBrushItem using the new fill attributes // as good as possible to have an instance for the pointer to point // to and return as state that it is set - static std::shared_ptr aSvxBrushItem; //(RES_BACKGROUND); + static std::unique_ptr aSvxBrushItem; //(RES_BACKGROUND); aSvxBrushItem = getSvxBrushItemFromSourceSet(m_aSet, RES_BACKGROUND, bSrchInParent); if( ppItem ) @@ -427,7 +427,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons return m_aSet.GetItemState( nWhich, bSrchInParent, ppItem ); } -SfxItemState SwFormat::GetBackgroundState(std::shared_ptr& rItem) const +SfxItemState SwFormat::GetBackgroundState(std::unique_ptr& rItem) const { if (supportsFullDrawingLayerFillAttributeSet()) { diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 8d8fa399ac9a..6dc3814db244 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -885,7 +885,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, const_cast(pCell->GetTabBox())->ClaimFrameFormat(); SwFrameFormat *pFormat = pCell->GetFormat(); - std::shared_ptr aBox(pFormat->GetBox().Clone()); + std::unique_ptr aBox(pFormat->GetBox().Clone()); if ( !pBorderLine && bSetLine ) { diff --git a/sw/source/core/inc/unoparaframeenum.hxx b/sw/source/core/inc/unoparaframeenum.hxx index 17b1b0013b36..e3712cf28b8b 100644 --- a/sw/source/core/inc/unoparaframeenum.hxx +++ b/sw/source/core/inc/unoparaframeenum.hxx @@ -44,8 +44,8 @@ struct FrameClientSortListEntry std::shared_ptr pFrameClient; FrameClientSortListEntry (sal_Int32 const i_nIndex, - sal_uInt32 const i_nOrder, sw::FrameClient* const i_pClient) - : nIndex(i_nIndex), nOrder(i_nOrder), pFrameClient(i_pClient) { } + sal_uInt32 const i_nOrder, std::shared_ptr i_pClient) + : nIndex(i_nIndex), nOrder(i_nOrder), pFrameClient(std::move(i_pClient)) { } }; typedef std::deque< FrameClientSortListEntry > diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 99d0098fcf72..d453f1c79709 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -339,7 +339,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI if(bXFillStyleItemUsed) { XFillStyleItem aXFillStyleItem; - std::shared_ptr aBrush(std::make_shared(RES_BACKGROUND)); + std::unique_ptr aBrush(std::make_unique(RES_BACKGROUND)); if(pXFillStyleItem) { diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 600ee1fca9f8..9f0dc5d8eb9e 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -127,7 +127,7 @@ struct FrameClientSortListLess const auto nIdx = rFormat.GetAnchor().GetContentAnchor()->nContent.GetIndex(); const auto nOrder = rFormat.GetAnchor().GetOrder(); - FrameClientSortListEntry entry(nIdx, nOrder, new sw::FrameClient(&rFormat)); + FrameClientSortListEntry entry(nIdx, nOrder, std::make_shared(&rFormat)); rFrames.push_back(entry); } } @@ -174,7 +174,7 @@ void CollectFrameAtNode( const SwNodeIndex& rIdx, const sal_Int32 nIndex = pAnchorPos->nContent.GetIndex(); sal_uInt32 nOrder = rAnchor.GetOrder(); - FrameClientSortListEntry entry(nIndex, nOrder, new sw::FrameClient(const_cast(pFormat))); + FrameClientSortListEntry entry(nIndex, nOrder, std::make_shared(const_cast(pFormat))); rFrames.push_back(entry); } } diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index f76ae2684a61..a36bc9ae0603 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -276,7 +276,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, if( SfxItemState::SET != rFlySet.GetItemState( RES_FRM_SIZE, true, &pItem ) || MINFLY > static_cast(pItem)->GetWidth() ) { - std::shared_ptr aSz(rFlySet.Get(RES_FRM_SIZE).Clone()); + std::unique_ptr aSz(rFlySet.Get(RES_FRM_SIZE).Clone()); if (pItem) aSz.reset(static_cast(pItem->Clone())); diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 95172677076d..4f725a98b9a9 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -1067,8 +1067,8 @@ const std::vector< std::pair >& SwFltRDFMark::GetAttributes( } // methods of SwFltTOX follow -SwFltTOX::SwFltTOX(SwTOXBase* pBase) - : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(pBase), +SwFltTOX::SwFltTOX(std::shared_ptr xBase) + : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(std::move(xBase)), bHadBreakItem( false ), bHadPageDescItem( false ) { } diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 344a5ace1f45..615917929475 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -282,7 +282,7 @@ class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem bool bHadBreakItem; // there was a break item BEFORE insertion of the TOX bool bHadPageDescItem; public: - SwFltTOX(SwTOXBase* pBase); + SwFltTOX(std::shared_ptr xBase); // "purely virtual methods" of SfxPoolItem virtual bool operator==(const SfxPoolItem&) const override; virtual SwFltTOX* Clone(SfxItemPool* = nullptr) const override; diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index b18d94410027..1b8f95f48115 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -1014,7 +1014,7 @@ void DocxExport::WriteSettings() } // Display Background Shape - if (std::shared_ptr oBrush = getBackground(); oBrush) + if (std::unique_ptr oBrush = getBackground(); oBrush) { // Turn on the 'displayBackgroundShape' pFS->singleElementNS(XML_w, XML_displayBackgroundShape); @@ -1642,7 +1642,7 @@ void DocxExport::WriteMainText() m_aLinkedTextboxesHelper.clear(); // Write background page color - if (std::shared_ptr oBrush = getBackground(); oBrush) + if (std::unique_ptr oBrush = getBackground(); oBrush) { Color backgroundColor = oBrush->GetColor(); OString aBackgroundColorStr = msfilter::util::ConvertColor(backgroundColor); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 967e5a650981..3cea7bfb88fe 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -420,7 +420,7 @@ void RtfExport::WriteMainText() { SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); - if (std::shared_ptr oBrush = getBackground(); oBrush) + if (std::unique_ptr oBrush = getBackground(); oBrush) { Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_VIEWBKSP).WriteChar('1'); Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BACKGROUND); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 5a5ff4bf395c..6982cd7a8fcc 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1515,20 +1515,19 @@ void WW8Export::AppendBookmarkEndWithCorrection( const OUString& rName ) m_pBkmks->Append( nEndCP - 1, rName ); } -std::shared_ptr MSWordExportBase::getBackground() +std::unique_ptr MSWordExportBase::getBackground() { - std::shared_ptr oRet; const SwFrameFormat &rFormat = m_pDoc->GetPageDesc(0).GetMaster(); - std::shared_ptr aBrush(std::make_shared(RES_BACKGROUND)); + std::unique_ptr aBrush = std::make_unique(RES_BACKGROUND); SfxItemState eState = rFormat.GetBackgroundState(aBrush); if (SfxItemState::SET == eState) { // The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX if (aBrush->GetColor() != COL_AUTO) - oRet = aBrush; + return aBrush; } - return oRet; + return nullptr; } // #i120928 collect all the graphics of bullets applied to paragraphs diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index d950aa7e1fee..3f165d8fb4a8 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -911,7 +911,7 @@ protected: void SetCurPam(sal_uLong nStt, sal_uLong nEnd); /// Get background color of the document, if there is one. - std::shared_ptr getBackground(); + std::unique_ptr getBackground(); /// Populates m_vecBulletPic with all the bullet graphics used by numberings. int CollectGrfsOfBullets(); /// Write the numbering picture bullets. diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 07f994b14ad8..cad890294a36 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4993,7 +4993,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) ReadDocInfo(); } - ::ww8::WW8FibData * pFibData = new ::ww8::WW8FibData(); + auto pFibData = std::make_shared<::ww8::WW8FibData>(); if (m_xWwFib->m_fReadOnlyRecommended) pFibData->setReadOnlyRecommended(true); @@ -5005,9 +5005,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) else pFibData->setWriteReservation(false); - ::sw::tExternalDataPointer pExternalFibData(pFibData); - - m_rDoc.getIDocumentExternalData().setExternalData(::sw::tExternalDataType::FIB, pExternalFibData); + m_rDoc.getIDocumentExternalData().setExternalData(::sw::tExternalDataType::FIB, pFibData); ::sw::tExternalDataPointer pSttbfAsoc = std::make_shared<::ww8::WW8Sttb>(*m_pTableStream, m_xWwFib->m_fcSttbfAssoc, m_xWwFib->m_lcbSttbfAssoc); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index b8cdf1c27671..95e96f9357b6 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2984,7 +2984,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) const SwTOXType* pType = m_rDoc.GetTOXType( eTox, 0 ); SwForm aOrigForm(eTox); - SwTOXBase* pBase = new SwTOXBase( pType, aOrigForm, nCreateOf, OUString() ); + std::shared_ptr pBase = std::make_shared( pType, aOrigForm, nCreateOf, OUString() ); pBase->SetProtected(m_aSectionManager.CurrentSectionIsProtected()); switch( eTox ){ case TOX_INDEX: diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index dd260b4804a1..2d7de4556b66 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -5063,7 +5063,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh = static_cast(GetFormatAttr( RES_CHRATR_BOX )); if( pBox ) { - std::shared_ptr aBoxItem(pBox->Clone()); + std::unique_ptr aBoxItem(pBox->Clone()); WW8_BRCVer9 aBrc; int nBrcVer = (nId == NS_sprm::sprmCBrc) ? 9 : (m_bVer67 ? 6 : 8); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index b73e844555b3..b3a40e9ecebc 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -807,7 +807,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwAsciiFilt VclPtr SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq) { - return VclPtr::Create(std::make_unique(pParent, rSh, rReq)); + return VclPtr::Create(std::make_shared(pParent, rSh, rReq)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld::Window* pParent, SwWrtShell &rSh) @@ -818,7 +818,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld:: VclPtr SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw) { #if HAVE_FEATURE_DBCONNECTIVITY - return VclPtr::Create(std::make_unique(rVw)); + return VclPtr::Create(std::make_shared(rVw)); #else (void) rVw; return nullptr; @@ -828,7 +828,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwVi VclPtr SwAbstractDialogFactory_Impl::CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, SwCharDlgMode nDialogMode, const OUString* pFormatStr) { - return VclPtr::Create(std::make_unique(pParent, pVw, rCoreSet, nDialogMode, pFormatStr)); + return VclPtr::Create(std::make_shared(pParent, pVw, rCoreSet, nDialogMode, pFormatStr)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg(SwView& rView, bool bToTable) @@ -838,7 +838,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwConvertT VclPtr SwAbstractDialogFactory_Impl::CreateSwCaptionDialog(weld::Window *pParent, SwView &rV) { - return VclPtr::Create(std::make_unique(pParent, rV)); + return VclPtr::Create(std::make_shared(pParent, rV)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView, @@ -859,7 +859,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwIns VclPtr SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rSh) { - return VclPtr::Create(std::make_unique(pParent, rSh)); + return VclPtr::Create(std::make_shared(pParent, rSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog(weld::Widget *pParent, @@ -882,7 +882,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwEnvDlg(weld:: SwWrtShell* pWrtSh, Printer* pPrt, bool bInsert) { - return VclPtr::Create(std::make_unique(pParent, rSet, pWrtSh,pPrt, bInsert)); + return VclPtr::Create(std::make_shared(pParent, rSet, pWrtSh,pPrt, bInsert)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwLabDlg(weld::Window* pParent, const SfxItemSet& rSet, @@ -901,17 +901,17 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwParaDlg(weld: bool bDraw , const OString& sDefPage) { - return VclPtr::Create(std::make_unique(pParent, rVw, rCoreSet, DLG_STD, nullptr, bDraw, sDefPage)); + return VclPtr::Create(std::make_shared(pParent, rVw, rCoreSet, DLG_STD, nullptr, bDraw, sDefPage)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwAutoMarkDialog(weld::Window *pParent, SwWrtShell &rSh) { - return VclPtr::Create(std::make_unique(pParent, rSh)); + return VclPtr::Create(std::make_shared(pParent, rSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwColumnDialog(weld::Window *pParent, SwWrtShell &rSh) { - return VclPtr::Create(std::make_unique(pParent, rSh)); + return VclPtr::Create(std::make_shared(pParent, rSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwTableHeightDialog(weld::Window *pParent, SwWrtShell &rSh) @@ -960,12 +960,12 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(we VclPtr SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(weld::Window* pParent, const SfxItemSet* pItemSet, SwWrtShell* pSh) { - return VclPtr::Create(std::make_unique(pParent, pItemSet, pSh)); + return VclPtr::Create(std::make_shared(pParent, pItemSet, pSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, weld::Window *pParent) { - return VclPtr::Create(std::make_unique(pB, pCW, pParent)); + return VclPtr::Create(std::make_shared(pB, pCW, pParent)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwFieldEditDlg(SwView& rVw) @@ -996,7 +996,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateFrameTabDialog( bool bNewFrame, const OString& sDefPage ) { - return VclPtr::Create(std::make_unique(pFrame, pParent, rCoreSet, bNewFrame, rDialogType, false/*bFormat*/, sDefPage, nullptr)); + return VclPtr::Create(std::make_shared(pFrame, pParent, rCoreSet, bNewFrame, rDialogType, false/*bFormat*/, sDefPage, nullptr)); } VclPtr SwAbstractDialogFactory_Impl::CreateTemplateDialog( @@ -1007,7 +1007,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateTemplateDi SwWrtShell* pActShell, bool bNew ) { - return VclPtr::Create(std::make_unique(pParent, rBase, nRegion, + return VclPtr::Create(std::make_shared(pParent, rBase, nRegion, sPage, pActShell, bNew)); } @@ -1031,12 +1031,12 @@ VclPtr SwAbstractDialogFactory_Impl::CreateInsFootNoteDl VclPtr SwAbstractDialogFactory_Impl::CreateTitlePageDlg(weld::Window *pParent) { - return VclPtr::Create(std::make_unique(pParent)); + return VclPtr::Create(std::make_shared(pParent)); } VclPtr SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView) { - return VclPtr::Create(std::make_unique(rView)); + return VclPtr::Create(std::make_shared(rView)); } VclPtr SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) @@ -1079,31 +1079,31 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSvxNumBulletTab const SfxItemSet* pSwItemSet, SwWrtShell & rWrtSh) { - return VclPtr::Create(std::make_unique(pParent, pSwItemSet, rWrtSh)); + return VclPtr::Create(std::make_shared(pParent, pSwItemSet, rWrtSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell & rWrtSh ) { - return VclPtr::Create(std::make_unique(pParent, pSwItemSet, rWrtSh)); + return VclPtr::Create(std::make_shared(pParent, pSwItemSet, rWrtSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell &rShell, SwTOXBase* pCurTOX, bool bGlobal) { - return VclPtr::Create(std::make_unique(pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal)); + return VclPtr::Create(std::make_shared(pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal)); } VclPtr SwAbstractDialogFactory_Impl::CreateEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh) { - return VclPtr::Create(std::make_unique(pParent, rWrtSh)); + return VclPtr::Create(std::make_shared(pParent, rWrtSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) { - return VclPtr::Create(std::make_unique(pParent, rSet, rSh)); + return VclPtr::Create(std::make_shared(pParent, rSet, rSh)); } VclPtr SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( @@ -1112,7 +1112,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateIndexMarkFloatD weld::Window *pParent, SfxChildWinInfo* pInfo ) { - return VclPtr::Create(std::make_unique(pBindings, pChild, pParent, pInfo, true/*bNew*/)); + return VclPtr::Create(std::make_shared(pBindings, pChild, pParent, pInfo, true/*bNew*/)); } VclPtr SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( @@ -1121,7 +1121,7 @@ VclPtr SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDl weld::Window *pParent, SfxChildWinInfo* pInfo) { - return VclPtr::Create(std::make_unique(pBindings, pChild, pParent, pInfo, true/*bNew*/)); + return VclPtr::Create(std::make_shared(pBindings, pChild, pParent, pInfo, true/*bNew*/)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( @@ -1130,19 +1130,19 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwWordCo weld::Window *pParent, SfxChildWinInfo* pInfo) { - return VclPtr::Create(std::make_unique(pBindings, pChild, pParent, pInfo)); + return VclPtr::Create(std::make_shared(pBindings, pChild, pParent, pInfo)); } VclPtr SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) { - return VclPtr::Create(std::make_unique(pParent, rSh, pCurTOXMark)); + return VclPtr::Create(std::make_shared(pParent, rSh, pCurTOXMark)); } VclPtr SwAbstractDialogFactory_Impl::CreateMailMergeWizard( SwView& rView, std::shared_ptr& rConfigItem) { #if HAVE_FEATURE_DBCONNECTIVITY - return VclPtr::Create(std::make_unique(rView, rConfigItem)); + return VclPtr::Create(std::make_shared(rView, rConfigItem)); #else (void) rView; (void) rConfigItem; diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index c34c16b80660..315cfba7b143 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -90,7 +90,7 @@ class AbstractSwWordCountFloatDlg_Impl : public AbstractSwWordCountFloatDlg { std::shared_ptr m_xDlg; public: - explicit AbstractSwWordCountFloatDlg_Impl(std::unique_ptr p) + explicit AbstractSwWordCountFloatDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -142,7 +142,7 @@ class AbstractGenericDialog_Impl : public VclAbstractDialog { std::shared_ptr m_xDlg; public: - explicit AbstractGenericDialog_Impl(std::unique_ptr p) + explicit AbstractGenericDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -236,7 +236,7 @@ class AbstractTabController_Impl : virtual public SfxAbstractTabDialog protected: std::shared_ptr m_xDlg; public: - explicit AbstractTabController_Impl(std::unique_ptr p) + explicit AbstractTabController_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -253,7 +253,7 @@ public: class AbstractApplyTabController_Impl : public AbstractTabController_Impl, virtual public SfxAbstractApplyTabDialog { public: - explicit AbstractApplyTabController_Impl(std::unique_ptr p) + explicit AbstractApplyTabController_Impl(std::shared_ptr p) : AbstractTabController_Impl(std::move(p)) { } @@ -375,7 +375,7 @@ class AbstractSwFieldDlg_Impl : public AbstractSwFieldDlg { std::shared_ptr m_xDlg; public: - explicit AbstractSwFieldDlg_Impl(std::unique_ptr p) + explicit AbstractSwFieldDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -552,7 +552,7 @@ class AbstractMultiTOXTabDialog_Impl : public AbstractMultiTOXTabDialog protected: std::shared_ptr m_xDlg; public: - explicit AbstractMultiTOXTabDialog_Impl(std::unique_ptr p) + explicit AbstractMultiTOXTabDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -569,7 +569,7 @@ class AbstractEditRegionDlg_Impl : public AbstractEditRegionDlg { std::shared_ptr m_xDlg; public: - explicit AbstractEditRegionDlg_Impl(std::unique_ptr p) + explicit AbstractEditRegionDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -582,7 +582,7 @@ class AbstractInsertSectionTabDialog_Impl : public AbstractInsertSectionTabDialo { std::shared_ptr m_xDlg; public: - explicit AbstractInsertSectionTabDialog_Impl(std::unique_ptr p) + explicit AbstractInsertSectionTabDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -596,7 +596,7 @@ class AbstractIndexMarkFloatDlg_Impl : public AbstractMarkFloatDlg { std::shared_ptr m_xDlg; public: - explicit AbstractIndexMarkFloatDlg_Impl(std::unique_ptr p) + explicit AbstractIndexMarkFloatDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -610,7 +610,7 @@ class AbstractAuthMarkFloatDlg_Impl : public AbstractMarkFloatDlg { std::shared_ptr m_xDlg; public: - explicit AbstractAuthMarkFloatDlg_Impl(std::unique_ptr p) + explicit AbstractAuthMarkFloatDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -625,7 +625,7 @@ class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard std::shared_ptr m_xDlg; public: - explicit AbstractMailMergeWizard_Impl(std::unique_ptr p) + explicit AbstractMailMergeWizard_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx b/sw/source/uibase/inc/swrenamexnameddlg.hxx index 381f9e7a35b2..b4540857e563 100644 --- a/sw/source/uibase/inc/swrenamexnameddlg.hxx +++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx @@ -33,8 +33,8 @@ class SwRenameXNamedDlg : public weld::GenericDialogController TextFilter m_aTextFilter; - std::shared_ptr m_xNewNameED; - std::shared_ptr m_xOk; + std::unique_ptr m_xNewNameED; + std::unique_ptr m_xOk; DECL_LINK(TextFilterHdl, OUString&, bool); DECL_LINK(OkHdl, weld::Button&, void); diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 61ab59bfc00e..186a6d337801 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -1101,7 +1101,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq) if (pPoolBoxItem == &rBoxItem) bDefault = true; - std::shared_ptr aBoxItem(rBoxItem.Clone()); + std::unique_ptr aBoxItem(rBoxItem.Clone()); SvxBorderLine aBorderLine; const SfxPoolItem *pItem = nullptr; @@ -1114,7 +1114,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq) { if (pArgs->GetItemState(RES_BOX, true, &pItem) == SfxItemState::SET) { - std::shared_ptr aNewBox(static_cast(pItem->Clone())); + std::unique_ptr aNewBox(static_cast(pItem->Clone())); const SvxBorderLine* pBorderLine; if ((pBorderLine = aBoxItem->GetTop()) != nullptr) @@ -1142,7 +1142,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq) aNewBox->SetAllDistances(rBoxItem.GetSmallestDistance()); } - aBoxItem = aNewBox; + aBoxItem = std::move(aNewBox); if( aBoxItem->GetTop() != nullptr ) aBoxItem->SetLine(&aBorderLine, SvxBoxItemLine::TOP); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 50ec6815ea0b..0348f461f0e0 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -305,13 +305,13 @@ void ItemSetToTableParam( const SfxItemSet& rSet, rSh.SetBoxBackground( *static_cast(pItem) ); if(pRowItem) { - std::shared_ptr aBrush(static_cast(pRowItem->Clone())); + std::unique_ptr aBrush(static_cast(pRowItem->Clone())); aBrush->SetWhich(RES_BACKGROUND); rSh.SetRowBackground(*aBrush); } if(pTableItem) { - std::shared_ptr aBrush(static_cast(pTableItem->Clone())); + std::unique_ptr aBrush(static_cast(pTableItem->Clone())); aBrush->SetWhich(RES_BACKGROUND); rSh.SetTabBackground( *aBrush ); } diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index ef1341d078bc..2b1735456e94 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -961,7 +961,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) // #108876# a font attribute has to be set always due to a guessed script type if( !aNewFont.GetFamilyName().isEmpty() ) { - std::shared_ptr aNewFontItem(aFont->Clone()); + std::unique_ptr aNewFontItem(aFont->Clone()); aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() ); aNewFontItem->SetFamily( aNewFont.GetFamilyType()); aNewFontItem->SetPitch( aNewFont.GetPitch()); diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index d60fe21f3fb7..e9268bffa23f 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -158,13 +158,13 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) rSh.SetBoxBackground( *static_cast(pItem) ); if(pRowItem) { - std::shared_ptr aBrush(static_cast(pRowItem->Clone())); + std::unique_ptr aBrush(static_cast(pRowItem->Clone())); aBrush->SetWhich(RES_BACKGROUND); rSh.SetRowBackground(*aBrush); } if(pTableItem) { - std::shared_ptr aBrush(static_cast(pTableItem->Clone())); + std::unique_ptr aBrush(static_cast(pTableItem->Clone())); aBrush->SetWhich(RES_BACKGROUND); rSh.SetTabBackground(*aBrush); } @@ -416,8 +416,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP rWrtShell.EndAction(); } -typedef std::shared_ptr< SfxPoolItem > SfxPoolItemSharedPtr; -typedef std::vector< SfxPoolItemSharedPtr > ItemVector; +typedef std::vector< std::unique_ptr< SfxPoolItem > > ItemVector; // collect all PoolItems from the applied styles static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSet ) { @@ -429,7 +428,7 @@ static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyl const SfxPoolItem* pItem; if( SfxItemState::SET == rStyleAttrSet.GetItemState( nWhich, false, &pItem ) ) { - rItemVector.push_back( SfxPoolItemSharedPtr( pItem->Clone() ) ); + rItemVector.emplace_back( pItem->Clone() ); } } pRanges += 2; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 6b7dee96379b..7be532cd29b4 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -763,7 +763,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if ( i >= rTabStops.Count() ) { // No DefTab - std::shared_ptr aTabStops(rTabStops.Clone()); + std::unique_ptr aTabStops(rTabStops.Clone()); ::lcl_EraseDefTabs(*aTabStops); -- cgit /macosx10.5/master'>ports/macosx10.5/master LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-08-02 12:14:49 +0000
committerKurt Zenker <kz@openoffice.org>2004-08-02 12:14:49 +0000
commitb886decb4559e5e5189ac28889b7d85f31ac98cb (patch)
tree1bbb83cb1b499efc81251893ec7d370e06f7db2f /framework/inc/services.h
parent755663e2de23c8e89c892050d6a9154e0966f368 (diff)
INTEGRATION: CWS os35 (1.21.12); FILE MERGED
2004/07/15 15:31:03 dr 1.21.12.2: RESYNC: (1.21-1.22); FILE MERGED 2004/07/12 16:15:05 cd 1.21.12.1: #i31348# New popup menu controller for recent file list
Diffstat (limited to 'framework/inc/services.h')
-rw-r--r--framework/inc/services.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 9891413faca9..9b6f338e0dcf 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -2,9 +2,9 @@
*
* $RCSfile: services.h,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: obo $ $Date: 2004-07-06 18:01:36 $
+ * last change: $Author: kz $ $Date: 2004-08-02 13:14:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -191,7 +191,7 @@ namespace framework{
#define IMPLEMENTATIONNAME_TOOLBARSMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.ToolBarsMenuController" )
#define IMPLEMENTATIONNAME_TOOLBARCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.ToolBarControllerFactory" )
#define IMPLEMENTATIONNAME_LICENSE DECLARE_ASCII("com.sun.star.comp.framework.License" )
-
+#define IMPLEMENTATIONNAME_RECENTFILESMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.RecentFilesMenuController" )
} // namespace framework
#endif // #ifndef __FRAMEWORK_SERVICES_H_