summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-27 20:55:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-28 09:08:50 +0000
commit117fc49c979d65e5479635eab3ce10d74d076679 (patch)
tree9dbfee8cc04b2bf6f5eab0522ed9270de0d14a5c /svx
parent8f0f5e0c709d01555a4069f8665889924ed181c7 (diff)
ScopedVclPtr vs std::unique_ptr for VclAbstractDialog derivatives
Change-Id: I5e43312b6f42ce0c63946f366eaf1e6dcb9629b2 Reviewed-on: https://gerrit.libreoffice.org/30344 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/databaseregistrationui.cxx4
-rw-r--r--svx/source/dialog/grfflt.cxx12
-rw-r--r--svx/source/dialog/hdft.cxx2
-rw-r--r--svx/source/dialog/imapwnd.cxx4
-rw-r--r--svx/source/dialog/srchdlg.cxx6
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx2
-rw-r--r--svx/source/form/fmshell.cxx2
-rw-r--r--svx/source/form/fmshimp.cxx6
-rw-r--r--svx/source/gallery2/galbrws1.cxx6
-rw-r--r--svx/source/gallery2/galbrws2.cxx2
-rw-r--r--svx/source/svdraw/svdedtv2.cxx2
-rw-r--r--svx/source/table/tablecontroller.cxx4
12 files changed, 26 insertions, 26 deletions
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;