diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-27 20:55:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-28 09:08:50 +0000 |
commit | 117fc49c979d65e5479635eab3ce10d74d076679 (patch) | |
tree | 9dbfee8cc04b2bf6f5eab0522ed9270de0d14a5c /cui/source/dialogs | |
parent | 8f0f5e0c709d01555a4069f8665889924ed181c7 (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 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/cuifmsearch.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
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(); |