diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-07 09:26:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-07 12:39:11 +0100 |
commit | 5404f75a2fa863b97bdf8432f647053f0bff726e (patch) | |
tree | 119d2cede534f5ce1173422df99a0e532d6a7a28 /svtools | |
parent | 39efec060719bb2654ba20844ba02429371a4ffb (diff) |
loplugin:collapseif in sdext..svx
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f
Reviewed-on: https://gerrit.libreoffice.org/62985
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 7 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 29 | ||||
-rw-r--r-- | svtools/source/dialogs/prnsetup.cxx | 7 | ||||
-rw-r--r-- | svtools/source/uno/addrtempuno.cxx | 5 |
4 files changed, 16 insertions, 32 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index a5c1a1ac25bf..10f4c0e6f63f 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -498,11 +498,8 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, bool bSmart if (m_pImpl) aRet = m_pImpl->GetColorConfigValue(eEntry); - if (bSmart) - { - if(aRet.nColor == COL_AUTO) - aRet.nColor = ColorConfig::GetDefaultColor(eEntry); - } + if (bSmart && aRet.nColor == COL_AUTO) + aRet.nColor = ColorConfig::GetDefaultColor(eEntry); return aRet; } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 04d3622ed4ec..25bdbe3607d9 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -500,13 +500,10 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) { mbHasVisibleItems = false; - if (nStyle & WB_NONEFIELD) + if ((nStyle & WB_NONEFIELD) && mpNoneItem) { - if (mpNoneItem) - { - mpNoneItem->mbVisible = false; - mpNoneItem->maText = GetText(); - } + mpNoneItem->mbVisible = false; + mpNoneItem->maText = GetText(); } for (size_t i = 0; i < nItemCount; i++) @@ -1084,14 +1081,11 @@ void ValueSet::ImplTracking( const Point& rPos, bool bRepeat ) { if ( bRepeat || mbSelection ) { - if ( ImplScroll( rPos ) ) + if ( ImplScroll( rPos ) && mbSelection ) { - if ( mbSelection ) - { - maTimer.SetInvokeHandler( LINK( this, ValueSet, ImplTimerHdl ) ); - maTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() ); - maTimer.Start(); - } + maTimer.SetInvokeHandler( LINK( this, ValueSet, ImplTimerHdl ) ); + maTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() ); + maTimer.Start(); } } @@ -3113,13 +3107,10 @@ void SvtValueSet::Format(vcl::RenderContext const & rRenderContext) { mbHasVisibleItems = false; - if (nStyle & WB_NONEFIELD) + if ((nStyle & WB_NONEFIELD) && mpNoneItem) { - if (mpNoneItem) - { - mpNoneItem->mbVisible = false; - mpNoneItem->maText = GetText(); - } + mpNoneItem->mbVisible = false; + mpNoneItem->maText = GetText(); } for (size_t i = 0; i < nItemCount; i++) diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 31af8385e797..b7baf49b85cb 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -332,11 +332,8 @@ short PrinterSetupDialog::run() short nRet = GenericDialogController::run(); // update data if the dialog was terminated with OK - if ( nRet == RET_OK ) - { - if ( mpTempPrinter ) - mpPrinter->SetPrinterProps( mpTempPrinter ); - } + if ( nRet == RET_OK && mpTempPrinter ) + mpPrinter->SetPrinterProps( mpTempPrinter ); maStatusTimer.Stop(); diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index e6d1bc4b056e..e2d585642b59 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -130,9 +130,8 @@ namespace { { OGenericUnoDialog::executedDialog(_nExecutionResult); - if ( _nExecutionResult ) - if ( m_aDialog ) - static_cast< AddressBookSourceDialog* >( m_aDialog.m_xVclDialog.get() )->getFieldMapping( m_aAliases ); + if ( _nExecutionResult && m_aDialog ) + static_cast< AddressBookSourceDialog* >( m_aDialog.m_xVclDialog.get() )->getFieldMapping( m_aAliases ); } void SAL_CALL OAddressBookSourceDialogUno::initialize(const Sequence< Any >& rArguments) |