diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-31 08:29:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-12 08:24:04 +0200 |
commit | 51c879d8649c7aad7a0c9be0c7ea042d041254d8 (patch) | |
tree | d454d885be767ba7d113547b1fa91ee85cabcf6a /cui/source/options/optlingu.cxx | |
parent | af66cd6e0809982d61b962fbcf2042981084f770 (diff) |
simplify calls to *DialogFactory::Create methods
we don't need to check for nullptr here, it's never null.
Change-Id: I3cc5337a8f4dec6747821679e39ccba3cec20f56
Reviewed-on: https://gerrit.libreoffice.org/55114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/options/optlingu.cxx')
-rw-r--r-- | cui/source/options/optlingu.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 20018047d8af..6ee8ea97aa67 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1491,22 +1491,19 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) else if (m_pLinguDicsNewPB == pBtn) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if(pFact) + ScopedVclPtr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog(GetFrameWeld())); + uno::Reference< XDictionary > xNewDic; + if ( aDlg->Execute() == RET_OK ) + xNewDic.set( aDlg->GetNewDictionary(), UNO_QUERY ); + if ( xNewDic.is() ) { - ScopedVclPtr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog(GetFrameWeld())); - uno::Reference< XDictionary > xNewDic; - if ( aDlg->Execute() == RET_OK ) - xNewDic.set( aDlg->GetNewDictionary(), UNO_QUERY ); - if ( xNewDic.is() ) - { - // add new dics to the end - sal_Int32 nLen = aDics.getLength(); - aDics.realloc( nLen + 1 ); + // add new dics to the end + sal_Int32 nLen = aDics.getLength(); + aDics.realloc( nLen + 1 ); - aDics.getArray()[ nLen ] = xNewDic; + aDics.getArray()[ nLen ] = xNewDic; - AddDicBoxEntry( xNewDic, static_cast<sal_uInt16>(nLen) ); - } + AddDicBoxEntry( xNewDic, static_cast<sal_uInt16>(nLen) ); } } else if (m_pLinguDicsEditPB == pBtn) @@ -1524,11 +1521,8 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) if (xDic.is()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if(pFact) - { - ScopedVclPtr<VclAbstractDialog> aDlg(pFact->CreateSvxEditDictionaryDialog( this, xDic->getName() )); - aDlg->Execute(); - } + ScopedVclPtr<VclAbstractDialog> aDlg(pFact->CreateSvxEditDictionaryDialog( this, xDic->getName() )); + aDlg->Execute(); } } } |