From a02d059d3ef03246c226fa9fc499920f7bd4ffc8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 28 Apr 2020 08:47:25 +0200 Subject: loplugin:makeshared in cui Change-Id: I018df0fc3ee6e07d48d9f30544e7aa8492a6ade0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92997 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/dialogs/hltpbase.cxx | 2 +- cui/source/factory/dlgfact.cxx | 32 ++++++++++++++++---------------- cui/source/factory/dlgfact.hxx | 18 +++++++++--------- 3 files changed, 26 insertions(+), 26 deletions(-) (limited to 'cui') diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 6182adfd951f..b3c7b076f1ca 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -181,7 +181,7 @@ void SvxHyperlinkTabPageBase::ShowMarkWnd() weld::Dialog* pDialog = mpDialog->getDialog(); - mxMarkWnd = std::make_unique(pDialog, this); + mxMarkWnd = std::make_shared(pDialog, this); // Size of dialog-window in screen pixels Point aDlgPos(pDialog->get_position()); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index e7282b3c197a..b4d16c5a92d5 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1045,14 +1045,14 @@ VclPtr AbstractDialogFactory_Impl::CreateFrameDialog(weld::Wi // TabDialog outside the drawing layer VclPtr AbstractDialogFactory_Impl::CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) { - return VclPtr::Create(std::make_unique(pParent, pAttrSet)); + return VclPtr::Create(std::make_shared(pParent, pAttrSet)); } VclPtr AbstractDialogFactory_Impl::CreateCustomizeTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet, const Reference< frame::XFrame >& xViewFrame ) { - std::unique_ptr xDlg1(new SvxConfigDialog(pParent, pAttrSet)); + auto xDlg1 = std::make_shared(pParent, pAttrSet); xDlg1->SetFrame(xViewFrame); return VclPtr::Create(std::move(xDlg1)); } @@ -1062,7 +1062,7 @@ VclPtr AbstractDialogFactory_Impl::CreateTextTabDialog(wel const SfxItemSet* pAttrSet, SdrView* pView) { - return VclPtr::Create(std::make_unique(pParent, pAttrSet, pView)); + return VclPtr::Create(std::make_shared(pParent, pAttrSet, pView)); } // TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog @@ -1070,7 +1070,7 @@ VclPtr AbstractDialogFactory_Impl::CreateCaptionDialog const SdrView* pView, SvxAnchorIds nAnchorTypes) { - return VclPtr::Create(std::make_unique(pParent, pView, nAnchorTypes)); + return VclPtr::Create(std::make_shared(pParent, pView, nAnchorTypes)); } VclPtr AbstractDialogFactory_Impl::CreateSvxDistributeDialog(weld::Window* pParent, @@ -1088,7 +1088,7 @@ VclPtr AbstractDialogFactory_Impl::CreateThesaurusDialo css::uno::Reference xThesaurus, const OUString &rWord, LanguageType nLanguage) { - return VclPtr::Create(std::make_unique(pParent, xThesaurus, rWord, nLanguage)); + return VclPtr::Create(std::make_shared(pParent, xThesaurus, rWord, nLanguage)); } VclPtr AbstractDialogFactory_Impl::CreateHyphenWordDialog(weld::Window* pParent, @@ -1114,7 +1114,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxSpellDialog( SfxBindings* pBindings, svx::SpellDialogChildWindow* pSpellChildWindow) { - return VclPtr::Create(std::make_unique(pSpellChildWindow, pParent, pBindings)); + return VclPtr::Create(std::make_shared(pSpellChildWindow, pParent, pBindings)); } VclPtr AbstractDialogFactory_Impl::CreateActualizeProgressDialog(weld::Widget* pParent, @@ -1166,7 +1166,7 @@ VclPtr AbstractDialogFactory_Impl::CreateGalleryThemeProperti ExchangeData* pData, SfxItemSet* pItemSet) { - return VclPtr::Create(std::make_unique( + return VclPtr::Create(std::make_shared( pParent, pData, pItemSet)); } @@ -1183,7 +1183,7 @@ VclPtr AbstractDialogFactory_Impl::CreateURLDialog(weld::Widget* VclPtr AbstractDialogFactory_Impl::CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) { - return VclPtr::Create(std::make_unique( + return VclPtr::Create(std::make_shared( pParent, rSet)); } @@ -1208,7 +1208,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxBorderBackgrou const SfxItemSet& rCoreSet, bool bEnableDrawingLayerFillStyles) { - return VclPtr::Create(std::make_unique( + return VclPtr::Create(std::make_shared( pParent, rCoreSet, /*bEnableSelector*/true, @@ -1220,7 +1220,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxTrans const SdrView* pView, SvxAnchorIds nAnchorTypes) { - return VclPtr::Create(new SvxTransformTabDialog(pParent, pAttr,pView, nAnchorTypes)); + return VclPtr::Create(std::make_shared(pParent, pAttr,pView, nAnchorTypes)); } VclPtr AbstractDialogFactory_Impl::CreateSchTransformTabDialog(weld::Window* pParent, @@ -1228,7 +1228,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSchTransformTabDi const SdrView* pSdrView, bool bSizeTabPage) { - auto pDlg = std::make_unique(pParent, pAttr, pSdrView, + auto pDlg = std::make_shared(pParent, pAttr, pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize); pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" ); pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" ); @@ -1285,7 +1285,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxPathSele VclPtr AbstractDialogFactory_Impl::CreateSvxHpLinkDlg(SfxChildWindow* pChild, SfxBindings* pBindings, weld::Window* pParent) { - return VclPtr::Create(std::make_unique(pBindings, pChild, pParent)); + return VclPtr::Create(std::make_shared(pBindings, pChild, pParent)); } VclPtr AbstractDialogFactory_Impl::CreateFmSearchDialog(weld::Window* pParent, @@ -1340,7 +1340,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxAreaTabDia SdrModel* pModel, bool bShadow) { - return VclPtr::Create(std::make_unique(pParent, pAttr, pModel, bShadow)); + return VclPtr::Create(std::make_shared(pParent, pAttr, pModel, bShadow)); } VclPtr AbstractDialogFactory_Impl::CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog @@ -1348,7 +1348,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxLineTabDialog( const SdrObject* pObj , bool bHasObj) { - return VclPtr::Create(std::make_unique(pParent, pAttr, pModel, pObj,bHasObj)); + return VclPtr::Create(std::make_shared(pParent, pAttr, pModel, pObj,bHasObj)); } VclPtr AbstractDialogFactory_Impl::CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, @@ -1607,7 +1607,7 @@ VclPtr AbstractDialogFactory_Impl::CreateEditObjectDialog(wel VclPtr AbstractDialogFactory_Impl::CreatePasteDialog(weld::Window* pParent) { - return VclPtr::Create(std::make_unique(pParent)); + return VclPtr::Create(std::make_shared(pParent)); } VclPtr AbstractDialogFactory_Impl::CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML, sfx2::SvBaseLink* p) @@ -1620,7 +1620,7 @@ VclPtr AbstractDialogFactory_Impl::CreateLinksDialog(wel VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) { - return VclPtr::Create(std::make_unique(pParent, pAttr, rModel)); + return VclPtr::Create(std::make_shared(pParent, pAttr, rModel)); } VclPtr AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 5ddcce87f0db..38de7db093fc 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -143,7 +143,7 @@ class CuiAbstractTabController_Impl : public SfxAbstractTabDialog { std::shared_ptr m_xDlg; public: - explicit CuiAbstractTabController_Impl(std::unique_ptr p) + explicit CuiAbstractTabController_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -219,7 +219,7 @@ class AbstractThesaurusDialog_Impl : public AbstractThesaurusDialog { std::shared_ptr m_xDlg; public: - explicit AbstractThesaurusDialog_Impl(std::unique_ptr p) + explicit AbstractThesaurusDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -272,7 +272,7 @@ class AbstractSpellDialog_Impl : public AbstractSpellDialog { std::shared_ptr m_xDlg; public: - explicit AbstractSpellDialog_Impl(std::unique_ptr p) + explicit AbstractSpellDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -377,8 +377,8 @@ class AbstractSvxTransformTabDialog_Impl : public AbstractSvxTransformTabDialog { std::shared_ptr m_xDlg; public: - explicit AbstractSvxTransformTabDialog_Impl(SvxTransformTabDialog* p) - : m_xDlg(p) + explicit AbstractSvxTransformTabDialog_Impl(std::shared_ptr p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; @@ -395,7 +395,7 @@ class AbstractSvxCaptionDialog_Impl : public AbstractSvxCaptionDialog { std::shared_ptr m_xDlg; public: - explicit AbstractSvxCaptionDialog_Impl(std::unique_ptr p) + explicit AbstractSvxCaptionDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -529,7 +529,7 @@ class AbstractSvxHpLinkDlg_Impl : public AbstractSvxHpLinkDlg protected: std::shared_ptr m_xDlg; public: - explicit AbstractSvxHpLinkDlg_Impl(std::unique_ptr p) + explicit AbstractSvxHpLinkDlg_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -571,7 +571,7 @@ class AbstractSvxAreaTabDialog_Impl : public AbstractSvxAreaTabDialog { std::shared_ptr m_xDlg; public: - explicit AbstractSvxAreaTabDialog_Impl(std::unique_ptr p) + explicit AbstractSvxAreaTabDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } @@ -602,7 +602,7 @@ class AbstractPasteDialog_Impl : public SfxAbstractPasteDialog { std::shared_ptr m_xDlg; public: - explicit AbstractPasteDialog_Impl(std::unique_ptr p) + explicit AbstractPasteDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } -- cgit