diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:25:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:19 +0200 |
commit | 4f4859b62ea5f72248a0daba88654a67108ebf6e (patch) | |
tree | fcd425a1f44b5967d4419e38763a88b392d6b99b /cui/source | |
parent | cf7f31c1d631eaec22ea89466f7639adf9ed620f (diff) |
loplugin:simplifybool
Change-Id: Idd83e86cabc9c9075564fc79f91a59f54116bf95
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/cuifmsearch.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/cuihyperdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/connpooloptions.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 8 |
7 files changed, 16 insertions, 18 deletions
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index 15ba21a468d6..6f3643d3a772 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -437,9 +437,9 @@ IMPL_LINK(FmSearchDialog, OnCheckBoxToggled, CheckBox*, pBox) } // pass on to the engine - m_pSearchEngine->SetWildcard(m_pcbWildCard->IsEnabled() ? m_pcbWildCard->IsChecked() : false); - m_pSearchEngine->SetRegular(m_pcbRegular->IsEnabled() ? m_pcbRegular->IsChecked() : false); - m_pSearchEngine->SetLevenshtein(m_pcbApprox->IsEnabled() ? m_pcbApprox->IsChecked() : false); + m_pSearchEngine->SetWildcard(m_pcbWildCard->IsEnabled() && m_pcbWildCard->IsChecked()); + m_pSearchEngine->SetRegular(m_pcbRegular->IsEnabled() && m_pcbRegular->IsChecked()); + m_pSearchEngine->SetLevenshtein(m_pcbApprox->IsEnabled() && m_pcbApprox->IsChecked()); // (disabled boxes have to be passed to the engine as sal_False) // adjust the Position-Listbox (which is not allowed during Wildcard-search) diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 053196c25a5d..41dc5a1be98b 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -330,7 +330,7 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(GetTabPage( nPageId )); - mbIsHTMLDoc = (pItem->GetInsertMode() & HLINK_HTMLMODE) ? true : false; + mbIsHTMLDoc = (pItem->GetInsertMode() & HLINK_HTMLMODE) != 0; IconChoicePage* pPage = GetTabPage (nPageId); if(pPage) diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 95c5990d4a5a..058f9a69c917 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -338,7 +338,7 @@ namespace offapp // the enabled flag SFX_ITEMSET_GET( _rSet, pEnabled, SfxBoolItem, SID_SB_POOLING_ENABLED, true ); OSL_ENSURE(pEnabled, "ConnectionPoolOptionsPage::implInitControls: missing the Enabled item!"); - m_pEnablePooling->Check(pEnabled ? pEnabled->GetValue() : true); + m_pEnablePooling->Check(pEnabled == nullptr || pEnabled->GetValue()); m_pEnablePooling->SaveValue(); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index b31d3a1030ae..1fe7aed107ca 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -1463,7 +1463,7 @@ IMPL_LINK( SvxBackgroundTabPage, LoadIdleHdl_Impl, Idle* , pIdle ) // new file chosen aBgdGraphicPath = pImportDlg->GetPath(); aBgdGraphicFilter = pImportDlg->GetCurrentFilter(); - bool bLink = ( nHtmlMode & HTMLMODE_ON ) || bLinkOnly ? true : pImportDlg->IsAsLink(); + bool bLink = ( nHtmlMode & HTMLMODE_ON ) || bLinkOnly || pImportDlg->IsAsLink(); m_pBtnLink->Check( bLink ); m_pBtnLink->Enable(); diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index a20e262ab793..7b86c469f1de 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -567,13 +567,11 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // horizontal alignment pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 ); - m_pHorzBox->Check( pItem ? static_cast<const SfxBoolItem*>(pItem)->GetValue() - : false ); + m_pHorzBox->Check( pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue() ); // vertical alignment pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT2 ); - m_pVertBox->Check( pItem ? static_cast<const SfxBoolItem*>(pItem)->GetValue() - : false ); + m_pVertBox->Check( pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue() ); // set example window on the table m_pBspWin->SetTable( true ); @@ -588,8 +586,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) DisableVerticalPageDir(); m_pAdaptBox->Show(); pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 ); - m_pAdaptBox->Check( pItem ? - static_cast<const SfxBoolItem*>(pItem)->GetValue() : false ); + m_pAdaptBox->Check( pItem && + static_cast<const SfxBoolItem*>(pItem)->GetValue() ); //!!! hidden, because not implemented by StarDraw m_pLayoutBox->Hide(); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 5fae3ff8f22d..f116816e4eaa 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -744,7 +744,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) else rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), - m_pPositionCB->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pPositionCB->GetState() == TRISTATE_TRUE ) ); bModified = true; } @@ -755,7 +755,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) else rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), - m_pSizeCB->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pSizeCB->GetState() == TRISTATE_TRUE ) ); bModified = true; } diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 79cf18af1ac0..9ec39aa8a152 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -788,7 +788,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) { rOutAttrs->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), - m_pTsbPosProtect->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pTsbPosProtect->GetState() == TRISTATE_TRUE ) ); } bModified = true; @@ -827,7 +827,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) else rOutAttrs->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), - m_pTsbSizeProtect->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pTsbSizeProtect->GetState() == TRISTATE_TRUE ) ); bModified = true; } @@ -840,7 +840,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) else rOutAttrs->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ), - m_pTsbAutoGrowWidth->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pTsbAutoGrowWidth->GetState() == TRISTATE_TRUE ) ); } bModified = true; } @@ -854,7 +854,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) else rOutAttrs->Put( SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ), - m_pTsbAutoGrowHeight->GetState() == TRISTATE_TRUE ? true : false ) ); + m_pTsbAutoGrowHeight->GetState() == TRISTATE_TRUE ) ); } bModified = true; } |