diff options
148 files changed, 565 insertions, 342 deletions
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 690cedce16e3..b47034867919 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 37b57ddeecc9..49dd8a81e3ca 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 de1d92bddbe7..8c68892a498e 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 a31aed0e8976..e21e81e6c66a 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 cda0df95648f..43f76b4b6884 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 1172777d0a6b..599072104551 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 f3511513f88b..7c624a75cfb7 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 505b8f66638b..fa678c71d2a9 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 19b5db042880..ec7b6d55c7ea 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 aa16ce6b11ba..88a7e17d34c3 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 503e94abae93..e28e17791d56 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 7469d15567fa..1f4fa526d9da 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 f9949a33ae84..984a1c6e25f4 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 15a1ed469f17..9c5741a3dde6 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 2ae6dfd79f80..253b1984d478 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 7b134ef4769e..3c6860d37380 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 e98c5adda0fc..7e6bc3adf9b0 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 35c68bef69ee..ba8dbf1bc0f0 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 c4be9fe644b4..e8f5521ee095 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 6b80bf842474..f14f9b3ad4eb 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 fcbbc43749b4..ebeedc317ae4 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 6b89f95e7613..c173326706c8 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 16fd4ec84eb3..7713d9318d39 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 5ddd32dead06..efb4161d14dd 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 dbdadccecd50..43a316c7fdbf 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 bf939b9c2956..bd5f5d954224 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 c53590d73db2..98fd3db01b9c 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 dc24b8079b1b..85f04c531d1d 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 977f03e70f02..63a2db5e8f32 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 35a063941a35..756ed34a4584 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 cf4f4542e892..989fc898657e 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 7f74fb4c1239..7521afb942f7 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 aae2f0548bdc..a4a23f969cca 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 975f9b169c0c..41610a0ea11a 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 c67cebb028cb..2a4e385c851c 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 4face4a60e86..2fd8ff02a245 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 96f74ce7b949..f11fc1ee18d5 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 165b5ef3d0cb..12f1f3184ea3 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 9f653391060d..c3073f36c173 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 1c2a91998812..a9f4c2abab38 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 fc0c29bd10e4..1e1aae092de0 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 8794ba12b2a0..28f3fd6e46c0 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 e81f1ece6a92..c2e34db084ea 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 13899b25eaaf..b86a21876bd6 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 b1c0089ff11c..b27d5355ba45 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 38a8364e9826..eb154dd01253 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 149b31098760..b3e19e12afd1 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 b8b1d3f18e10..a62c76e2d6e3 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 6903e9ae3a24..9a3ae1b14f04 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 958a0424f339..fcd0e5c621a3 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 51949e8e7f5f..e3269326c3c5 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -62,12 +62,16 @@ class SdCustomShowList; class AbstractCopyDlg : public VclAbstractDialog { +protected: + virtual ~AbstractCopyDlg() override = default; public: virtual void GetAttr( SfxItemSet& rOutAttrs ) = 0; }; class AbstractSdCustomShowDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdCustomShowDlg() override = default; public: virtual bool IsModified() const = 0; virtual bool IsCustomShow() const = 0; @@ -75,6 +79,8 @@ public: class AbstractSdModifyFieldDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdModifyFieldDlg() override = default; public: virtual SvxFieldData* GetField() = 0; virtual SfxItemSet GetItemSet() = 0; @@ -82,6 +88,8 @@ public: class AbstractSdSnapLineDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdSnapLineDlg() override = default; public: virtual void GetAttr(SfxItemSet& rOutAttrs) = 0; virtual void HideRadioGroup() = 0; @@ -93,6 +101,8 @@ public: class AbstractSdInsertLayerDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdInsertLayerDlg() override = default; public: virtual void GetAttr( SfxItemSet& rOutAttrs ) = 0; //from class vcl::Window @@ -101,10 +111,14 @@ public: class AbstractSdInsertPasteDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdInsertPasteDlg() override = default; }; class AbstractSdInsertPagesObjsDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdInsertPagesObjsDlg() override = default; public: virtual std::vector<OUString> GetList ( const sal_uInt16 nType ) = 0; virtual bool IsLink() = 0; @@ -113,6 +127,8 @@ public: class AbstractMorphDlg : public VclAbstractDialog { +protected: + virtual ~AbstractMorphDlg() override = default; public: virtual void SaveSettings() const = 0; virtual sal_uInt16 GetFadeSteps() const = 0; @@ -122,30 +138,40 @@ public: class AbstractSdStartPresDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdStartPresDlg() override = default; public: virtual void GetAttr( SfxItemSet& rOutAttrs ) = 0; }; class AbstractSdPresLayoutDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdPresLayoutDlg() override = default; public: virtual void GetAttr(SfxItemSet& rOutAttrs) = 0; }; class AbstractSdVectorizeDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdVectorizeDlg() override = default; public: virtual const GDIMetaFile& GetGDIMetaFile() const = 0; }; class AbstractSdPublishingDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSdPublishingDlg() override = default; public: virtual void GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ) = 0; }; class AbstractHeaderFooterDialog : public VclAbstractDialog { +protected: + virtual ~AbstractHeaderFooterDialog() override = default; }; class SdAbstractDialogFactory diff --git a/sd/source/filter/html/HtmlOptionsDialog.cxx b/sd/source/filter/html/HtmlOptionsDialog.cxx index a8a67be5a98f..8d914d707cdd 100644 --- a/sd/source/filter/html/HtmlOptionsDialog.cxx +++ b/sd/source/filter/html/HtmlOptionsDialog.cxx @@ -196,7 +196,7 @@ sal_Int16 SdHtmlOptionsDialog::execute() SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); if( pFact ) { - std::unique_ptr<AbstractSdPublishingDlg> pDlg(pFact->CreateSdPublishingDlg( Application::GetDefDialogParent(), meDocType )); + ScopedVclPtr<AbstractSdPublishingDlg> pDlg(pFact->CreateSdPublishingDlg( Application::GetDefDialogParent(), meDocType )); if( pDlg ) { if( pDlg->Execute() ) diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx index 50be16e23fd7..ac4fff67a62d 100644 --- a/sd/source/ui/func/fuarea.cxx +++ b/sd/source/ui/func/fuarea.cxx @@ -60,7 +60,7 @@ void FuArea::DoExecute( SfxRequest& rReq ) mpView->GetAttributes( aNewAttr ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr, + ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr, &aNewAttr, mpDoc, true) : nullptr); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index ac1b89fa5ba1..486af64be04a 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -190,7 +190,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) aSet.Put( *pFontItem ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact ? pFact->CreateSfxDialog( &mpView->GetViewShell()->GetViewFrame()->GetWindow(), aSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact ? pFact->CreateSfxDialog( &mpView->GetViewShell()->GetViewFrame()->GetWindow(), aSet, mpView->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ) : nullptr); if( !pDlg ) diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index cd02f20e80ba..f5601b3f2cd3 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -96,7 +96,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) } SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdTabCharDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc->GetDocSh() ) : nullptr); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdTabCharDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc->GetDocSh() ) : nullptr); sal_uInt16 nResult = RET_CANCEL; if( pDlg ) { diff --git a/sd/source/ui/func/fuconnct.cxx b/sd/source/ui/func/fuconnct.cxx index e2e7b51d83a7..197cca71225c 100644 --- a/sd/source/ui/func/fuconnct.cxx +++ b/sd/source/ui/func/fuconnct.cxx @@ -57,7 +57,7 @@ void FuConnectionDlg::DoExecute( SfxRequest& rReq ) if( !pArgs ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( nullptr, aNewAttr, mpView, RID_SVXPAGE_CONNECTION) : nullptr); + ScopedVclPtr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( nullptr, aNewAttr, mpView, RID_SVXPAGE_CONNECTION) : nullptr); if( pDlg.get() && (pDlg->Execute() == RET_OK) ) { diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index d6bab1ad174c..a834258b78d2 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -102,7 +102,7 @@ void FuCopy::DoExecute( SfxRequest& rReq ) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); if( pFact ) { - std::unique_ptr<AbstractCopyDlg> pDlg(pFact->CreateCopyDlg(mpViewShell->GetActiveWindow(), aSet, mpDoc->GetColorList(), mpView )); + ScopedVclPtr<AbstractCopyDlg> pDlg(pFact->CreateCopyDlg(mpViewShell->GetActiveWindow(), aSet, mpDoc->GetColorList(), mpView )); if (!pDlg) return; @@ -118,7 +118,7 @@ void FuCopy::DoExecute( SfxRequest& rReq ) default: { - pDlg.reset(); + pDlg.disposeAndClear(); mpView->EndUndo(); } return; // Cancel diff --git a/sd/source/ui/func/fucushow.cxx b/sd/source/ui/func/fucushow.cxx index f3cce7bb272c..7c76ecb8919c 100644 --- a/sd/source/ui/func/fucushow.cxx +++ b/sd/source/ui/func/fucushow.cxx @@ -57,7 +57,7 @@ rtl::Reference<FuPoor> FuCustomShowDlg::Create( ViewShell* pViewSh, ::sd::Window void FuCustomShowDlg::DoExecute( SfxRequest& ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdCustomShowDlg> pDlg(pFact ? pFact->CreateSdCustomShowDlg(mpViewShell->GetActiveWindow(), *mpDoc) : nullptr); + ScopedVclPtr<AbstractSdCustomShowDlg> pDlg(pFact ? pFact->CreateSdCustomShowDlg(mpViewShell->GetActiveWindow(), *mpDoc) : nullptr); if( pDlg ) { sal_uInt16 nRet = pDlg->Execute(); @@ -67,7 +67,7 @@ void FuCustomShowDlg::DoExecute( SfxRequest& ) sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings(); rSettings.mbCustomShow = pDlg->IsCustomShow(); } - pDlg.reset(); + pDlg.disposeAndClear(); if( nRet == RET_YES ) { diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index f605a5bfa25f..82e42bafb81c 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -240,7 +240,7 @@ void FuInsertClipboard::DoExecute( SfxRequest& ) SotClipboardFormatId nFormatId; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( mpViewShell->GetActiveWindow() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( mpViewShell->GetActiveWindow() )); if ( pDlg ) { pDlg->Insert( SotClipboardFormatId::EMBED_SOURCE, OUString() ); @@ -496,7 +496,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) case SID_INSERT_FLOATINGFRAME : { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractInsertObjectDialog> pDlg( + ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( pFact->CreateInsertObjectDialog( mpViewShell->GetActiveWindow(), SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommandString(), xStorage, &aServerLst )); if ( pDlg ) diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 28c7441cc454..b000b3e8ddbc 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -329,7 +329,7 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) mpDocSh->SetWaitCursor( false ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); vcl::Window* pParent = mpViewShell ? mpViewShell->GetActiveWindow() : nullptr; - std::unique_ptr<AbstractSdInsertPagesObjsDlg> pDlg(pFact ? pFact->CreateSdInsertPagesObjsDlg(pParent, mpDoc, pMedium, aFile) : nullptr); + ScopedVclPtr<AbstractSdInsertPagesObjsDlg> pDlg(pFact ? pFact->CreateSdInsertPagesObjsDlg(pParent, mpDoc, pMedium, aFile) : nullptr); if( !pDlg ) return false; @@ -414,7 +414,7 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdInsertPagesObjsDlg> pDlg(pFact ? pFact->CreateSdInsertPagesObjsDlg(mpViewShell->GetActiveWindow(), mpDoc, nullptr, aFile) : nullptr); + ScopedVclPtr<AbstractSdInsertPagesObjsDlg> pDlg(pFact ? pFact->CreateSdInsertPagesObjsDlg(mpViewShell->GetActiveWindow(), mpDoc, nullptr, aFile) : nullptr); if( !pDlg ) return; diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx index 21b19bf3fc97..5f643ef7b774 100644 --- a/sd/source/ui/func/fuline.cxx +++ b/sd/source/ui/func/fuline.cxx @@ -75,7 +75,7 @@ void FuLine::DoExecute( SfxRequest& rReq ) mpView->GetAttributes( *pNewAttr ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(nullptr,pNewAttr.get(),mpDoc,pObj,bHasMarked) : nullptr); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(nullptr,pNewAttr.get(),mpDoc,pObj,bHasMarked) : nullptr); if( pDlg && (pDlg->Execute() == RET_OK) ) { mpView->SetAttributes (*(pDlg->GetOutputItemSet ())); diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 6025641dfd48..f79612f2bc52 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -114,7 +114,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact ? pFact->CreateSvxNameDialog( nullptr, aName, aDesc ) : nullptr); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact ? pFact->CreateSvxNameDialog( nullptr, aName, aDesc ) : nullptr); if( pDlg ) { diff --git a/sd/source/ui/func/fulink.cxx b/sd/source/ui/func/fulink.cxx index f39d668a041e..d884ca6840e9 100644 --- a/sd/source/ui/func/fulink.cxx +++ b/sd/source/ui/func/fulink.cxx @@ -58,7 +58,7 @@ void FuLink::DoExecute( SfxRequest& ) sfx2::LinkManager* pLinkManager = mpDoc->GetLinkManager(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( mpViewShell->GetActiveWindow(), pLinkManager )); + ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( mpViewShell->GetActiveWindow(), pLinkManager )); if ( pDlg ) { pDlg->Execute(); diff --git a/sd/source/ui/func/fumeasur.cxx b/sd/source/ui/func/fumeasur.cxx index 73fef5805709..204e1f1ec9a3 100644 --- a/sd/source/ui/func/fumeasur.cxx +++ b/sd/source/ui/func/fumeasur.cxx @@ -57,7 +57,7 @@ void FuMeasureDlg::DoExecute( SfxRequest& rReq ) if( !pArgs ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( nullptr, aNewAttr, mpView, RID_SVXPAGE_MEASURE) : nullptr ); + ScopedVclPtr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( nullptr, aNewAttr, mpView, RID_SVXPAGE_MEASURE) : nullptr ); if( pDlg.get() && (pDlg->Execute() == RET_OK) ) { diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 889b85837871..009a2f39426c 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -95,7 +95,7 @@ void FuMorph::DoExecute( SfxRequest& ) SdrObject* pPolyObj1 = pCloneObj1->ConvertToPolyObj(false, false); SdrObject* pPolyObj2 = pCloneObj2->ConvertToPolyObj(false, false); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractMorphDlg> pDlg(pFact ? pFact->CreateMorphDlg( static_cast< vcl::Window*>(mpWindow), pObj1, pObj2 ) : nullptr); + ScopedVclPtr<AbstractMorphDlg> pDlg(pFact ? pFact->CreateMorphDlg( static_cast< vcl::Window*>(mpWindow), pObj1, pObj2 ) : nullptr); if(pPolyObj1 && pPolyObj2 && pDlg && (pDlg->Execute() == RET_OK)) { B2DPolyPolygonList_impl aPolyPolyList; diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 89df12f6e268..a63c5f12c7fb 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -447,7 +447,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false)); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact ? pFact->CreatSdActionDialog(mpViewShell->GetActiveWindow(), &aSet, mpView) : nullptr); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact ? pFact->CreatSdActionDialog(mpViewShell->GetActiveWindow(), &aSet, mpView) : nullptr); short nResult = pDlg ? pDlg->Execute() : static_cast<short>(RET_CANCEL); diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 8906e7a82fb3..56d0dd25c5a7 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -81,7 +81,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq ) // create and execute dialog SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetActiveWindow(), &aNewAttr, mpView) : nullptr); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetActiveWindow(), &aNewAttr, mpView) : nullptr); if( pDlg ) { if ( pPageItem ) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 8e97080fe121..15515f88463c 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -336,7 +336,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) { // create the dialog SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg( pFact ? pFact->CreateSdTabPageDialog(mpViewShell->GetActiveWindow(), &aMergedAttr, mpDocSh, mbDisplayBackgroundTabPage) : nullptr ); + ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact ? pFact->CreateSdTabPageDialog(mpViewShell->GetActiveWindow(), &aMergedAttr, mpDocSh, mbDisplayBackgroundTabPage) : nullptr ); if( pDlg.get() && pDlg->Execute() == RET_OK ) pTempSet.reset( new SfxItemSet(*pDlg->GetOutputItemSet()) ); } diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index 69e5050fd643..9daab0a6077e 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -91,7 +91,7 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) } SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdParagraphTabDlg(mpViewShell->GetActiveWindow(), &aNewAttr) : nullptr); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdParagraphTabDlg(mpViewShell->GetActiveWindow(), &aNewAttr) : nullptr); if (!pDlg) return; diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index d3d78f3c8991..567426287d8f 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -174,7 +174,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) else { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdPresLayoutDlg> pDlg(pFact ? pFact->CreateSdPresLayoutDlg(mpDocSh, aSet ) : nullptr); + ScopedVclPtr<AbstractSdPresLayoutDlg> pDlg(pFact ? pFact->CreateSdPresLayoutDlg(mpDocSh, aSet ) : nullptr); sal_uInt16 nResult = pDlg ? pDlg->Execute() : static_cast<short>(RET_CANCEL); diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index daa979bf1fc5..575638d4f58d 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -139,7 +139,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) SfxStyleSheetBase& rStyleSheet = *pStyleSheet; SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), SdResId( nDlgId ), rStyleSheet, ePO, pStyleSheetPool ) : nullptr); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), SdResId( nDlgId ), rStyleSheet, ePO, pStyleSheetPool ) : nullptr); if( pDlg && (pDlg->Execute() == RET_OK) ) { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 023660ad827e..e71d93a17378 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -109,14 +109,9 @@ void FuScale::DoExecute( SfxRequest& rReq ) pZoomItem->SetValueSet( nZoomValues ); aNewAttr.Put( *pZoomItem ); - std::unique_ptr<AbstractSvxZoomDialog> pDlg; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if(pFact) - { - pDlg.reset(pFact->CreateSvxZoomDialog(nullptr, aNewAttr)); - } - - if( pDlg ) + ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact ? pFact->CreateSvxZoomDialog(nullptr, aNewAttr) : nullptr); + if (pDlg) { pDlg->SetLimits( (sal_uInt16)mpWindow->GetMinZoom(), (sal_uInt16)mpWindow->GetMaxZoom() ); sal_uInt16 nResult = pDlg->Execute(); @@ -136,7 +131,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) const SfxItemSet aArgs (*(pDlg->GetOutputItemSet ())); - pDlg.reset(); + pDlg.disposeAndClear(); if (!mpViewShell) return; diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index 07322ac2d3cf..8d3a4218839f 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -108,7 +108,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) aDlgSet.Put( SfxInt32Item( ATTR_PRESENT_DISPLAY, pOptions->GetDisplay() ) ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdStartPresDlg> pDlg(pFact ? pFact->CreateSdStartPresentationDlg(mpWindow, aDlgSet, aPageNameList, pCustomShowList) : nullptr); + ScopedVclPtr<AbstractSdStartPresDlg> pDlg(pFact ? pFact->CreateSdStartPresentationDlg(mpWindow, aDlgSet, aPageNameList, pCustomShowList) : nullptr); if( pDlg && (pDlg->Execute() == RET_OK) ) { OUString aPage; diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index 03a77aaec8aa..958f7f906a1e 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -110,7 +110,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_Y, aLinePos.Y())); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdSnapLineDlg> pDlg(pFact ? pFact->CreateSdSnapLineDlg(mpViewShell->GetActiveWindow(), aNewAttr, mpView) : nullptr); + ScopedVclPtr<AbstractSdSnapLineDlg> pDlg(pFact ? pFact->CreateSdSnapLineDlg(mpViewShell->GetActiveWindow(), aNewAttr, mpView) : nullptr); OSL_ASSERT(pDlg); if (!pDlg) return; @@ -143,7 +143,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) sal_uInt16 nResult = pDlg->Execute(); pDlg->GetAttr(aNewAttr); - pDlg.reset(); + pDlg.disposeAndClear(); switch( nResult ) { diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 7c2ae80248e4..535237564c7a 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -295,8 +295,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( pStyleSheet ) { - std::unique_ptr<SfxAbstractTabDialog> pStdDlg; - std::unique_ptr<SfxAbstractTabDialog> pPresDlg; + ScopedVclPtr<SfxAbstractTabDialog> pStdDlg; + ScopedVclPtr<SfxAbstractTabDialog> pPresDlg; SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); bool bOldDocInOtherLanguage = false; SfxItemSet aOriSet( pStyleSheet->GetItemSet() ); @@ -305,7 +305,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if (eFamily == SD_STYLE_FAMILY_GRAPHICS) { - pStdDlg.reset(pFact ? pFact->CreateSdTabTemplateDlg(mpViewShell->GetActiveWindow(), mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView) : nullptr); + pStdDlg.disposeAndReset(pFact ? pFact->CreateSdTabTemplateDlg(mpViewShell->GetActiveWindow(), mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView) : nullptr); } else if (eFamily == SD_STYLE_FAMILY_PSEUDO) { @@ -369,7 +369,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( !bOldDocInOtherLanguage ) { - pPresDlg.reset(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), SdResId(nDlgId), *pStyleSheet, ePO, pSSPool ) : nullptr); + pPresDlg.disposeAndReset(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), SdResId(nDlgId), *pStyleSheet, ePO, pSSPool ) : nullptr); } } else if (eFamily == SD_STYLE_FAMILY_CELL) diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index a7a4164d6692..02de2bdbb9d3 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -73,7 +73,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( pFact->CreateCaptionDialog( nullptr, mpView ) ); + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateCaptionDialog( nullptr, mpView ) ); const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange ); @@ -93,7 +93,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr< SfxAbstractTabDialog > pDlg( pFact->CreateSvxTransformTabDialog( nullptr, &aSet, mpView ) ); + ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateSvxTransformTabDialog( nullptr, &aSet, mpView ) ); if( pDlg.get() && (pDlg->Execute() == RET_OK) ) { rReq.Done( *( pDlg->GetOutputItemSet() ) ); diff --git a/sd/source/ui/func/futxtatt.cxx b/sd/source/ui/func/futxtatt.cxx index 7737a4bd833c..81f9317ecd15 100644 --- a/sd/source/ui/func/futxtatt.cxx +++ b/sd/source/ui/func/futxtatt.cxx @@ -58,7 +58,7 @@ void FuTextAttrDlg::DoExecute( SfxRequest& rReq ) if( !pArgs ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, mpView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, mpView )); sal_uInt16 nResult = pDlg->Execute(); diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx index f5f729805605..bd23fe21b7e5 100644 --- a/sd/source/ui/func/fuvect.cxx +++ b/sd/source/ui/func/fuvect.cxx @@ -63,7 +63,7 @@ void FuVectorize::DoExecute( SfxRequest& ) if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdVectorizeDlg> pDlg(pFact ? pFact->CreateSdVectorizeDlg( mpWindow, static_cast<SdrGrafObj*>( pObj )->GetGraphic().GetBitmap(), mpDocSh ) : nullptr); + ScopedVclPtr<AbstractSdVectorizeDlg> pDlg(pFact ? pFact->CreateSdVectorizeDlg( mpWindow, static_cast<SdrGrafObj*>( pObj )->GetGraphic().GetBitmap(), mpDocSh ) : nullptr); if( pDlg && pDlg->Execute() == RET_OK ) { const GDIMetaFile& rMtf = pDlg->GetGDIMetaFile(); diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index a42d222b1417..8998c0cc6046 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -877,7 +877,7 @@ void SlotManager::RenameSlide() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( mrSlideSorter.GetContentWindow(), aPageName, aDescr)); DBG_ASSERT(aNameDlg, "Dialog creation failed!"); @@ -897,7 +897,7 @@ void SlotManager::RenameSlide() DBG_ASSERT( bResult, "Couldn't rename slide" ); } } - aNameDlg.reset(); + aNameDlg.disposeAndClear(); // Tell the slide sorter about the name change (necessary for // accessibility.) diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index aa87c82a5090..2ab095e09c29 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -128,7 +128,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq) if( (nColumns == 0) || (nRows == 0) ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SvxAbstractNewTableDialog> pDlg( pFact ? pFact->CreateSvxNewTableDialog() : nullptr); + ScopedVclPtr<SvxAbstractNewTableDialog> pDlg( pFact ? pFact->CreateSvxNewTableDialog() : nullptr); if( !pDlg.get() || (pDlg->Execute() != RET_OK) ) break; diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index c52b2717ace6..1ded42c755c9 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -140,11 +140,11 @@ void TableObjectBar::Execute( SfxRequest& rReq ) case SID_TABLE_INSERT_COL_BEFORE: case SID_TABLE_INSERT_COL_AFTER: { - std::unique_ptr<SvxAbstractInsRowColDlg> pDlg; + ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg; if (nSlotId == SID_TABLE_INSERT_ROW_DLG || nSlotId == SID_TABLE_INSERT_COL_DLG) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - pDlg.reset(pFact ? pFact->CreateSvxInsRowColDlg(mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : nullptr); + pDlg.disposeAndReset(pFact ? pFact->CreateSvxInsRowColDlg(mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : nullptr); if (!pDlg.get() || (pDlg->Execute() != 1)) break; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 66a94d53a195..8504dadbe590 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -431,7 +431,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr )); + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr )); DBG_ASSERT(aNameDlg, "Dialog creation failed!"); aNameDlg->SetText( aTitle ); aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true ); @@ -1397,7 +1397,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) aNewAttr.Put( SdAttrLayerThisPage() ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(GetActiveWindow(), aNewAttr, true, SD_RESSTR(STR_INSERTLAYER)) : nullptr); + ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(GetActiveWindow(), aNewAttr, true, SD_RESSTR(STR_INSERTLAYER)) : nullptr); if( pDlg ) { pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() ); @@ -1424,7 +1424,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } if( bLoop ) // was canceled { - pDlg.reset(); + pDlg.disposeAndClear(); Cancel(); rReq.Ignore (); break; @@ -1565,7 +1565,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) aNewAttr.Put( SdAttrLayerThisPage() ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(GetActiveWindow(), aNewAttr, bDelete, SD_RESSTR(STR_MODIFYLAYER)) : nullptr); + ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(GetActiveWindow(), aNewAttr, bDelete, SD_RESSTR(STR_MODIFYLAYER)) : nullptr); if( pDlg ) { pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() ); @@ -1602,7 +1602,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) break; default : - pDlg.reset(); + pDlg.disposeAndClear(); rReq.Ignore (); Cancel (); return; @@ -1975,7 +1975,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOLV->GetAttribs() ) : nullptr); + ScopedVclPtr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOLV->GetAttribs() ) : nullptr); if( pDlg && pDlg->Execute() == RET_OK ) { // To make a correct SetAttribs() call at the utlinerView @@ -2084,7 +2084,7 @@ void DrawViewShell::FuTemporary(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, DrawViewShell, NameObjectHdl)); @@ -2117,7 +2117,7 @@ void DrawViewShell::FuTemporary(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/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 54b649a1ab30..8d3ea52d9e2e 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -291,11 +291,11 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_INSERT_DATE_TIME: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); + ScopedVclPtr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); if( pDlg ) { pDlg->Execute(); - pDlg.reset(); + pDlg.disposeAndClear(); GetActiveWindow()->Invalidate(); UpdatePreview( mpActualPage ); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index ea7dcb951a4e..20ffe09396f3 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -576,7 +576,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOutlinerView->GetAttribs() ) : nullptr); + ScopedVclPtr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOutlinerView->GetAttribs() ) : nullptr); if( pDlg && (pDlg->Execute() == RET_OK) ) { std::unique_ptr<SvxFieldData> pField(pDlg->GetField()); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 96a5087a4b93..8b6c079989a7 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -880,12 +880,9 @@ bool View::GetExchangeList (std::vector<OUString> &rExchangeList, OUString aDesc(SD_RESSTR(STR_DESC_NAMEGROUP)); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxNameDialog> pDlg; + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact ? pFact->CreateSvxNameDialog(mpViewSh->GetActiveWindow(), aNewName, aDesc) : nullptr); - if (pFact) - pDlg.reset(pFact->CreateSvxNameDialog( mpViewSh->GetActiveWindow(), aNewName, aDesc )); - - if( pDlg ) + if (pDlg) { pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_OBJECT ); diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 9d13885a43d3..ad86ee81b671 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -538,7 +538,7 @@ SfxApplication::ChooseScript() const SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr; uno::Reference< frame::XFrame > xFrame( pFrame ? pFrame->GetFrameInterface() : uno::Reference< frame::XFrame >() ); - std::unique_ptr<AbstractScriptSelectorDialog> pDlg( + ScopedVclPtr<AbstractScriptSelectorDialog> pDlg( pFact->CreateScriptSelectorDialog( nullptr, xFrame )); SAL_INFO( "sfx.appl", "done, now exec it"); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index e9750b4d3dbb..ba810a1781a9 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -424,7 +424,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) if ( pFrameItem ) xFrame = pFrameItem->GetFrame(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateCustomizeTabDialog( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCustomizeTabDialog( &aSet, xFrame )); if ( pDlg ) @@ -1510,7 +1510,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) do // artificial loop for flow control { - std::unique_ptr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog( + ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog( lcl_getDialogParent( xFrame, GetTopWindow() ), xFrame )); OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" ); if ( !pDlg ) @@ -1602,7 +1602,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), false, &pItem ) == SfxItemState::SET ) aSet.Put( *pItem ); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateAutoCorrTabDialog( &aSet )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateAutoCorrTabDialog( &aSet )); pDlg->Execute(); } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 47f15e602c94..61895fbf3cf5 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1728,7 +1728,6 @@ void SmViewShell::Execute(SfxRequest& rReq) { if ( !GetViewFrame()->GetFrame().IsInPlace() ) { - std::unique_ptr<AbstractSvxZoomDialog> xDlg; const SfxItemSet *pSet = rReq.GetArgs(); if ( !pSet ) { @@ -1737,7 +1736,7 @@ void SmViewShell::Execute(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - xDlg.reset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet)); + ScopedVclPtr<AbstractSvxZoomDialog> xDlg(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet)); assert(xDlg); xDlg->SetLimits( MINZOOM, MAXZOOM ); if (xDlg->Execute() != RET_CANCEL) diff --git a/svx/source/dialog/databaseregistrationui.cxx b/svx/source/dialog/databaseregistrationui.cxx index aba6a600e1b9..4827a7580361 100644 --- a/svx/source/dialog/databaseregistrationui.cxx +++ b/svx/source/dialog/databaseregistrationui.cxx @@ -36,9 +36,9 @@ namespace svx SfxItemSet aRegistrationItems( SfxGetpApp()->GetPool(), SID_SB_DB_REGISTER, SID_SB_DB_REGISTER, 0 ); SvxAbstractDialogFactory* pDialogFactory = SvxAbstractDialogFactory::Create(); - std::unique_ptr< SfxAbstractDialog > pDialog; + ScopedVclPtr<SfxAbstractDialog> pDialog; if ( pDialogFactory ) - pDialog.reset( pDialogFactory->CreateSfxDialog( _parentWindow, aRegistrationItems, nullptr, RID_SFXPAGE_DBREGISTER ) ); + pDialog.disposeAndReset( pDialogFactory->CreateSfxDialog( _parentWindow, aRegistrationItems, nullptr, RID_SFXPAGE_DBREGISTER ) ); if ( pDialog.get() ) nResult = pDialog->Execute(); diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx index c0623678000c..df6eb0846eff 100644 --- a/svx/source/dialog/grfflt.cxx +++ b/svx/source/dialog/grfflt.cxx @@ -74,7 +74,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSmooth(pWindow, rGraphic, 0.7)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSmooth(pWindow, rGraphic, 0.7)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); @@ -162,7 +162,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterMosaic(pWindow, rGraphic)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterMosaic(pWindow, rGraphic)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); @@ -175,7 +175,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterEmboss(pWindow, rGraphic)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterEmboss(pWindow, rGraphic)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); @@ -188,7 +188,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterPoster(pWindow, rGraphic)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterPoster(pWindow, rGraphic)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); @@ -226,7 +226,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSepia(pWindow, rGraphic)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSepia(pWindow, rGraphic)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); @@ -239,7 +239,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSolarize(pWindow, rGraphic)); + ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSolarize(pWindow, rGraphic)); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 46b6d776ef6b..3a3c191e5e11 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -95,7 +95,7 @@ namespace svx { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg( pParent, *pBBSet, bEnableBackgroundSelector )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg( pParent, *pBBSet, bEnableBackgroundSelector )); DBG_ASSERT(pDlg, "Dialog creation failed!"); if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() ) { diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index f0c8b0d01868..346fe9b6f217 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -655,7 +655,7 @@ void IMapWindow::DoMacroAssign() aSet.Put( aMacroItem ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, mxDocumentFrame, SID_EVENTCONFIG )); + ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, mxDocumentFrame, SID_EVENTCONFIG )); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK ) { @@ -677,7 +677,7 @@ void IMapWindow::DoPropertyDialog() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractURLDlg> aDlg(pFact->CreateURLDialog( this, pIMapObj->GetURL(), pIMapObj->GetAltText(), pIMapObj->GetDesc(), + ScopedVclPtr<AbstractURLDlg> aDlg(pFact->CreateURLDialog( this, pIMapObj->GetURL(), pIMapObj->GetAltText(), pIMapObj->GetDesc(), pIMapObj->GetTarget(), pIMapObj->GetName(), aTargetList )); DBG_ASSERT(aDlg, "Dialog creation failed!"); if ( aDlg->Execute() == RET_OK ) diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index a035d61abb95..4cea9248a627 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1390,7 +1390,7 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( this, + ScopedVclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( this, pSearchItem->IsLEVRelaxed(), pSearchItem->GetLEVOther(), pSearchItem->GetLEVShorter(), @@ -1413,7 +1413,7 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet, + ScopedVclPtr<AbstractSvxJSearchOptionsDialog> aDlg(pFact->CreateSvxJSearchOptionsDialog( this, aSet, pSearchItem->GetTransliterationFlags() )); DBG_ASSERT(aDlg, "Dialog creation failed!"); int nRet = aDlg->Execute(); @@ -2018,7 +2018,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTabItemDialog(this, aSet)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTabItemDialog(this, aSet)); DBG_ASSERT(pDlg, "Dialog creation failed!"); aTxt = pDlg->GetText() + aTxt; pDlg->SetText( aTxt ); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 130dd4fe6fef..d07db154241f 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -868,7 +868,7 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractFmShowColsDialog> pDlg(pFact->CreateFmShowColsDialog()); + ScopedVclPtr<AbstractFmShowColsDialog> pDlg(pFact->CreateFmShowColsDialog()); DBG_ASSERT(pDlg, "Dialog creation failed!"); pDlg->SetColumns(xCols); pDlg->Execute(); diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index b60024b37f00..30370464bca8 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -740,7 +740,7 @@ void FmFormShell::Execute(SfxRequest &rReq) DBG_ASSERT( pFact, "no dialog factory!" ); if ( pFact ) { - std::unique_ptr< AbstractFmInputRecordNoDialog > dlg( pFact->CreateFmInputRecordNoDialog() ); + ScopedVclPtr< AbstractFmInputRecordNoDialog > dlg( pFact->CreateFmInputRecordNoDialog() ); DBG_ASSERT( dlg.get(), "Dialog creation failed!" ); dlg->SetValue( rController->getCursor()->getRow() ); if ( dlg->Execute() == RET_OK ) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index c1e0b16c0996..5b5381820cb7 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1550,9 +1550,9 @@ void FmXFormShell::ExecuteSearch() // ausgeraeumt sind, sollte hier ein SM_USETHREAD rein, denn die Suche in einem eigenen Thread ist doch etwas fluessiger // sollte allerdings irgendwie von dem unterliegenden Cursor abhaengig gemacht werden, DAO zum Beispiel ist nicht thread-sicher SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractFmSearchDialog> pDialog; + ScopedVclPtr<AbstractFmSearchDialog> pDialog; if ( pFact ) - pDialog.reset(pFact->CreateFmSearchDialog( &m_pShell->GetViewShell()->GetViewFrame()->GetWindow(), strInitialText, aContextNames, nInitialContext, LINK( this, FmXFormShell, OnSearchContextRequest ) )); + pDialog.disposeAndReset(pFact->CreateFmSearchDialog( &m_pShell->GetViewShell()->GetViewFrame()->GetWindow(), strInitialText, aContextNames, nInitialContext, LINK( this, FmXFormShell, OnSearchContextRequest ) )); DBG_ASSERT( pDialog, "FmXFormShell::ExecuteSearch: could not create the search dialog!" ); if ( pDialog ) { @@ -1560,7 +1560,7 @@ void FmXFormShell::ExecuteSearch() pDialog->SetFoundHandler( LINK( this, FmXFormShell, OnFoundData ) ); pDialog->SetCanceledNotFoundHdl( LINK( this, FmXFormShell, OnCanceledNotFound ) ); pDialog->Execute(); - pDialog.reset(); + pDialog.disposeAndClear(); } // GridControls wieder restaurieren diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index c4e4267c47f2..56028365e36a 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -351,7 +351,7 @@ void GalleryBrowser1::ImplExecute( sal_uInt16 nId ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<VclAbstractRefreshableDialog> aActualizeProgress(pFact->CreateActualizeProgressDialog( this, pTheme )); + ScopedVclPtr<VclAbstractRefreshableDialog> aActualizeProgress(pFact->CreateActualizeProgressDialog( this, pTheme )); DBG_ASSERT(aActualizeProgress, "Dialog creation failed!"); aActualizeProgress->Update(); @@ -375,7 +375,7 @@ void GalleryBrowser1::ImplExecute( sal_uInt16 nId ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractTitleDialog> aDlg(pFact->CreateTitleDialog( this, aOldName )); + ScopedVclPtr<AbstractTitleDialog> aDlg(pFact->CreateTitleDialog( this, aOldName )); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) @@ -411,7 +411,7 @@ void GalleryBrowser1::ImplExecute( sal_uInt16 nId ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractGalleryIdDialog> aDlg(pFact->CreateGalleryIdDialog( this, pTheme )); + ScopedVclPtr<AbstractGalleryIdDialog> aDlg(pFact->CreateGalleryIdDialog( this, pTheme )); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index aff553ac7d09..e6160a5f65ed 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -1152,7 +1152,7 @@ void GalleryBrowser2::Execute( sal_uInt16 nId ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractTitleDialog> aDlg(pFact->CreateTitleDialog( this, aOldTitle )); + ScopedVclPtr<AbstractTitleDialog> aDlg(pFact->CreateTitleDialog( this, aOldTitle )); DBG_ASSERT(aDlg, "Dialog creation failed!"); if( aDlg->Execute() == RET_OK ) { diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 11311277f884..bdd86ba25797 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -771,7 +771,7 @@ void SdrEditView::DistributeMarkedObjects() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(aNewAttr)); + ScopedVclPtr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(aNewAttr)); DBG_ASSERT(pDlg, "Dialog creation failed!"); sal_uInt16 nResult = pDlg->Execute(); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index e2a83f1af03f..a612d3fd4e7f 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -917,7 +917,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) aNewAttr.Put( aBoxInfoItem ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr< SfxAbstractTabDialog > xDlg( pFact ? pFact->CreateSvxFormatCellsDialog( &aNewAttr, pTableObj->GetModel(), pTableObj) : nullptr ); + ScopedVclPtr<SfxAbstractTabDialog> xDlg( pFact ? pFact->CreateSvxFormatCellsDialog( &aNewAttr, pTableObj->GetModel(), pTableObj) : nullptr ); // Even Cancel Button is returning positive(101) value, if (xDlg.get() && xDlg->Execute() == RET_OK) { @@ -1244,7 +1244,7 @@ void SvxTableController::SplitMarkedCells() getSelectedCells( aStart, aEnd ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr< SvxAbstractSplittTableDialog > xDlg( pFact ? pFact->CreateSvxSplittTableDialog( nullptr, false, 99 ) : nullptr ); + ScopedVclPtr< SvxAbstractSplittTableDialog > xDlg( pFact ? pFact->CreateSvxSplittTableDialog( nullptr, false, 99 ) : nullptr ); if( xDlg.get() && xDlg->Execute() ) { const sal_Int32 nCount = xDlg->GetCount() - 1; diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index dec00a930cf3..c8c9fe77a6db 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -98,6 +98,8 @@ typedef void (*GlossarySetActGroup)(const OUString& rNewGroup); class AbstractGlossaryDlg : public VclAbstractDialog { +protected: + virtual ~AbstractGlossaryDlg() override = default; public: virtual OUString GetCurrGrpName() const = 0; virtual OUString GetCurrShortName() const = 0; @@ -105,6 +107,8 @@ public: class AbstractFieldInputDlg : public VclAbstractTerminatedDialog { +protected: + virtual ~AbstractFieldInputDlg() override = default; public: //from class SalFrame virtual void SetWindowState( const OString & rStr ) = 0; @@ -114,6 +118,8 @@ public: class AbstractInsFootNoteDlg : public VclAbstractDialog { +protected: + virtual ~AbstractInsFootNoteDlg() override = default; public: virtual OUString GetFontName() = 0; virtual bool IsEndNote() = 0; @@ -125,6 +131,8 @@ public: class AbstractInsTableDlg : public VclAbstractDialog { +protected: + virtual ~AbstractInsTableDlg() override = default; public: virtual void GetValues( OUString& rName, sal_uInt16& rRow, sal_uInt16& rCol, SwInsertTableOptions& rInsTableFlags, OUString& rTableAutoFormatName, @@ -133,6 +141,8 @@ public: class AbstractJavaEditDialog : public VclAbstractDialog { +protected: + virtual ~AbstractJavaEditDialog() override = default; public: virtual OUString GetScriptText() const = 0; virtual OUString GetScriptType() const = 0; @@ -143,6 +153,8 @@ public: class AbstractMailMergeDlg : public VclAbstractDialog { +protected: + virtual ~AbstractMailMergeDlg() override = default; public: virtual DBManagerOptions GetMergeType() = 0; virtual const OUString& GetSaveFilter() const = 0; @@ -156,18 +168,24 @@ public: class AbstractMailMergeCreateFromDlg : public VclAbstractDialog { +protected: + virtual ~AbstractMailMergeCreateFromDlg() override = default; public: virtual bool IsThisDocument() const = 0; }; class AbstractMailMergeFieldConnectionsDlg : public VclAbstractDialog { +protected: + virtual ~AbstractMailMergeFieldConnectionsDlg() override = default; public: virtual bool IsUseExistingConnections() const = 0; }; class AbstractMultiTOXTabDialog : public VclAbstractDialog { +protected: + virtual ~AbstractMultiTOXTabDialog() override = default; public: virtual CurTOXType GetCurrentTOXType() const = 0; virtual SwTOXDescription& GetTOXDescription(CurTOXType eTOXTypes) = 0; @@ -177,17 +195,24 @@ public: class AbstractEditRegionDlg : public VclAbstractDialog { +protected: + virtual ~AbstractEditRegionDlg() override = default; public: virtual void SelectSection(const OUString& rSectionName) = 0; }; + class AbstractInsertSectionTabDialog : public VclAbstractDialog { +protected: + virtual ~AbstractInsertSectionTabDialog() override = default; public: virtual void SetSectionData(SwSectionData const& rSect) = 0; }; class AbstractSwWordCountFloatDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwWordCountFloatDlg() override = default; public: virtual void UpdateCounts() = 0; virtual void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat) = 0; @@ -196,6 +221,8 @@ public: class AbstractSwInsertAbstractDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwInsertAbstractDlg() override = default; public: virtual sal_uInt8 GetLevel() const = 0; virtual sal_uInt8 GetPara() const = 0; @@ -203,6 +230,8 @@ public: class AbstractSwAsciiFilterDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwAsciiFilterDlg() override = default; public: virtual void FillOptions( SwAsciiOptions& rOptions ) = 0; @@ -210,6 +239,8 @@ public: class AbstractSwBreakDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwBreakDlg() override = default; public: virtual OUString GetTemplateName() = 0; virtual sal_uInt16 GetKind() = 0; @@ -219,12 +250,16 @@ public: class AbstractSplitTableDialog : public VclAbstractDialog // add for { +protected: + virtual ~AbstractSplitTableDialog() override = default; public: virtual sal_uInt16 GetSplitMode() = 0; }; class AbstractSwConvertTableDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwConvertTableDlg() override = default; public: virtual void GetValues( sal_Unicode& rDelim, SwInsertTableOptions& rInsTableFlags, @@ -233,8 +268,9 @@ public: class AbstractSwInsertDBColAutoPilot : public VclAbstractDialog { +protected: + virtual ~AbstractSwInsertDBColAutoPilot() override = default; public: - virtual void DataToDoc( const css::uno::Sequence< css::uno::Any >& rSelection, css::uno::Reference< css::sdbc::XDataSource> rxSource, css::uno::Reference< css::sdbc::XConnection> xConnection, @@ -243,13 +279,17 @@ public: class AbstractDropDownFieldDialog : public VclAbstractDialog { +protected: + virtual ~AbstractDropDownFieldDialog() override = default; public: - virtual OString GetWindowState() const = 0; //this method inherit from SystemWindow - virtual void SetWindowState( const OString & rStr ) = 0; //this method inherit from SystemWindow + virtual OString GetWindowState() const = 0; //this method inherit from SystemWindow + virtual void SetWindowState( const OString & rStr ) = 0; //this method inherit from SystemWindow }; class AbstractSwLabDlg : public SfxAbstractTabDialog { +protected: + virtual ~AbstractSwLabDlg() override = default; public: virtual const OUString& GetBusinessCardStr() const = 0; virtual Printer *GetPrt() =0; @@ -257,6 +297,8 @@ public: class AbstractSwSelGlossaryDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwSelGlossaryDlg() override = default; public: virtual void InsertGlos(const OUString &rRegion, const OUString &rGlosName) = 0; // inline virtual sal_Int32 GetSelectedIdx() const = 0; // inline @@ -265,12 +307,16 @@ public: class AbstractSwAutoFormatDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwAutoFormatDlg() override = default; public: virtual void FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const = 0; }; class AbstractSwFieldDlg : public SfxAbstractTabDialog { +protected: + virtual ~AbstractSwFieldDlg() override = default; public: virtual void Start() = 0; //this method from sfxtabdialog virtual void Initialize(SfxChildWinInfo *pInfo) = 0; @@ -282,6 +328,8 @@ public: class AbstractSwRenameXNamedDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwRenameXNamedDlg() override = default; public: virtual void SetForbiddenChars( const OUString& rSet ) = 0; virtual void SetAlternativeAccess( @@ -291,12 +339,16 @@ public: class AbstractSwModalRedlineAcceptDlg : public VclAbstractDialog { +protected: + virtual ~AbstractSwModalRedlineAcceptDlg() override = default; public: virtual void AcceptAll( bool bAccept ) = 0; }; class AbstractMarkFloatDlg : public VclAbstractDialog { +protected: + virtual ~AbstractMarkFloatDlg() override = default; public: virtual void ReInitDlg(SwWrtShell& rWrtShell) = 0; virtual vcl::Window * GetWindow() = 0; //this method is added for return a Window type pointer @@ -311,6 +363,8 @@ class SwMailMergeConfigItem; class AbstractMailMergeWizard : public VclAbstractDialog2 { +protected: + virtual ~AbstractMailMergeWizard() override = default; public: virtual OUString GetReloadDocument() const = 0; virtual bool ShowPage( sal_uInt16 nLevel ) = 0; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index aa7b23d349f7..ff693e87a033 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -767,7 +767,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(pButton, rSh.GetAttrPool(), pTableSet, &rSh)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(pButton, rSh.GetAttrPool(), pTableSet, &rSh)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute() ) pTableSet->Put( *pDlg->GetOutputItemSet() ); @@ -785,7 +785,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, AutoFormatHdl, Button*, pButton, void ) SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(), false, pTAutoFormat)); + ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(), false, pTAutoFormat)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFormatOfIndex( pTAutoFormat ); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 733b42cd1718..c71d33aef81d 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -283,7 +283,7 @@ IMPL_LINK( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void ) OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); const OUString sFormatStr = pColl->GetName(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, SwCharDlgMode::Env, &sFormatStr)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, SwCharDlgMode::Env, &sFormatStr)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (pDlg->Execute() == RET_OK) { diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 4396c1ead502..09cf8a99b6a9 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -328,7 +328,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, Button*, void) SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aSet, pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_ADDR )); OSL_ENSURE(pDlg, "Dialog creation failed!"); diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 591d5d0875fd..c445e95e92cf 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -190,7 +190,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, RenameHdl, Button*, void) uno::Reference<container::XNamed> xNamed(xTmp, uno::UNO_QUERY); SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwRenameXNamedDlg> pDlg(pFact->CreateSwRenameXNamedDlg(this, xNamed, xNameAccess)); + ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(pFact->CreateSwRenameXNamedDlg(this, xNamed, xNameAccess)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetForbiddenChars(BookmarkTable::aForbiddenChars + OUStringLiteral1(BookmarkTable::cSeparator)); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 1eb0027f8449..9d93c26752fb 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -559,7 +559,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) const SfxPoolItem* pItem; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, + ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), SID_EVENTCONFIG )); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK && SfxItemState::SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, false, &pItem ) ) @@ -1040,7 +1040,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxMultiPathDialog> pDlg(pFact->CreateSvxPathSelectDialog(pBtn)); + ScopedVclPtr<AbstractSvxMultiPathDialog> pDlg(pFact->CreateSvxPathSelectDialog(pBtn)); OSL_ENSURE(pDlg, "Dialog creation failed!"); SvtPathOptions aPathOpt; const OUString sGlosPath( aPathOpt.GetAutoTextPath() ); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 791333282791..f441e8bd7644 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -111,7 +111,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl, Button*, void) aAllSet.Put( rFont ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aAllSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aAllSet, rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); if (RET_OK == pDlg->Execute()) { diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 23c37459bb7d..5c781853a02b 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -381,7 +381,7 @@ IMPL_LINK_NOARG(SwSortDlg, DelimCharHdl, Button*, void) { SfxAllItemSet aSet( rSh.GetAttrPool() ); aSet.Put( SfxInt32Item( SID_ATTR_CHAR, GetDelimChar() ) ); - std::unique_ptr<SfxAbstractDialog> pMap(pFact->CreateSfxDialog( m_pDelimPB, aSet, + ScopedVclPtr<SfxAbstractDialog> pMap(pFact->CreateSfxDialog( m_pDelimPB, aSet, rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); if( RET_OK == pMap->Execute() ) { diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 8ddfb70eda79..4c67c428076f 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -202,7 +202,7 @@ IMPL_LINK( SwConvertTableDlg, AutoFormatHdl, Button*, pButton, void ) SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton, pShell, false, pTAutoFormat)); + ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton, pShell, false, pTAutoFormat)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFormatOfIndex( pTAutoFormat ); diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx index deabff20630f..6a9190a34823 100644 --- a/sw/source/ui/table/instable.cxx +++ b/sw/source/ui/table/instable.cxx @@ -201,7 +201,7 @@ IMPL_LINK( SwInsTableDlg, AutoFormatHdl, Button*, pButton, void ) SwAbstractDialogFactory* pFact = swui::GetFactory(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton,pShell, false, pTAutoFormat)); + ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton,pShell, false, pTAutoFormat)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFormatOfIndex( pTAutoFormat ); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 53eaa8742879..286ddc49ed42 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -207,7 +207,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) } vcl::Window *pParent = pOldSh ? pOldSh->GetWin() : nullptr; - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; short nMode = ENV_INSERT; const SwEnvItem* pItem = rReq.GetArg<SwEnvItem>(FN_ENVELOP); @@ -216,7 +216,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwEnvDlg( pParent, aSet, pOldSh, pTempPrinter, !bEnvChange )); + pDlg.disposeAndReset(pFact->CreateSwEnvDlg( pParent, aSet, pOldSh, pTempPrinter, !bEnvChange )); OSL_ENSURE(pDlg, "Dialog creation failed!"); nMode = pDlg->Execute(); } diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 0da222366914..c15fa2e7ea81 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -172,7 +172,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create(); OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwLabDlg> pDlg(pDialogFactory->CreateSwLabDlg(aSet, + ScopedVclPtr<AbstractSwLabDlg> pDlg(pDialogFactory->CreateSwLabDlg(aSet, #if HAVE_FEATURE_DBCONNECTIVITY pDBManager.get(), #else diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 28553126d76d..21c1b4854183 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -695,7 +695,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwInsertAbstractDlg> pDlg(pFact->CreateSwInsertAbstractDlg()); + ScopedVclPtr<AbstractSwInsertAbstractDlg> pDlg(pFact->CreateSwInsertAbstractDlg()); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(RET_OK == pDlg->Execute()) { diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index cd5745715e36..ee02b382a861 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -816,7 +816,7 @@ sal_uInt16 SwDocShell::Edit( SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert( pFact ); - std::unique_ptr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(&GetView()->GetViewFrame()->GetWindow(), + ScopedVclPtr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(&GetView()->GetViewFrame()->GetWindow(), *(xTmp.get()), nFamily, sPage, pActShell ? pActShell : m_pWrtShell, bNew)); assert( pDlg ); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 4315cdda37d7..f21039e95e49 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2957,7 +2957,7 @@ void SwDBManager::InsertText(SwWrtShell& rSh, SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert( pFact && "Factory creation failed!" ); - std::unique_ptr<AbstractSwInsertDBColAutoPilot> pDlg(pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(), + ScopedVclPtr<AbstractSwInsertDBColAutoPilot> pDlg(pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(), xSource, xColSupp, aDBData )); diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 6bd43d628e78..7bd9780ef9c3 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -83,7 +83,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( + ScopedVclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( &GetView().GetViewFrame()->GetWindow(), aSet , rSh)); OSL_ENSURE(aTabDlg, "Dialog creation failed!"); aTabDlg->Execute(); @@ -194,7 +194,7 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( + ScopedVclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( &GetView().GetViewFrame()->GetWindow(),aSet , *this)); OSL_ENSURE(aTabDlg, "Dialog creation failed!"); aTabDlg->SetSectionData(*xSectionData); @@ -219,7 +219,7 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractEditRegionDlg> pEditRegionDlg(pFact->CreateEditRegionDlg(pParentWin, rWrtShell)); + ScopedVclPtr<AbstractEditRegionDlg> pEditRegionDlg(pFact->CreateEditRegionDlg(pParentWin, rWrtShell)); OSL_ENSURE(pEditRegionDlg, "Dialog creation failed!"); if(pItem && dynamic_cast< const SfxStringItem *>( pItem ) != nullptr) { diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 0bc99dae7cc5..07b5a7a4e415 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -76,7 +76,7 @@ void SwGlossaryHdl::GlossaryDlg() { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractGlossaryDlg> pDlg(pFact->CreateGlossaryDlg(pViewFrame, this, pWrtShell)); + ScopedVclPtr<AbstractGlossaryDlg> pDlg(pFact->CreateGlossaryDlg(pViewFrame, this, pWrtShell)); assert(pDlg && "Dialog creation failed!"); OUString sName; OUString sShortName; @@ -87,7 +87,7 @@ void SwGlossaryHdl::GlossaryDlg() sShortName = pDlg->GetCurrShortName(); } - pDlg.reset(); + pDlg.disposeAndClear(); DELETEZ(pCurGrp); if(HasGlossaryList()) { @@ -437,7 +437,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwSelGlossaryDlg> pDlg(pFact->CreateSwSelGlossaryDlg(aShortName)); + ScopedVclPtr<AbstractSwSelGlossaryDlg> pDlg(pFact->CreateSwSelGlossaryDlg(aShortName)); assert(pDlg && "Dialog creation failed!"); for(TextBlockInfo_Impl & i : aFoundArr) { @@ -447,7 +447,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, const sal_Int32 nRet = RET_OK == pDlg->Execute()? pDlg->GetSelectedIdx(): LISTBOX_ENTRY_NOTFOUND; - pDlg.reset(); + pDlg.disposeAndClear(); if(LISTBOX_ENTRY_NOTFOUND != nRet) { TextBlockInfo_Impl* pData = &aFoundArr[nRet]; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 36e01d17d640..6b65412c8cfb 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2878,7 +2878,7 @@ bool SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rDat { bool bRet = false; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() )); DataFlavorExVector aFormats( rData.GetDataFlavorExVector() ); TransferableObjectDescriptor aDesc; diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 2c1fd60a5d28..f5316cce0f26 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1435,14 +1435,14 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView) SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END); aDlgAttr.Put(aEditAttr); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann)); sal_uInt16 nRet = pDlg->Execute(); if (RET_OK == nRet) { aDlgAttr.Put(*pDlg->GetOutputItemSet()); FormatAll(aDlgAttr); } - pDlg.reset(); + pDlg.disposeAndClear(); SetActiveSidebarWin(pOrigActiveWin); } diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index dc708139d7e1..891c245d35f9 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -1099,7 +1099,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl, SvSimpleTable*, void) rRedline.GetRedlineData().GetTimeStamp() ), SID_ATTR_POSTIT_DATE )); - std::unique_ptr<AbstractSvxPostItDialog> pDlg(pFact->CreateSvxPostItDialog( m_pParentDlg, aSet )); + ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact->CreateSvxPostItDialog( m_pParentDlg, aSet )); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->HideAuthor(); @@ -1139,7 +1139,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl, SvSimpleTable*, void) m_pTable->SetEntryText(sMsg.replace('\n', ' '), pEntry, 3); } - pDlg.reset(); + pDlg.disposeAndClear(); SwViewShell::SetCareWin(nullptr); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index dc5f43c47f1d..d2b0172215f0 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -490,7 +490,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (nSlot == SID_CHAR_DLG_EFFECT) { @@ -544,7 +544,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr, true )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr, true )); OSL_ENSURE(pDlg, "Dialog creation failed!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) @@ -917,7 +917,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq) if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rView.GetEditWin() )); + ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rView.GetEditWin() )); pDlg->Insert( SotClipboardFormatId::STRING, OUString() ); pDlg->Insert( SotClipboardFormatId::RTF, OUString() ); @@ -1728,7 +1728,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) aAllSet.Put( SfxStringItem( SID_FONT_NAME, aSetDlgFont.GetFamilyName() ) ); // If character is selected then it can be shown. - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); sal_uInt16 nResult = pDlg->Execute(); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index ea45810304be..7eb5f48de822 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -857,7 +857,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwConvertTableDlg> pDlg(pFact->CreateSwConvertTableDlg(GetView(), bToTable)); + ScopedVclPtr<AbstractSwConvertTableDlg> pDlg(pFact->CreateSwConvertTableDlg(GetView(), bToTable)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute() ) { @@ -2435,7 +2435,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) RES_BOX , RES_SHADOW, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); - std::unique_ptr<SfxAbstractDialog> pDlg; + ScopedVclPtr<SfxAbstractDialog> pDlg; // Table cell(s) selected? if ( rSh.IsTableMode() ) { @@ -2445,7 +2445,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::TABLE )); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::TABLE )); OSL_ENSURE(pDlg, "Dialog creation failed!"); if ( pDlg->Execute() == RET_OK ) { @@ -2462,7 +2462,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::FRAME )); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::FRAME )); OSL_ENSURE(pDlg, "Dialog creation failed!"); if ( pDlg->Execute() == RET_OK ) { @@ -2480,7 +2480,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::PARA )); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::PARA )); OSL_ENSURE(pDlg, "Dialog creation failed!"); if ( pDlg->Execute() == RET_OK ) { @@ -2500,7 +2500,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SfxItemSet aSet( rSh.GetAttrPool(), RES_BACKGROUND, RES_BACKGROUND ); - std::unique_ptr<SfxAbstractDialog> pDlg; + ScopedVclPtr<SfxAbstractDialog> pDlg; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); @@ -2510,7 +2510,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) // Get background attributes of the table and put it in the set SvxBrushItem aBrush(RES_BACKGROUND); rSh.GetBoxBackground( aBrush ); - pDlg.reset(pFact->CreateSfxDialog( pMDI, aSet, + pDlg.disposeAndReset(pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND )); OSL_ENSURE(pDlg, "Dialog creation failed!"); @@ -2528,7 +2528,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) rSh.GetFlyFrameAttr( aSet ); - pDlg.reset(pFact->CreateSfxDialog( pMDI, aSet, + pDlg.disposeAndReset(pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND )); OSL_ENSURE(pDlg, "Dialog creation failed!"); @@ -2543,7 +2543,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) // Set border attributes Umrandungsattribute with the shell quite normal. rSh.GetCurAttr( aSet ); - pDlg.reset(pFact->CreateSfxDialog( pMDI, aSet, + pDlg.disposeAndReset(pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND )); OSL_ENSURE(pDlg, "Dialog creation failed!"); @@ -2656,7 +2656,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractInsTableDlg> pDlg(pFact->CreateInsTableDlg(rTempView)); + ScopedVclPtr<AbstractInsTableDlg> pDlg(pFact->CreateInsTableDlg(rTempView)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK == pDlg->Execute() ) { diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index de5e992ad4e9..9f0007ee5da0 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -55,7 +55,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, pView )); sal_uInt16 nResult = pDlg->Execute(); if (nResult == RET_OK) @@ -77,7 +77,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) bool bHasMarked = pView->AreObjectsMarked(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( nullptr, + ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( nullptr, &aNewAttr, pDoc, true)); @@ -119,7 +119,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( nullptr, + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( nullptr, &aNewAttr, pDoc, pObj, diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 9f3145a805ca..424b6c67e5f3 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -148,7 +148,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSwWrapDlg( GetView().GetWindow(), aSet, pSh )); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSwWrapDlg( GetView().GetWindow(), aSet, pSh )); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (pDlg->Execute() == RET_OK) @@ -182,7 +182,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if( rMarkList.GetMark(0) != nullptr ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; bool bCaption = false; // Allowed anchorages: @@ -202,7 +202,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) AbstractSvxCaptionDialog* pCaptionDlg = pFact->CreateCaptionDialog( nullptr, pSdrView, nAllowedAnchors ); pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); - pDlg.reset(pCaptionDlg); + pDlg.disposeAndReset(pCaptionDlg); } else { @@ -210,7 +210,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) AbstractSvxTransformTabDialog* pTransform = pFact->CreateSvxTransformTabDialog( nullptr, nullptr, pSdrView, nAllowedAnchors ); pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); - pDlg.reset(pTransform); + pDlg.disposeAndReset(pTransform); } SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked()); @@ -522,7 +522,7 @@ void SwDrawBaseShell::Execute(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, SwDrawBaseShell, CheckGroupShapeNameHdl)); @@ -552,7 +552,7 @@ void SwDrawBaseShell::Execute(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/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 8ff6feabf82a..05b62169cacc 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -345,7 +345,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, SwCharDlgMode::Draw)); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, SwCharDlgMode::Draw)); assert(pDlg && "Dialog creation failed!"); if (nSlot == SID_CHAR_DLG_EFFECT) { @@ -422,7 +422,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr, true )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr, true )); assert(pDlg && "Dialog creation failed!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 6eb617cf61b7..c159843cb73c 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -463,7 +463,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( &(GetView().GetViewFrame()->GetWindow()), &aNewAttr, pSdrView )); sal_uInt16 nResult = pDlg->Execute(); @@ -749,7 +749,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) // If character is selected, it can be shown SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( rView.GetWindow(), aAllSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); sal_uInt16 nResult = pDlg->Execute(); if( nResult == RET_OK ) diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 7d05b7260391..6406fcada123 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -465,7 +465,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog( + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog( nSel & nsSelectionType::SEL_GRF ? OUString("PictureDialog") : nSel & nsSelectionType::SEL_OLE ? OUString("ObjectDialog"): OUString("FrameDialog"), @@ -623,7 +623,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact); - std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg( + ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg( pFact->CreateSvxObjectTitleDescDialog( aTitle, aDescription )); assert(pDlg); @@ -1263,7 +1263,7 @@ void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact); - std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( + ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( nullptr, &aNewAttr, pDoc, diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index db916633f505..91307fbcf658 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -348,7 +348,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "no dialog factory!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("PictureDialog", + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("PictureDialog", GetView().GetViewFrame(), GetView().GetWindow(), aSet, false)); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 7c5875a5c375..3a43c67efbde 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -595,12 +595,12 @@ void SwTableShell::Execute(SfxRequest &rReq) else aCoreSet.InvalidateItem( RES_BACKGROUND ); - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwTableTabDlg(GetView().GetWindow(), GetPool(), &aCoreSet, &rSh)); + pDlg.disposeAndReset(pFact->CreateSwTableTabDlg(GetView().GetWindow(), GetPool(), &aCoreSet, &rSh)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (pItem) @@ -620,7 +620,7 @@ void SwTableShell::Execute(SfxRequest &rReq) ItemSetToTableParam( *pOutSet, rSh ); } - pDlg.reset(); + pDlg.disposeAndClear(); pTableRep.reset(); rBindings.Update(SID_RULER_BORDERS); rBindings.Update(SID_ATTR_TABSTOP); @@ -673,7 +673,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, pView->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG )); OSL_ENSURE(pDlg, "Dialog creation failed!"); @@ -823,7 +823,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh)); + ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); break; @@ -947,7 +947,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : nullptr); + ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : nullptr); if( pDlg.get() && (pDlg->Execute() == 1) ) { @@ -986,7 +986,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if( pFact ) { const long nMaxVert = rSh.GetAnyCurRect( RECT_FRM ).Width() / MINLAY; - std::unique_ptr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog( GetView().GetWindow(), rSh.IsTableVertical(), nMaxVert )); + ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog( GetView().GetWindow(), rSh.IsTableVertical(), nMaxVert )); if( pDlg && (pDlg->Execute() == RET_OK) ) { nCount = pDlg->GetCount(); @@ -1031,7 +1031,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog( GetView().GetWindow(), rSh )); + ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog( GetView().GetWindow(), rSh )); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) ); diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index c96d62c48030..d84b9e437eaa 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -139,7 +139,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if(rLink.IsVisible()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( pMDI, &rSh.GetLinkManager(), false, &rLink )); + ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( pMDI, &rSh.GetLinkManager(), false, &rLink )); if ( pDlg ) { pDlg->Execute(); @@ -152,7 +152,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSwFieldEditDlg( GetView() )); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSwFieldEditDlg( GetView() )); assert(pDlg && "Dialog creation failed!"); pDlg->Execute(); } @@ -497,7 +497,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create(); assert(pFact2 && "Dialog creation failed!"); - std::unique_ptr<AbstractSvxPostItDialog> pDlg(pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel )); + ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel )); assert(pDlg && "Dialog creation failed!"); pDlg->HideAuthor(); @@ -522,7 +522,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) rSh.SetRedlineComment(sMsg); } - pDlg.reset(); + pDlg.disposeAndClear(); SwViewShell::SetCareWin(nullptr); g_bNoInterrupt = false; rSh.ClearMark(); @@ -556,7 +556,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractJavaEditDialog> pDlg(pFact->CreateJavaEditDialog(pMDI, &rSh)); + ScopedVclPtr<AbstractJavaEditDialog> pDlg(pFact->CreateJavaEditDialog(pMDI, &rSh)); assert(pDlg && "Dialog creation failed!"); if ( pDlg->Execute() ) { diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 8aab95d1a405..7f88652d229d 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -138,7 +138,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog( + ScopedVclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog( pMDI, aSet, rSh, const_cast<SwTOXBase*>(pCurTOX), bGlobal)); OSL_ENSURE(pDlg, "Dialog creation failed!"); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 2db970ded529..e8c51072e43f 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -479,7 +479,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("FrameDialog", + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("FrameDialog", GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet)); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index efab29c75f79..e6bbef6044ef 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -167,13 +167,13 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const ::PrepareBoxInfo( aCoreSet, rWrtSh ); aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(rWrtSh.GetView().GetDocShell()))); - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; if ( bUseDialog && GetActiveView() ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, SwCharDlgMode::Std)); + pDlg.disposeAndReset(pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, SwCharDlgMode::Std)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( FN_INSERT_HYPERLINK == nSlot ) pDlg->SetCurPageId("hyperlink"); @@ -484,7 +484,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractInsFootNoteDlg> pDlg(pFact->CreateInsFootNoteDlg( + ScopedVclPtr<AbstractInsFootNoteDlg> pDlg(pFact->CreateInsFootNoteDlg( GetView().GetWindow(), rWrtSh)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetHelpId(GetStaticInterface()->GetSlot(nSlot)->GetCommand()); @@ -568,7 +568,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwBreakDlg> pDlg(pFact->CreateSwBreakDlg(GetView().GetWindow(), rWrtSh)); + ScopedVclPtr<AbstractSwBreakDlg> pDlg(pFact->CreateSwBreakDlg(GetView().GetWindow(), rWrtSh)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if ( pDlg->Execute() == RET_OK ) { @@ -658,7 +658,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwModalRedlineAcceptDlg> pDlg(pFact->CreateSwModalRedlineAcceptDlg(&GetView().GetEditWin())); + ScopedVclPtr<AbstractSwModalRedlineAcceptDlg> pDlg(pFact->CreateSwModalRedlineAcceptDlg(&GetView().GetEditWin())); OSL_ENSURE(pDlg, "Dialog creation failed!"); switch (lcl_AskRedlineFlags(&GetView().GetEditWin())) @@ -989,7 +989,7 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.GetNodeNumStart( pPaM ) ); aCoreSet.Put(aStartAt); } - std::unique_ptr<SfxAbstractTabDialog> pDlg; + ScopedVclPtr<SfxAbstractTabDialog> pDlg; if ( bUseDialog && GetActiveView() ) { @@ -1000,7 +1000,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet, false, sDefPage )); + pDlg.disposeAndReset(pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet, false, sDefPage )); OSL_ENSURE(pDlg, "Dialog creation failed!"); } SfxItemSet* pSet = nullptr; diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx index 48ebf4406298..52797e5646bd 100644 --- a/sw/source/uibase/shells/textsh2.cxx +++ b/sw/source/uibase/shells/textsh2.cxx @@ -260,7 +260,7 @@ IMPL_LINK( SwBaseShell, InsertDBTextHdl, void*, p, void ) SwDBData aDBData = pDBStruct->aDBData; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwInsertDBColAutoPilot>pDlg (pFact->CreateSwInsertDBColAutoPilot(GetView(), + ScopedVclPtr<AbstractSwInsertDBColAutoPilot>pDlg (pFact->CreateSwInsertDBColAutoPilot(GetView(), xSource, xColSupp, aDBData)); diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 2b60c501445b..0358c575001c 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -486,8 +486,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( GetView().GetWindow(), aSet, - rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS )); + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( GetView().GetWindow(), aSet, + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if (pDlg->Execute() == RET_OK) { diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index fa346dbc9479..ff8f60ba4c25 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -183,7 +183,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, GetView().GetWindow(), &aSet, GetShell())); OSL_ENSURE(pDlg, "Dialog creation failed!"); const SfxStringItem* pPageItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1); diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 3d4c783e08d8..a30321c93651 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -758,7 +758,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) { const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - std::unique_ptr<AbstractSvxZoomDialog> pDlg; + ScopedVclPtr<AbstractSvxZoomDialog> pDlg; if(!pArgs) { SfxItemSet aCoreSet(GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM); @@ -777,7 +777,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg.reset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet)); + pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet)); OSL_ENSURE(pDlg, "Dialog creation failed!"); } diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index b242e4314709..419fbea415f0 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -616,11 +616,11 @@ void SwView::ExecNumberingOutline(SfxItemPool & rPool) SfxItemSet aTmp(rPool, FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, GetWindow(), &aTmp, GetWrtShell())); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); - pDlg.reset(); + pDlg.disposeAndClear(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 531b9234bbb2..4620da0eb15f 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1681,7 +1681,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SfxItemSet *pSet = nullptr; - std::unique_ptr<AbstractSvxZoomDialog> pDlg; + ScopedVclPtr<AbstractSvxZoomDialog> pDlg; if ( pArgs ) pSet = pArgs; else @@ -1711,7 +1711,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg.reset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet)); + pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet)); OSL_ENSURE(pDlg, "Zooming fail!"); if (pDlg) { @@ -1914,7 +1914,7 @@ void SwView::EditLinkDlg() { bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( &GetViewFrame()->GetWindow(), &GetWrtShell().GetLinkManager(), bWeb )); + ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog( &GetViewFrame()->GetWindow(), &GetWrtShell().GetLinkManager(), bWeb )); if ( pDlg ) { pDlg->Execute(); diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index f6a1a585b50a..5ac4f9f7547c 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -576,13 +576,13 @@ void SwView::StartThesaurus() SpellError( eLang ); else { - std::unique_ptr<AbstractThesaurusDialog> pDlg; + ScopedVclPtr<AbstractThesaurusDialog> pDlg; // create dialog { //Scope for SwWait-Object SwWait aWait( *GetDocShell(), true ); // load library with dialog only on demand ... SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - pDlg.reset(pFact->CreateThesaurusDialog( &GetEditWin(), xThes, aTmp, eLang )); + pDlg.disposeAndReset(pFact->CreateThesaurusDialog( &GetEditWin(), xThes, aTmp, eLang )); } if ( pDlg->Execute()== RET_OK ) diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx index f3a54efab12f..f14ee60c28dc 100644 --- a/sw/source/uibase/uno/SwXFilterOptions.cxx +++ b/sw/source/uibase/uno/SwXFilterOptions.cxx @@ -108,7 +108,7 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException, std::excepti SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwAsciiFilterDlg> pAsciiDlg(pFact->CreateSwAsciiFilterDlg(*pDocShell, + ScopedVclPtr<AbstractSwAsciiFilterDlg> pAsciiDlg(pFact->CreateSwAsciiFilterDlg(*pDocShell, pInStream.get())); OSL_ENSURE(pAsciiDlg, "Dialog creation failed!"); if(RET_OK == pAsciiDlg->Execute()) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index cb3c75d29566..28d2711f3321 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3225,7 +3225,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, EditEntryMode nMode) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractSwRenameXNamedDlg> pDlg(pFact->CreateSwRenameXNamedDlg(this, xNamed, xNameAccess)); + ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(pFact->CreateSwRenameXNamedDlg(this, xNamed, xNameAccess)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(xSecond.is()) pDlg->SetAlternativeAccess( xSecond, xThird); diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 04080662b2dc..06f44efccf7f 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -893,7 +893,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - std::unique_ptr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog( + ScopedVclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog( this, aSet, *pActiveShell, nullptr, diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index 5ecdbd8bd649..db6b190509cf 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -395,7 +395,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox&, rBox, void ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aCoreSet, + ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aCoreSet, GetView()->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG )); OSL_ENSURE(pDlg, "Dialog creation failed!"); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 54fdfd64665c..7695865d8e16 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -377,7 +377,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName OString aCmd(".uno:"); aCmd += pSlot->GetUnoName(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SfxAbstractInsertObjectDialog> pDlg( pFact->CreateInsertObjectDialog( GetWin(), OUString::fromUtf8( aCmd ), xStor, &aServerList )); + ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( pFact->CreateInsertObjectDialog( GetWin(), OUString::fromUtf8( aCmd ), xStor, &aServerList )); if ( pDlg ) { pDlg->Execute(); diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index c9690a44af7e..ac17db298931 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -233,7 +233,7 @@ bool SwWrtShell::StartInputFieldDlg( SwField* pField, bool bNextButton, SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractFieldInputDlg> pDlg(pFact->CreateFieldInputDlg(pParentWin, *this, pField, bNextButton)); + ScopedVclPtr<AbstractFieldInputDlg> pDlg(pFact->CreateFieldInputDlg(pParentWin, *this, pField, bNextButton)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(pWindowState && !pWindowState->isEmpty()) pDlg->SetWindowState(*pWindowState); @@ -248,7 +248,7 @@ bool SwWrtShell::StartInputFieldDlg( SwField* pField, bool bNextButton, if(pWindowState) *pWindowState = pDlg->GetWindowState(); - pDlg.reset(); + pDlg.disposeAndClear(); GetWin()->Update(); return bRet; } @@ -258,14 +258,14 @@ bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bNextButton, OStrin SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<AbstractDropDownFieldDialog> pDlg(pFact->CreateDropDownFieldDialog(*this, pField, bNextButton)); + ScopedVclPtr<AbstractDropDownFieldDialog> pDlg(pFact->CreateDropDownFieldDialog(*this, pField, bNextButton)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(pWindowState && !pWindowState->isEmpty()) pDlg->SetWindowState(*pWindowState); const short nRet = pDlg->Execute(); if(pWindowState) *pWindowState = pDlg->GetWindowState(); - pDlg.reset(); + pDlg.disposeAndClear(); bool bRet = RET_CANCEL == nRet; GetWin()->Update(); if(RET_YES == nRet) diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index e9eaa374a294..3edace12ce76 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -529,7 +529,7 @@ executePasswordDialog( VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, nMaxPasswdLen, bIsPasswordToModify ); - std::unique_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); + ScopedVclPtr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); rInfo.SetPassword( pDialog->GetPasswordToOpen() ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index e624ed55422b..d77de1b93174 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -311,7 +311,7 @@ void VclContainer::Command(const CommandEvent& rCEvt) AbstractScreenshotAnnotationDlg* pTmp = pFact->CreateScreenshotAnnotationDlg( Application::GetDefDialogParent(), *pParentDialog); - std::unique_ptr< AbstractScreenshotAnnotationDlg > pDialog(pTmp); + ScopedVclPtr<AbstractScreenshotAnnotationDlg> pDialog(pTmp); if (pDialog) { |