chart2/source/controller/main/ChartController_Position.cxx | 2 chart2/source/controller/main/ChartController_TextEdit.cxx | 2 chart2/source/controller/main/ShapeController.cxx | 14 +- cui/source/dialogs/cuifmsearch.cxx | 25 ++-- cui/source/options/optcolor.cxx | 2 cui/source/options/optlingu.cxx | 2 cui/source/options/optpath.cxx | 2 cui/source/options/tsaurls.cxx | 2 cui/source/tabpages/tpbitmap.cxx | 6 - cui/source/tabpages/tpcolor.cxx | 4 cui/source/tabpages/tpgradnt.cxx | 6 - cui/source/tabpages/tphatch.cxx | 6 - cui/source/tabpages/tplnedef.cxx | 6 - cui/source/tabpages/tplneend.cxx | 4 cui/source/tabpages/tppattern.cxx | 6 - dbaccess/source/ui/app/AppController.cxx | 2 editeng/source/editeng/impedit4.cxx | 2 editeng/source/misc/splwrap.cxx | 2 include/editeng/edtdlg.hxx | 8 + include/sfx2/sfxdlg.hxx | 14 ++ include/svx/svxdlg.hxx | 58 ++++++++++ include/vcl/abstdlg.hxx | 15 ++ include/vcl/vclreferencebase.hxx | 2 reportdesign/source/ui/misc/UITools.cxx | 2 reportdesign/source/ui/report/ReportController.cxx | 2 sc/inc/scabstdlg.hxx | 69 ++++++++++++- sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 2 sc/source/ui/dbgui/PivotLayoutTreeListData.cxx | 2 sc/source/ui/docshell/docsh4.cxx | 10 - sc/source/ui/drawfunc/drawsh.cxx | 12 +- sc/source/ui/drawfunc/drawsh5.cxx | 4 sc/source/ui/drawfunc/drtxtob.cxx | 4 sc/source/ui/drawfunc/drtxtob1.cxx | 6 - sc/source/ui/drawfunc/fuins2.cxx | 2 sc/source/ui/pagedlg/tphf.cxx | 2 sc/source/ui/pagedlg/tphfedit.cxx | 2 sc/source/ui/unoobj/filtuno.cxx | 6 - sc/source/ui/view/cellsh1.cxx | 36 +++--- sc/source/ui/view/cellsh2.cxx | 10 - sc/source/ui/view/cellsh3.cxx | 12 +- sc/source/ui/view/editsh.cxx | 10 - sc/source/ui/view/formatsh.cxx | 4 sc/source/ui/view/gridwin2.cxx | 5 sc/source/ui/view/pivotsh.cxx | 2 sc/source/ui/view/prevwsh.cxx | 2 sc/source/ui/view/tabvwsh3.cxx | 8 - sc/source/ui/view/tabvwsha.cxx | 4 sc/source/ui/view/tabvwshf.cxx | 10 - sc/source/ui/view/viewfun5.cxx | 4 sc/source/ui/view/viewutil.cxx | 2 sd/inc/sdabstdlg.hxx | 26 ++++ sd/source/filter/html/HtmlOptionsDialog.cxx | 2 sd/source/ui/func/fuarea.cxx | 2 sd/source/ui/func/fubullet.cxx | 2 sd/source/ui/func/fuchar.cxx | 2 sd/source/ui/func/fuconnct.cxx | 2 sd/source/ui/func/fucopy.cxx | 4 sd/source/ui/func/fucushow.cxx | 4 sd/source/ui/func/fuinsert.cxx | 4 sd/source/ui/func/fuinsfil.cxx | 4 sd/source/ui/func/fuline.cxx | 2 sd/source/ui/func/fulinend.cxx | 2 sd/source/ui/func/fulink.cxx | 2 sd/source/ui/func/fumeasur.cxx | 2 sd/source/ui/func/fumorph.cxx | 2 sd/source/ui/func/fuoaprms.cxx | 2 sd/source/ui/func/fuolbull.cxx | 2 sd/source/ui/func/fupage.cxx | 2 sd/source/ui/func/fuparagr.cxx | 2 sd/source/ui/func/fuprlout.cxx | 2 sd/source/ui/func/fuprobjs.cxx | 2 sd/source/ui/func/fuscale.cxx | 11 -- sd/source/ui/func/fusldlg.cxx | 2 sd/source/ui/func/fusnapln.cxx | 4 sd/source/ui/func/futempl.cxx | 8 - sd/source/ui/func/futransf.cxx | 4 sd/source/ui/func/futxtatt.cxx | 2 sd/source/ui/func/fuvect.cxx | 2 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 4 sd/source/ui/table/tablefunction.cxx | 2 sd/source/ui/table/tableobjectbar.cxx | 4 sd/source/ui/view/drviews2.cxx | 16 +-- sd/source/ui/view/drviews3.cxx | 4 sd/source/ui/view/outlnvs2.cxx | 2 sd/source/ui/view/sdview2.cxx | 7 - sfx2/source/appl/app.cxx | 2 sfx2/source/appl/appserv.cxx | 6 - starmath/source/view.cxx | 3 svx/source/dialog/databaseregistrationui.cxx | 4 svx/source/dialog/grfflt.cxx | 12 +- svx/source/dialog/hdft.cxx | 2 svx/source/dialog/imapwnd.cxx | 4 svx/source/dialog/srchdlg.cxx | 6 - svx/source/fmcomp/fmgridcl.cxx | 2 svx/source/form/fmshell.cxx | 2 svx/source/form/fmshimp.cxx | 6 - svx/source/gallery2/galbrws1.cxx | 6 - svx/source/gallery2/galbrws2.cxx | 2 svx/source/svdraw/svdedtv2.cxx | 2 svx/source/table/tablecontroller.cxx | 4 sw/inc/swabstdlg.hxx | 60 ++++++++++- sw/source/ui/dbui/dbinsdlg.cxx | 4 sw/source/ui/envelp/envfmt.cxx | 2 sw/source/ui/fldui/fldedt.cxx | 2 sw/source/ui/misc/bookmark.cxx | 2 sw/source/ui/misc/glossary.cxx | 4 sw/source/ui/misc/insfnote.cxx | 2 sw/source/ui/misc/srtdlg.cxx | 2 sw/source/ui/table/convert.cxx | 2 sw/source/ui/table/instable.cxx | 2 sw/source/uibase/app/appenv.cxx | 4 sw/source/uibase/app/applab.cxx | 2 sw/source/uibase/app/docsh2.cxx | 2 sw/source/uibase/app/docst.cxx | 2 sw/source/uibase/dbui/dbmgr.cxx | 2 sw/source/uibase/dialog/regionsw.cxx | 6 - sw/source/uibase/dochdl/gloshdl.cxx | 8 - sw/source/uibase/dochdl/swdtflvr.cxx | 2 sw/source/uibase/docvw/PostItMgr.cxx | 4 sw/source/uibase/misc/redlndlg.cxx | 4 sw/source/uibase/shells/annotsh.cxx | 8 - sw/source/uibase/shells/basesh.cxx | 20 +-- sw/source/uibase/shells/drawdlg.cxx | 6 - sw/source/uibase/shells/drwbassh.cxx | 12 +- sw/source/uibase/shells/drwtxtex.cxx | 4 sw/source/uibase/shells/drwtxtsh.cxx | 4 sw/source/uibase/shells/frmsh.cxx | 6 - sw/source/uibase/shells/grfsh.cxx | 2 sw/source/uibase/shells/tabsh.cxx | 16 +-- sw/source/uibase/shells/textfld.cxx | 10 - sw/source/uibase/shells/textidx.cxx | 2 sw/source/uibase/shells/textsh.cxx | 2 sw/source/uibase/shells/textsh1.cxx | 14 +- sw/source/uibase/shells/textsh2.cxx | 2 sw/source/uibase/shells/txtattr.cxx | 4 sw/source/uibase/shells/txtnum.cxx | 2 sw/source/uibase/uiview/pview.cxx | 4 sw/source/uibase/uiview/view0.cxx | 4 sw/source/uibase/uiview/view2.cxx | 6 - sw/source/uibase/uiview/viewling.cxx | 4 sw/source/uibase/uno/SwXFilterOptions.cxx | 2 sw/source/uibase/utlui/content.cxx | 2 sw/source/uibase/utlui/glbltree.cxx | 2 sw/source/uibase/utlui/numfmtlb.cxx | 2 sw/source/uibase/wrtsh/wrtsh1.cxx | 2 sw/source/uibase/wrtsh/wrtsh2.cxx | 8 - uui/source/iahndl-authentication.cxx | 2 vcl/source/window/layout.cxx | 2 148 files changed, 565 insertions(+), 342 deletions(-)
New commits: commit 117fc49c979d65e5479635eab3ce10d74d076679 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Oct 27 20:55:49 2016 +0100 ScopedVclPtr vs std::unique_ptr for VclAbstractDialog derivatives Change-Id: I5e43312b6f42ce0c63946f366eaf1e6dcb9629b2 Reviewed-on: https://gerrit.libreoffice.org/30344 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 690cedc..b470348 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -140,7 +140,7 @@ void ChartController::executeDispatch_PositionAndSize() SolarMutexGuard aGuard; SvxAbstractDialogFactory * pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE( pFact, "No dialog factory" ); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSchTransformTabDialog( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSchTransformTabDialog( m_pChartWindow, &aItemSet, pSdrView, bResizePossible )); OSL_ENSURE( pDlg, "Couldn't create SchTransformTabDialog" ); diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index 37b57dd..49dd8a8 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -169,7 +169,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter() vcl::Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont(); aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) ); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( m_pChartWindow, aSet, getFrame(), RID_SVXDLG_CHARMAP )); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( m_pChartWindow, aSet, getFrame(), RID_SVXDLG_CHARMAP )); OSL_ENSURE( pDlg, "Couldn't create SvxCharacterMap dialog" ); if( pDlg->Execute() == RET_OK ) { diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index de1d92b..8c68892 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -260,7 +260,7 @@ void ShapeController::executeDispatch_FormatLine() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateSvxLineTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(), pSelectedObj, bHasMarked ) ); if ( pDlg->Execute() == RET_OK ) @@ -299,7 +299,7 @@ void ShapeController::executeDispatch_FormatArea() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< AbstractSvxAreaTabDialog > pDlg( + ScopedVclPtr< AbstractSvxAreaTabDialog > pDlg( pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(), true ) ); if ( pDlg.get() ) { @@ -341,7 +341,7 @@ void ShapeController::executeDispatch_TextAttributes() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateTextTabDialog( pParent, &aAttr, pDrawViewWrapper ) ); if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) { @@ -380,7 +380,7 @@ void ShapeController::executeDispatch_TransformDialog() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateCaptionDialog( pParent, pDrawViewWrapper ) ); if ( pDlg.get() ) { @@ -404,7 +404,7 @@ void ShapeController::executeDispatch_TransformDialog() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateSvxTransformTabDialog( pParent, &aGeoAttr, pDrawViewWrapper ) ); if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) { @@ -433,7 +433,7 @@ void ShapeController::executeDispatch_ObjectTitleDescription() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< AbstractSvxObjectTitleDescDialog > pDlg( + ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg( pFact->CreateSvxObjectTitleDescDialog( aTitle, aDescription ) ); if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) { @@ -463,7 +463,7 @@ void ShapeController::executeDispatch_RenameObject() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< AbstractSvxObjectNameDialog > pDlg( + ScopedVclPtr< AbstractSvxObjectNameDialog > pDlg( pFact->CreateSvxObjectNameDialog( aName ) ); pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) ); if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index a31aed0..e21e81e 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -356,20 +356,19 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton, void ) { if (m_ppbApproxSettings == pButton) { - std::unique_ptr<AbstractSvxSearchSimilarityDialog> pDlg; - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if ( pFact ) - pDlg.reset(pFact->CreateSvxSearchSimilarityDialog( this, m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), - m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); - DBG_ASSERT( pDlg, "FmSearchDialog, OnClickedSpecialSettings: could not load the dialog!" ); - - if ( pDlg && pDlg->Execute() == RET_OK ) + if (pFact) { - m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); - m_pSearchEngine->SetLevOther( pDlg->GetOther() ); - m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); - m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); + ScopedVclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( this, m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), + m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); + DBG_ASSERT( pDlg, "FmSearchDialog, OnClickedSpecialSettings: could not load the dialog!" ); + if (pDlg && pDlg->Execute() == RET_OK) + { + m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); + m_pSearchEngine->SetLevOther( pDlg->GetOther() ); + m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); + m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); + } } } else if (m_pSoundsLikeCJKSettings == pButton) @@ -378,7 +377,7 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet, m_pSearchEngine->GetTransliterationFlags() )); + ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet, m_pSearchEngine->GetTransliterationFlags() )); DBG_ASSERT(aDlg, "Dialog creation failed!"); aDlg->Execute(); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index cda0df9..43f76b4 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -1179,7 +1179,7 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( pButton, + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( pButton, sName, CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2) )); DBG_ASSERT(aNameDlg, "Dialog creation failed!"); aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl)); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 1172777..5990721 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1552,7 +1552,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog( this )); + ScopedVclPtr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog( this )); DBG_ASSERT(aDlg, "Dialog creation failed!"); uno::Reference< XDictionary > xNewDic; if ( aDlg->Execute() == RET_OK ) diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index f351151..7c624a7 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -566,7 +566,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr<AbstractSvxMultiPathDialog> pMultiDlg( + ScopedVclPtr<AbstractSvxMultiPathDialog> pMultiDlg( pFact->CreateSvxMultiPathDialog( this )); DBG_ASSERT( pMultiDlg, "Dialog creation failed!" ); diff --git a/cui/source/options/tsaurls.cxx b/cui/source/options/tsaurls.cxx index 505b8f6..fa678c7 100644 --- a/cui/source/options/tsaurls.cxx +++ b/cui/source/options/tsaurls.cxx @@ -98,7 +98,7 @@ IMPL_LINK_NOARG(TSAURLsDialog, AddHdl_Impl, Button*, void) OUString aDesc( get<FixedText>("enteraurl")->GetText() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( m_pAddBtn, aURL, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( m_pAddBtn, aURL, aDesc)); if ( pDlg->Execute() == RET_OK ) { diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 19b5db0..ec7b6d5 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -545,7 +545,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); bool bLoop = true; @@ -763,7 +763,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) INetURLObject aURL( aDlg.GetPath() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aURL.GetName().getToken( 0, '.' ), aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aURL.GetName().getToken( 0, '.' ), aDesc )); DBG_ASSERT(pDlg, "Dialog creation failed!"); nError = 1; @@ -793,7 +793,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) break; } - pDlg.reset(); + pDlg.disposeAndClear(); pWarnBox.disposeAndClear(); if( !nError ) diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index aa16ce6..88a7e17 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -376,7 +376,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); ScopedVclPtr<MessageDialog> pWarnBox; sal_uInt16 nError = 1; @@ -402,7 +402,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void) break; } - pDlg.reset(); + pDlg.disposeAndClear(); pWarnBox.disposeAndClear(); if (!nError) diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 503e94a..e28e177 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -398,7 +398,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); ScopedVclPtr<MessageDialog> pWarnBox; sal_uInt16 nError = 1; @@ -424,7 +424,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) if( pWarnBox->Execute() != RET_OK ) break; } - pDlg.reset(); + pDlg.disposeAndClear(); pWarnBox.disposeAndClear(); if( !nError ) @@ -529,7 +529,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); bool bLoop = true; diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 7469d15..1f4fa52 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -476,7 +476,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); ScopedVclPtr<MessageDialog> pWarnBox; sal_uInt16 nError = 1; @@ -502,7 +502,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) if( pWarnBox->Execute() != RET_OK ) break; } - pDlg.reset(); + pDlg.disposeAndClear(); pWarnBox.disposeAndClear(); if( !nError ) @@ -597,7 +597,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); bool bLoop = true; diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index f9949a3..984a1c6 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -554,7 +554,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); DBG_ASSERT(pDlg, "Dialog creation failed!"); bool bLoop = true; @@ -601,7 +601,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, Button*, void) aBox->Execute(); } } - pDlg.reset(); + pDlg.disposeAndClear(); // determine button state if ( pDashList->Count() ) @@ -626,7 +626,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); DBG_ASSERT(pDlg, "Dialog creation failed!"); long nCount = pDashList->Count(); diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 15a1ed4..9c5741a 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -332,7 +332,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); DBG_ASSERT(pDlg, "Dialog creation failed!"); bool bLoop = true; @@ -439,7 +439,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); DBG_ASSERT(pDlg, "Dialog creation failed!"); bool bLoop = true; diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 2ae6dfd79..253b198 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -422,7 +422,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); ScopedVclPtr<MessageDialog> pWarnBox; sal_uInt16 nError(1); @@ -449,7 +449,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) break; } - pDlg.reset(); + pDlg.disposeAndClear(); pWarnBox.disposeAndClear(); if( !nError ) @@ -539,7 +539,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); assert(pDlg && "Dialog creation failed!"); bool bLoop = true; diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 7b134ef..3c6860d 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1052,7 +1052,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa if ( !aArgs.getLength() ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ::std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( getView() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( getView() )); ::std::vector<SotClipboardFormatId> aFormatIds; getSupportedFormats(getContainer()->getElementType(),aFormatIds); const ::std::vector<SotClipboardFormatId>::const_iterator aEnd = aFormatIds.end(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index e98c5ad..7e6bc3ad 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2490,7 +2490,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView ) return EE_SPELL_ERRORFOUND; EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create(); - std::unique_ptr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) )); + ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) )); if (xDlg->Execute() == RET_OK) { // Replace Word... diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index 35c68be..ba8dbf1 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -293,7 +293,7 @@ void SvxSpellWrapper::SpellDocument( ) if (xHyphWord.is()) { EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create(); - std::unique_ptr<AbstractHyphenWordDialog> pDlg(pFact->CreateHyphenWordDialog( pWin, + ScopedVclPtr<AbstractHyphenWordDialog> pDlg(pFact->CreateHyphenWordDialog( pWin, xHyphWord->getWord(), LanguageTag( xHyphWord->getLocale() ).getLanguageType(), xHyph, this )); diff --git a/include/editeng/edtdlg.hxx b/include/editeng/edtdlg.hxx index c4be9fe..e8f5521 100644 --- a/include/editeng/edtdlg.hxx +++ b/include/editeng/edtdlg.hxx @@ -40,19 +40,25 @@ class CheckBox; class AbstractThesaurusDialog : public VclAbstractDialog { +protected: + virtual ~AbstractThesaurusDialog() override = default; public: virtual OUString GetWord() = 0; }; class AbstractHyphenWordDialog : public VclAbstractDialog { +protected: + virtual ~AbstractHyphenWordDialog() override = default; public: virtual vcl::Window* GetWindow() = 0; }; class AbstractHangulHanjaConversionDialog : public VclAbstractTerminatedDialog { - public: +protected: + virtual ~AbstractHangulHanjaConversionDialog() override = default; +public: virtual void EnableRubySupport( bool _bVal ) = 0; virtual void SetByCharacter( bool _bByCharacter ) = 0; virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) = 0; diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index 6b80bf8..f14f9b3 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -58,6 +58,8 @@ namespace com { namespace sun { namespace star { namespace frame { class SfxAbstractDialog : virtual public VclAbstractDialog { +protected: + virtual ~SfxAbstractDialog() override = default; public: /** Get a set of items changed in the dialog. */ @@ -68,6 +70,8 @@ public: class SfxAbstractTabDialog : virtual public SfxAbstractDialog { +protected: + virtual ~SfxAbstractTabDialog() override = default; public: virtual void SetCurPageId( sal_uInt16 nId ) = 0; virtual void SetCurPageId( const OString &rName ) = 0; @@ -77,12 +81,16 @@ public: class SfxAbstractApplyTabDialog : virtual public SfxAbstractTabDialog { +protected: + virtual ~SfxAbstractApplyTabDialog() override = default; public: virtual void SetApplyHdl( const Link<LinkParamNone*,void>& rLink ) = 0; }; class SfxAbstractInsertObjectDialog : virtual public VclAbstractDialog { +protected: + virtual ~SfxAbstractInsertObjectDialog() override = default; public: virtual css::uno::Reference < css::embed::XEmbeddedObject > GetObject()=0; virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType )=0; @@ -91,6 +99,8 @@ public: class SfxAbstractPasteDialog : virtual public VclAbstractDialog { +protected: + virtual ~SfxAbstractPasteDialog() override = default; public: virtual void Insert( SotClipboardFormatId nFormat, const rtl::OUString & rFormatName ) = 0; virtual void SetObjName( const SvGlobalName & rClass, const rtl::OUString & rObjName ) = 0; @@ -99,10 +109,14 @@ public: class SfxAbstractLinksDialog : virtual public VclAbstractDialog { +protected: + virtual ~SfxAbstractLinksDialog() override = default; }; class AbstractScriptSelectorDialog : virtual public VclAbstractDialog { +protected: + virtual ~AbstractScriptSelectorDialog() override = default; public: virtual rtl::OUString GetScriptURL() const = 0; virtual void SetRunLabel() = 0; diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index fcbbc43..ebeedc3 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -64,6 +64,8 @@ namespace svx{ class SpellDialogChildWindow;} class AbstractSvxDistributeDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxDistributeDialog() override = default; public: virtual SvxDistributeHorizontal GetDistributeHor() const = 0; virtual SvxDistributeVertical GetDistributeVer() const = 0; @@ -71,12 +73,16 @@ public: class AbstractFmShowColsDialog : public VclAbstractDialog { +protected: + virtual ~AbstractFmShowColsDialog() override = default; public: virtual void SetColumns(const css::uno::Reference< css::container::XIndexContainer>& xCols)= 0; }; class AbstractSvxZoomDialog : public VclAbstractDialog { +protected: + virtual ~AbstractSvxZoomDialog() override = default; public: virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) = 0; virtual void HideButton( ZoomButtonId nBtnId )= 0; @@ -85,6 +91,8 @@ public: class AbstractSpellDialog : public VclAbstractDialog { +protected: + virtual ~AbstractSpellDialog() override = default; public: virtual void Invalidate() = 0; virtual vcl::Window* GetWindow() = 0; @@ -95,26 +103,36 @@ typedef sal_IntPtr (*PLinkStub)( void*, void* ); class AbstractSearchProgress :public VclAbstractRefreshableDialog { +protected: + virtual ~AbstractSearchProgress() override = default; }; class AbstractTakeProgress :public VclAbstractRefreshableDialog { +protected: + virtual ~AbstractTakeProgress() override = default; }; class AbstractTitleDialog :public VclAbstractDialog { +protected: + virtual ~AbstractTitleDialog() override = default; public: virtual OUString GetTitle() const =0; }; class AbstractGalleryIdDialog :public VclAbstractDialog { +protected: + virtual ~AbstractGalleryIdDialog() override = default; public: virtual sal_uIntPtr GetId() const =0; }; class AbstractURLDlg :public VclAbstractDialog { +protected: + virtual ~AbstractURLDlg() override = default; public: virtual OUString GetURL() const = 0; virtual OUString GetAltText() const = 0; @@ -125,10 +143,14 @@ public: class AbstractSvxHlinkDlgMarkWnd :public VclAbstractDialog { +protected: + virtual ~AbstractSvxHlinkDlgMarkWnd() override = default; }; class AbstractSvxSearchSimilarityDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxSearchSimilarityDialog() override = default; public: virtual sal_uInt16 GetOther() =0 ; virtual sal_uInt16 GetShorter() =0 ; @@ -138,12 +160,16 @@ public: class AbstractSvxJSearchOptionsDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxJSearchOptionsDialog() override = default; public: virtual sal_Int32 GetTransliterationFlags() const = 0; }; class AbstractFmInputRecordNoDialog :public VclAbstractDialog { +protected: + virtual ~AbstractFmInputRecordNoDialog() override = default; public: virtual void SetValue(long dNew) = 0; virtual long GetValue() const = 0; @@ -151,12 +177,16 @@ public: class AbstractSvxNewDictionaryDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxNewDictionaryDialog() override = default; public: virtual css::uno::Reference< css::linguistic2::XDictionary > GetNewDictionary() = 0; }; class AbstractSvxNameDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxNameDialog() override = default; public: virtual void GetName( OUString& rName ) = 0; virtual void SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately = false ) = 0; @@ -168,6 +198,8 @@ public: class AbstractSvxObjectNameDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxObjectNameDialog() override = default; public: virtual void GetName(OUString& rName) = 0; virtual void SetCheckNameHdl(const Link<AbstractSvxObjectNameDialog&,bool>& rLink) = 0; @@ -175,6 +207,8 @@ public: class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxObjectTitleDescDialog() override = default; public: virtual void GetTitle(OUString& rTitle) = 0; virtual void GetDescription(OUString& rDescription) = 0; @@ -182,10 +216,14 @@ public: class AbstractSvxMessDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxMessDialog() override = default; }; class AbstractSvxMultiPathDialog : public VclAbstractDialog { +protected: + virtual ~AbstractSvxMultiPathDialog() override = default; public: virtual OUString GetPath() const = 0; virtual void SetPath( const OUString& rPath ) = 0; @@ -194,6 +232,8 @@ public: class AbstractSvxHpLinkDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSvxHpLinkDlg() override = default; public: virtual vcl::Window* GetWindow() = 0; virtual bool QueryClose() = 0; @@ -202,6 +242,8 @@ public: struct FmFoundRecordInformation; class AbstractFmSearchDialog :public VclAbstractDialog { +protected: + virtual ~AbstractFmSearchDialog() override = default; public: virtual void SetFoundHandler(const Link<FmFoundRecordInformation&,void>& lnk) = 0; virtual void SetCanceledNotFoundHdl(const Link<FmFoundRecordInformation&,void>& lnk)=0; @@ -210,29 +252,39 @@ public: class AbstractGraphicFilterDialog :public VclAbstractDialog { +protected: + virtual ~AbstractGraphicFilterDialog() override = default; public: virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0; }; class AbstractSvxAreaTabDialog :public SfxAbstractTabDialog { +protected: + virtual ~AbstractSvxAreaTabDialog() override = default; }; struct SvxSwFrameValidation; class AbstractSvxTransformTabDialog : public SfxAbstractTabDialog { +protected: + virtual ~AbstractSvxTransformTabDialog() override = default; public: virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) = 0; }; class AbstractSvxCaptionDialog : public SfxAbstractTabDialog { +protected: + virtual ~AbstractSvxCaptionDialog() override = default; public: virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) = 0; }; class AbstractSvxPostItDialog :public VclAbstractDialog { +protected: + virtual ~AbstractSvxPostItDialog() override = default; public: virtual void SetText( const OUString& rStr ) = 0; //From class Window virtual const SfxItemSet* GetOutputItemSet() const = 0; @@ -249,6 +301,8 @@ public: class SvxAbstractSplittTableDialog : public VclAbstractDialog { +protected: + virtual ~SvxAbstractSplittTableDialog() override = default; public: virtual bool IsHorizontal() const = 0; virtual bool IsProportional() const = 0; @@ -257,6 +311,8 @@ public: class SvxAbstractNewTableDialog : public VclAbstractDialog { +protected: + virtual ~SvxAbstractNewTableDialog() override = default; public: virtual sal_Int32 getRows() const = 0; virtual sal_Int32 getColumns() const = 0; @@ -264,6 +320,8 @@ public: class SvxAbstractInsRowColDlg : public VclAbstractDialog { +protected: + virtual ~SvxAbstractInsRowColDlg() override = default; public: virtual bool isInsertBefore() const = 0; virtual sal_uInt16 getInsertCount() const = 0; diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index 6b89f95..c173326 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -36,8 +36,9 @@ class Bitmap; */ class VCL_DLLPUBLIC VclAbstractDialog : public virtual VclReferenceBase { -public: +protected: virtual ~VclAbstractDialog() override; +public: virtual short Execute() = 0; // Screenshot interface @@ -49,27 +50,33 @@ public: class VCL_DLLPUBLIC VclAbstractDialog2 : public virtual VclReferenceBase { -public: +protected: virtual ~VclAbstractDialog2() override; - +public: virtual void StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) = 0; virtual long GetResult() = 0; }; class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog { +protected: + virtual ~VclAbstractTerminatedDialog() override = default; public: virtual void EndDialog(long nResult) = 0; }; class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog { +protected: + virtual ~VclAbstractRefreshableDialog() override = default; public: virtual void Update() = 0; }; class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog { +protected: + virtual ~AbstractPasswordToOpenModifyDialog() override = default; public: virtual OUString GetPasswordToOpen() const = 0; virtual OUString GetPasswordToModify() const = 0; @@ -78,6 +85,8 @@ public: class VCL_DLLPUBLIC AbstractScreenshotAnnotationDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScreenshotAnnotationDlg() override = default; }; class VCL_DLLPUBLIC VclAbstractDialogFactory diff --git a/include/vcl/vclreferencebase.hxx b/include/vcl/vclreferencebase.hxx index 16fd4ec..7713d93 100644 --- a/include/vcl/vclreferencebase.hxx +++ b/include/vcl/vclreferencebase.hxx @@ -53,7 +53,7 @@ private: protected: VclReferenceBase(); -public: +protected: virtual ~VclReferenceBase(); protected: diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 5ddd32d..efb4161 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -756,7 +756,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R { // want the dialog to be destroyed before our set SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ::std::unique_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get(), true )); + ScopedVclPtr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get(), true )); if ( RET_OK == pDialog->Execute() ) { bSuccess = true; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index dbdadcc..43a316c 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -4227,7 +4227,7 @@ void OReportController::openZoomDialog() aZoomItem.SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH); pDescriptor->Put(aZoomItem); - ::std::unique_ptr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(nullptr, *pDescriptor.get()) ); + ScopedVclPtr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(nullptr, *pDescriptor.get()) ); pDlg->SetLimits( 20, 400 ); bool bCancel = ( RET_CANCEL == pDlg->Execute() ); diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index bf939b9..bd5f5d9 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -55,6 +55,8 @@ namespace com { namespace sun { namespace star { namespace sheet { class AbstractScImportAsciiDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScImportAsciiDlg() override = default; public: virtual void GetOptions( ScAsciiOptions& rOpt ) = 0; virtual void SaveParameters() = 0; @@ -62,6 +64,8 @@ public: class AbstractScAutoFormatDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScAutoFormatDlg() override = default; public: virtual sal_uInt16 GetIndex() const = 0 ; virtual OUString GetCurrFormatName() = 0; @@ -69,6 +73,8 @@ public: class AbstractScColRowLabelDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScColRowLabelDlg() override = default; public: virtual bool IsCol() = 0; virtual bool IsRow() = 0; @@ -76,6 +82,8 @@ public: class AbstractScCondFormatManagerDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScCondFormatManagerDlg() override = default; public: virtual ScConditionalFormatList* GetConditionalFormatList() = 0; @@ -88,12 +96,16 @@ public: class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog { +protected: + virtual ~AbstractScDataPilotDatabaseDlg() override = default; public: virtual void GetValues( ScImportSourceDesc& rDesc ) = 0; }; class AbstractScDataPilotSourceTypeDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDataPilotSourceTypeDlg() override = default; public: virtual bool IsDatabase() const = 0; virtual bool IsExternal() const = 0; @@ -104,6 +116,8 @@ public: class AbstractScDataPilotServiceDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDataPilotServiceDlg() override = default; public: virtual OUString GetServiceName() const = 0; virtual OUString GetParSource() const = 0 ; @@ -114,6 +128,8 @@ public: class AbstractScDeleteCellDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDeleteCellDlg() override = default; public: virtual DelCellCmd GetDelCellCmd() const = 0; }; @@ -121,11 +137,14 @@ public: //for dataform class AbstractScDataFormDlg : public VclAbstractDialog { - +protected: + virtual ~AbstractScDataFormDlg() override = default; }; class AbstractScDeleteContentsDlg: public VclAbstractDialog { +protected: + virtual ~AbstractScDeleteContentsDlg() override = default; public: virtual void DisableObjects() = 0 ; virtual InsertDeleteFlags GetDelContentsCmdBits() const = 0; @@ -133,6 +152,8 @@ public: class AbstractScFillSeriesDlg: public VclAbstractDialog { +protected: + virtual ~AbstractScFillSeriesDlg() override = default; public: virtual FillDir GetFillDir() const = 0; virtual FillCmd GetFillCmd() const = 0; @@ -146,18 +167,24 @@ public: class AbstractScGroupDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScGroupDlg() override = default; public: virtual bool GetColsChecked() const = 0; }; class AbstractScInsertCellDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScInsertCellDlg() override = default; public: virtual InsCellCmd GetInsCellCmd() const = 0; }; class AbstractScInsertContentsDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScInsertContentsDlg() override = default; public: virtual InsertDeleteFlags GetInsContentsCmdBits() const = 0; virtual ScPasteFunc GetFormulaCmdBits() const = 0 ; @@ -173,6 +200,8 @@ public: class AbstractScInsertTableDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScInsertTableDlg() override = default; public: virtual bool GetTablesFromFile() = 0; virtual bool GetTablesAsLink() = 0; @@ -186,12 +215,16 @@ public: class AbstractScSelEntryDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScSelEntryDlg() override = default; public: virtual OUString GetSelectEntry() const = 0; }; class AbstractScLinkedAreaDlg : public VclAbstractDialog2 { +protected: + virtual ~AbstractScLinkedAreaDlg() override = default; public: virtual void InitFromOldLink( const OUString& rFile, const OUString& rFilter, const OUString& rOptions, const OUString& rSource, @@ -205,12 +238,16 @@ public: class AbstractScMetricInputDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScMetricInputDlg() override = default; public: virtual long GetInputValue() const = 0; }; class AbstractScMoveTableDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScMoveTableDlg() override = default; public: virtual sal_uInt16 GetSelectedDocument () const = 0; virtual sal_uInt16 GetSelectedTable () const = 0; @@ -223,24 +260,32 @@ public: class AbstractScNameCreateDlg : public VclAbstractDialog // Manage Name Dialog { +protected: + virtual ~AbstractScNameCreateDlg() override = default; public: virtual sal_uInt16 GetFlags() const = 0; }; class AbstractScNamePasteDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScNamePasteDlg() override = default; public: virtual std::vector<OUString> GetSelectedNames() const = 0; }; class AbstractScPivotFilterDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScPivotFilterDlg() override = default; public: virtual const ScQueryItem& GetOutputItem() = 0; }; class AbstractScDPFunctionDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDPFunctionDlg() override = default; public: virtual PivotFunc GetFuncMask() const = 0; virtual css::sheet::DataPilotFieldReference GetFieldRef() const = 0; @@ -248,6 +293,8 @@ public: class AbstractScDPSubtotalDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDPSubtotalDlg() override = default; public: virtual PivotFunc GetFuncMask() const = 0; virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0; @@ -255,12 +302,16 @@ public: class AbstractScDPNumGroupDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDPNumGroupDlg() override = default; public: virtual ScDPNumGroupInfo GetGroupInfo() const = 0; }; class AbstractScDPDateGroupDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDPDateGroupDlg() override = default; public: virtual ScDPNumGroupInfo GetGroupInfo() const = 0; virtual sal_Int32 GetDatePart() const = 0; @@ -268,12 +319,16 @@ public: class AbstractScDPShowDetailDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScDPShowDetailDlg() override = default; public: virtual OUString GetDimensionName() const = 0; }; class AbstractScNewScenarioDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScNewScenarioDlg() override = default; public: virtual void SetScenarioData( const OUString& rName, const OUString& rComment, @@ -285,6 +340,8 @@ public: class AbstractScShowTabDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScShowTabDlg() override = default; public: virtual void Insert( const OUString& rString, bool bSelected ) = 0; virtual sal_Int32 GetSelectEntryCount() const = 0; @@ -295,28 +352,38 @@ public: class AbstractScSortWarningDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScSortWarningDlg() override = default; }; class AbstractScStringInputDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScStringInputDlg() override = default; public: virtual OUString GetInputString() const = 0; }; class AbstractScTabBgColorDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScTabBgColorDlg() override = default; public: virtual void GetSelectedColor( Color& rColor ) const = 0; }; class AbstractScImportOptionsDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScImportOptionsDlg() override = default; public: virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0; }; class AbstractScTextImportOptionsDlg : public VclAbstractDialog { +protected: + virtual ~AbstractScTextImportOptionsDlg() override = default; public: virtual LanguageType GetLanguageType() const = 0; virtual bool IsDateConversionSet() const = 0; diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index c53590d..98fd3db0 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx @@ -56,7 +56,7 @@ bool ScPivotLayoutTreeList::DoubleClickHdl() vector<ScDPName> aDataFieldNames; mpParent->PushDataFieldNames(aDataFieldNames); - std::unique_ptr<AbstractScDPSubtotalDlg> pDialog( + ScopedVclPtr<AbstractScDPSubtotalDlg> pDialog( pFactory->CreateScDPSubtotalDlg(this, mpParent->maPivotTableObject, rCurrentLabelData, rCurrentFunctionData, aDataFieldNames)); if (pDialog->Execute() == RET_OK) diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx index dc24b80..85f04c5 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx @@ -76,7 +76,7 @@ bool ScPivotLayoutTreeListData::DoubleClickHdl() ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create(); - std::unique_ptr<AbstractScDPFunctionDlg> pDialog( + ScopedVclPtr<AbstractScDPFunctionDlg> pDialog( pFactory->CreateScDPFunctionDlg(this, mpParent->GetLabelDataVector(), rCurrentLabelData, rCurrentFunctionData)); if (pDialog->Execute() == RET_OK) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 977f03e..63a2db5 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -323,7 +323,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScColRowLabelDlg> pDlg(pFact->CreateScColRowLabelDlg(pParent, bRowHeaders, bColHeaders)); + ScopedVclPtr<AbstractScColRowLabelDlg> pDlg(pFact->CreateScColRowLabelDlg(pParent, bRowHeaders, bColHeaders)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { @@ -872,7 +872,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(GetActiveDialogParent(), aName, true, bSheetProtected)); + ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(GetActiveDialogParent(), aName, true, bSheetProtected)); OSL_ENSURE(pNewDlg, "Dialog create fail!"); pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags ); if ( pNewDlg->Execute() == RET_OK ) @@ -1565,7 +1565,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE )); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) @@ -1605,7 +1605,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, PageStyleModified( aNewName, false ); rReq.Done(); } - pDlg.reset(); + pDlg.disposeAndClear(); rStyleSet.ClearItem( ATTR_PAGE_PAPERTRAY ); } @@ -1727,7 +1727,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( GetActiveDialogParent(), rStyleSet, aStr, diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 35a0639..756ed34 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -262,7 +262,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog( pWin, pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog( pWin, pView )); const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange ); @@ -284,7 +284,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView )); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (pDlg->Execute() == RET_OK) { @@ -345,7 +345,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin ) xFrame = GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( pWin, *pItemSet, xFrame, SID_EVENTCONFIG )); + ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( pWin, *pItemSet, xFrame, SID_EVENTCONFIG )); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK ) { const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet(); @@ -390,7 +390,7 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(), + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(), &aNewAttr, pViewData->GetDocument()->GetDrawLayer(), pObj, @@ -419,7 +419,7 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq ) pView->MergeAttrFromMarked( aNewAttr, false ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( + ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( pViewData->GetDialogParent(), &aNewAttr, pViewData->GetDocument()->GetDrawLayer(), true)); @@ -445,7 +445,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq ) pView->MergeAttrFromMarked( aNewAttr, false ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView )); sal_uInt16 nResult = pDlg->Execute(); diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index cf4f454..989fc89 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -482,7 +482,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(aName)); + ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(aName)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, NameObjectHdl)); @@ -551,7 +551,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription)); + ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(RET_OK == pDlg->Execute()) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 7f74fb4..7521afb 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -872,14 +872,14 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_DRAWTEXT_ATTR_DLG: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView )); bDone = ( RET_OK == pDlg->Execute() ); if ( bDone ) aNewAttr.Put( *pDlg->GetOutputItemSet() ); - pDlg.reset(); + pDlg.disposeAndClear(); SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_TABLE_VERT_NONE ); diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index aae2f05..a4a23f9 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -47,7 +47,7 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact && "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( pViewData->GetDialogParent(), &rArgs, pViewData->GetSfxDocShell())); assert(pDlg && "Dialog create fail!"); @@ -94,7 +94,7 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScParagraphDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScParagraphDlg( pViewData->GetDialogParent(), &aNewAttr)); OSL_ENSURE(pDlg, "Dialog create fail!"); bool bRet = ( pDlg->Execute() == RET_OK ); @@ -114,7 +114,7 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ ) SdrView* pView = pViewData->GetScDrawView(); OutlinerView* pOutView = pView->GetTextEditOutlinerView(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING ); pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING ); diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 975f9b1..41610a0 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -241,7 +241,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* case SID_INSERT_FLOATINGFRAME : { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractInsertObjectDialog> pDlg( + ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( pFact->CreateInsertObjectDialog( pViewShell->GetWindow(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(), xStorage, &aServerLst )); if ( pDlg ) diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index c67cebb..2a4e385 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -186,7 +186,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( this, aDataSet, aStrPageStyle, nResId)); OSL_ENSURE(pDlg, "Dialog create fail!"); diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 4face4a..2fd8ff0 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -201,7 +201,7 @@ void ScEditWindow::SetCharAttributes() ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( GetParent(), &aSet, pDocSh)); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) ); diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 96f74ce..f11fc1e 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -176,7 +176,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st if ( xInputStream.is() ) pInStream.reset(utl::UcbStreamHelper::CreateStream( xInputStream )); - std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( aPrivDatName, pInStream.get(), SC_IMPORTFILE)); + ScopedVclPtr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( aPrivDatName, pInStream.get(), SC_IMPORTFILE)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { @@ -194,7 +194,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st else { // HTML import. - std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( + ScopedVclPtr<AbstractScTextImportOptionsDlg> pDlg( pFact->CreateScTextImportOptionsDlg()); if (pDlg->Execute() == RET_OK) @@ -277,7 +277,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding); - std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg( + ScopedVclPtr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg( bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc, !bExport)); OSL_ENSURE(pDlg, "Dialog create fail!"); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 165b5ef..12f1f31 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -221,7 +221,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag)); + ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag)); OSL_ENSURE(pDlg, "Dialog create fail!"); if (pDlg->Execute() == RET_OK) eCmd = pDlg->GetInsCellCmd(); @@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScDeleteCellDlg> pDlg(pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), bTheFlag )); + ScopedVclPtr<AbstractScDeleteCellDlg> pDlg(pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), bTheFlag )); OSL_ENSURE(pDlg, "Dialog create fail!"); if (pDlg->Execute() == RET_OK) @@ -375,7 +375,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetDialogParent())); + ScopedVclPtr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); ScDocument* pDoc = GetViewData()->GetDocument(); SCTAB nTab = GetViewData()->GetTabNo(); @@ -482,7 +482,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(), + ScopedVclPtr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(), &ScGlobal::GetRscString(STR_FILL_TAB))); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetFillMode(true); @@ -715,7 +715,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(), + ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(), *pDoc, eFillDir, eFillCmd, eFillDateCmd, aStartStr, fIncVal, fMaxVal, @@ -1173,7 +1173,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent())); + ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) bColumns = pDlg->GetColsChecked(); @@ -1232,7 +1232,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true)); + ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) bColumns = pDlg->GetColsChecked(); @@ -1396,7 +1396,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg(pTabViewShell->GetDialogParent())); + ScopedVclPtr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg(pTabViewShell->GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetOtherDoc( bOtherDoc ); // if ChangeTrack MoveMode disable @@ -1596,7 +1596,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( nFormatCount ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pTabViewShell->GetDialogParent() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pTabViewShell->GetDialogParent() )); if ( pDlg ) { for (sal_uInt16 i=0; i<nFormatCount; i++) @@ -1831,7 +1831,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScNameCreateDlg> pDlg(pFact->CreateScNameCreateDlg(pTabViewShell->GetDialogParent(), nFlags)); + ScopedVclPtr<AbstractScNameCreateDlg> pDlg(pFact->CreateScNameCreateDlg(pTabViewShell->GetDialogParent(), nFlags)); OSL_ENSURE(pDlg, "Dialog create fail!"); if( pDlg->Execute() ) @@ -2148,7 +2148,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pTabViewShell->GetDialogParent(), GetViewData()->GetDocShell() )); + ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pTabViewShell->GetDialogParent(), GetViewData()->GetDocShell() )); OSL_ENSURE(pDlg, "Dialog create fail!"); switch( pDlg->Execute() ) { @@ -2360,7 +2360,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) aSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) ); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet, pTabViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); if ( pDlg->Execute() == RET_OK ) @@ -2460,7 +2460,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if (!pList) pList = pDoc->GetCondFormList( aPos.Tab() ); - std::unique_ptr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg( + ScopedVclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg( pTabViewShell->GetDialogParent(), pDoc, pList)); if (pDlgItem) @@ -2699,7 +2699,7 @@ void ScCellShell::ExecuteDataPilotDialog() ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScDataPilotSourceTypeDlg> pTypeDlg( + ScopedVclPtr<AbstractScDataPilotSourceTypeDlg> pTypeDlg( pFact->CreateScDataPilotSourceTypeDlg( pTabViewShell->GetDialogParent(), bEnableExt)); @@ -2718,7 +2718,7 @@ void ScCellShell::ExecuteDataPilotDialog() if ( pTypeDlg->IsExternal() ) { std::vector<OUString> aSources = ScDPObject::GetRegisteredSources(); - std::unique_ptr<AbstractScDataPilotServiceDlg> pServDlg( + ScopedVclPtr<AbstractScDataPilotServiceDlg> pServDlg( pFact->CreateScDataPilotServiceDlg( pTabViewShell->GetDialogParent(), aSources)); @@ -2739,7 +2739,7 @@ void ScCellShell::ExecuteDataPilotDialog() { OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScDataPilotDatabaseDlg> pDataDlg( + ScopedVclPtr<AbstractScDataPilotDatabaseDlg> pDataDlg( pFact->CreateScDataPilotDatabaseDlg( pTabViewShell->GetDialogParent())); @@ -2870,7 +2870,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) return; } - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; ScSubTotalParam aSubTotalParam; SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA ); @@ -2893,7 +2893,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //"ScAbstractFactory create fail - pDlg.reset(pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet)); + pDlg.disposeAndReset(pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet)); assert(pDlg); // "Dialog create fail pDlg->SetCurPageId(1); diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 9f65339..c3073f3 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -181,7 +181,7 @@ static bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScSortWarningDlg> pWarningDlg(pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr )); + ScopedVclPtr<AbstractScSortWarningDlg> pWarningDlg(pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr )); OSL_ENSURE(pWarningDlg, "Dialog create fail!"); short bResult = pWarningDlg->Execute(); if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION ) @@ -335,7 +335,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScDataFormDlg> pDlg(pFact->CreateScDataFormDlg( + ScopedVclPtr<AbstractScDataFormDlg> pDlg(pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(), pTabViewShell)); OSL_ENSURE(pDlg, "Dialog create fail!"); @@ -495,7 +495,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //ScAbstractFactory create fail! - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScSortDlg(pTabViewShell->GetDialogParent(), &aArgSet)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScSortDlg(pTabViewShell->GetDialogParent(), &aArgSet)); assert(pDlg); //Dialog create fail! pDlg->SetCurPageId("criteria"); // 1=sort field tab 2=sort options tab @@ -738,7 +738,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScSelEntryDlg> pDlg(pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(), + ScopedVclPtr<AbstractScSelEntryDlg> pDlg(pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(), aList )); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) @@ -982,7 +982,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE( pFact, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pFact is null!" ); - std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( + ScopedVclPtr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( OUString(), &aStream, SC_TEXTTOCOLUMNS)); OSL_ENSURE( pDlg, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDlg is null!" ); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 1c2a919..a9f4c2a 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -509,7 +509,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetDialogParent(), aName, false, bSheetProtected)); + ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetDialogParent(), aName, false, bSheetProtected)); OSL_ENSURE(pNewDlg, "Dialog create fail!"); if ( pNewDlg->Execute() == RET_OK ) { @@ -581,7 +581,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //ScAbstractFactory create fail! - std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( + ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), "RowHeightDialog", nCurHeight, ScGlobal::nStdRowHeight, eMetric, 2, MAX_ROW_HEIGHT)); @@ -622,7 +622,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //ScAbstractFactory create fail! - std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( + ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), "OptimalRowHeightDialog", ScGlobal::nLastRowHeightExtra, 0, eMetric, 1, MAX_EXTRA_HEIGHT)); assert(pDlg); //Dialog create fail! @@ -686,7 +686,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //ScAbstractFactory create fail! - std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( + ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), "ColWidthDialog", nCurHeight, STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH)); assert(pDlg); //Dialog create fail! @@ -726,7 +726,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); //ScAbstractFactory create fail! - std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( + ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), "OptimalColWidthDialog", ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 1, MAX_EXTRA_WIDTH)); assert(pDlg); //Dialog create fail! @@ -875,7 +875,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData())); + ScopedVclPtr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData())); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index fc0c29b..1e1aae0 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -273,7 +273,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_PASTE_SPECIAL: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() )); SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; if ( pDlg ) { @@ -285,7 +285,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() ); } - pDlg.reset(); + pDlg.disposeAndClear(); // while the dialog was open, edit mode may have been stopped if (!SC_MOD()->IsInputMode()) @@ -453,7 +453,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pViewData->GetDocShell(), false )); + ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pViewData->GetDocShell(), false )); OSL_ENSURE(pDlg, "Dialog create fail!"); short nRet = pDlg->Execute(); // pDlg is needed below @@ -478,7 +478,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) pTopView->InsertText(aBuffer.makeStringAndClear()); } } - pDlg.reset(); + pDlg.disposeAndClear(); if (pTopView) pTopView->GetWindow()->GrabFocus(); @@ -495,7 +495,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( pViewData->GetDialogParent(), &aAttrs, pObjSh)); OSL_ENSURE(pDlg, "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 8794ba1..28f3fd6 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -777,7 +777,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) if ( pStyleSheet ) { SfxStyleFamily eFam = pStyleSheet->GetFamily(); - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; sal_uInt16 nRsc = 0; // Store old Items from the style @@ -860,7 +860,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - pDlg.reset(pFact->CreateScStyleDlg( pParent, *pStyleSheet, nRsc, nRsc )); + pDlg.disposeAndReset(pFact->CreateScStyleDlg( pParent, *pStyleSheet, nRsc, nRsc )); OSL_ENSURE(pDlg, "Dialog create fail!"); short nResult = pDlg->Execute(); pTabViewShell->SetInFormatDialog(false); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index e81f1ec..c2e34db 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -54,7 +54,6 @@ using namespace css; using namespace css::sheet; using css::sheet::DataPilotFieldOrientation; using std::vector; -using std::unique_ptr; DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const { @@ -207,7 +206,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent& ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - const std::unique_ptr<AbstractScPivotFilterDlg> pDlg( + ScopedVclPtr<AbstractScPivotFilterDlg> pDlg( pFact->CreateScPivotFilterDlg( pViewData->GetViewShell()->GetDialogParent(), aArgSet, nSrcTab)); OSL_ENSURE(pDlg, "Dialog create fail!"); @@ -435,7 +434,7 @@ private: void ScGridWindow::DPLaunchFieldPopupMenu( const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj) { - unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData); + std::unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData); sal_uInt16 nOrient; pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient); diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index 13899b2..b86a218 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -107,7 +107,7 @@ void ScPivotShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScPivotFilterDlg> pDlg(pFact->CreateScPivotFilterDlg( + ScopedVclPtr<AbstractScPivotFilterDlg> pDlg(pFact->CreateScPivotFilterDlg( pViewShell->GetDialogParent(), aArgSet, nSrcTab)); OSL_ENSURE(pDlg, "Dialog create fail!"); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index b1c0089..b27d535 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -640,7 +640,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, aSet)); + ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, aSet)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetLimits( 20, 400 ); pDlg->HideButton( ZoomButtonId::OPTIMAL ); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 38a8364..eb154dd 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -708,7 +708,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM ); SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM ); - std::unique_ptr<AbstractSvxZoomDialog> pDlg; + ScopedVclPtr<AbstractSvxZoomDialog> pDlg; ScMarkData& rMark = GetViewData().GetMarkData(); SvxZoomEnableFlags nBtnFlags = SvxZoomEnableFlags::N50 | SvxZoomEnableFlags::N75 @@ -726,7 +726,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg.reset(pFact->CreateSvxZoomDialog(GetDialogParent(), aSet )); + pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetDialogParent(), aSet)); OSL_ENSURE(pDlg, "Dialog creation failed!"); } if (pDlg) @@ -851,7 +851,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); + ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetDescription( OUString( ScResId( STR_DLG_SELECTTABLES_TITLE ) ), @@ -871,7 +871,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) const sal_Int32 nSelCount = pDlg->GetSelectEntryCount(); for( sal_Int32 nSelIx = 0; nSelIx < nSelCount; ++nSelIx ) aIndexList.insert( aIndexList.begin()+nSelIx, pDlg->GetSelectEntryPos( nSelIx ) ); - pDlg.reset(); + pDlg.disposeAndClear(); rReq.AppendItem( SfxIntegerListItem( SID_SELECT_TABLES, aIndexList ) ); } else diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 149b310..b3e19e1 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -478,7 +478,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName const ScPatternAttr* pOldAttrs = GetSelectionPattern(); - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet())); std::unique_ptr<SvxNumberInfoItem> pNumberInfoItem; @@ -538,7 +538,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - pDlg.reset(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get())); + pDlg.disposeAndReset(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get())); if (!rName.isEmpty()) pDlg->SetCurPageId(rName); diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index b8b1d3f..a62c76e 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -131,7 +131,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); + ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); OUString aTabName; @@ -207,7 +207,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), rViewData, + ScopedVclPtr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), rViewData, nTabSelCount, nSlot == FID_INS_TABLE_EXT)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( RET_OK == pDlg->Execute() ) @@ -385,7 +385,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScStringInputDlg> pDlg(pFact->CreateScStringInputDlg( + ScopedVclPtr<AbstractScStringInputDlg> pDlg(pFact->CreateScStringInputDlg( GetDialogParent(), aDlgTitle, OUString(ScResId(SCSTR_NAME)), aName, GetStaticInterface()->GetSlot(nSlot)->GetCommand(), pHelpId)); @@ -510,7 +510,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScMoveTableDlg> pDlg(pFact->CreateScMoveTableDlg(GetDialogParent(), + ScopedVclPtr<AbstractScMoveTableDlg> pDlg(pFact->CreateScMoveTableDlg(GetDialogParent(), aDefaultName)); OSL_ENSURE(pDlg, "Dialog create fail!"); @@ -736,7 +736,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) aTabBgColor = pDoc->GetTabBgColor( nCurrentTab ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - std::unique_ptr<AbstractScTabBgColorDlg> pDlg(pFact->CreateScTabBgColorDlg( + ScopedVclPtr<AbstractScTabBgColorDlg> pDlg(pFact->CreateScTabBgColorDlg( GetDialogParent(), OUString(ScResId(SCSTR_SET_TAB_BG_COLOR)), OUString(ScResId(SCSTR_NO_TAB_BG_COLOR)), diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 6903e9a..9a3ae1b 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -306,7 +306,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, // this for html pasting only, but in the future it may // make sense to do it for other data types too. ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( + ScopedVclPtr<AbstractScTextImportOptionsDlg> pDlg( pFact->CreateScTextImportOptionsDlg()); if (pDlg->Execute() == RET_OK) @@ -335,7 +335,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ScImportStringStream aStrm( aStr); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - std::unique_ptr<AbstractScImportAsciiDlg> pDlg( + ScopedVclPtr<AbstractScImportAsciiDlg> pDlg( pFact->CreateScImportAsciiDlg( OUString(), &aStrm, SC_PASTETEXT)); if (pDlg->Execute() == RET_OK) diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 958a042..fcd0e5c 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -353,7 +353,7 @@ bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont, SfxAllItemSet aSet( rFrame.GetObjectShell()->GetPool() ); aSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) ); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); if ( pDlg->Execute() == RET_OK ) { const SfxStringItem* pItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false); diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 51949e8..e326932 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -62,12 +62,16 @@ class SdCustomShowList; class AbstractCopyDlg : public VclAbstractDialog { +protected: ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits