diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:33:12 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:27 +0200 |
commit | ef5f02d94a88d4e6f18e4010dbbef47506e28a34 (patch) | |
tree | 7aaa87ac1d1e27e611c70a91a404451354fb32a3 /sfx2 | |
parent | f88a1b8d55923c8edee5bc175fd805db779ef166 (diff) |
loplugin:simplifybool
Change-Id: I0a2a7d1af979b24f6d3db9783984e85e1992643d
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filtergrouping.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/dialog/tplcitem.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/statcach.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 2 |
14 files changed, 23 insertions, 23 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 6a949d021a98..9d92d78820cc 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -633,7 +633,7 @@ void IndexTabPage_Impl::InitializeIndex() DBG_ASSERT( aRefList.getLength() == aAnchorList.getLength(),"reference list and title list of different length" ); - const bool insert = ( ( ndx = aKeywordPair.indexOf( ';' ) ) == -1 ? false : true ); + const bool insert = ( ndx = aKeywordPair.indexOf( ';' ) ) != -1; if ( insert ) { @@ -927,9 +927,9 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_ Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME ); if ( aUserItem >>= aUserData ) { - bool bChecked = ( 1 == aUserData.getToken(0, ';').toInt32() ) ? true : false; + bool bChecked = aUserData.getToken(0, ';').toInt32() == 1; m_pFullWordsCB->Check( bChecked ); - bChecked = ( 1 == aUserData.getToken(1, ';').toInt32() ) ? true : false; + bChecked = aUserData.getToken(1, ';').toInt32() == 1; m_pScopeCB->Check( bChecked ); for ( sal_uInt16 i = 2; i < comphelper::string::getTokenCount(aUserData, ';'); ++i ) diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index f1f275dcaedd..6ef54db376ea 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -159,7 +159,7 @@ short SvxOpenGraphicDialog::Execute() if ( nFound == USHRT_MAX ) { WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() ); - bQuitLoop = aWarningBox.Execute()==RET_RETRY ? false : true; + bQuitLoop = aWarningBox.Execute() != RET_RETRY; } else { diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index aa8be183d7e5..236f971c5f69 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -537,7 +537,7 @@ namespace sfx2 bool operator() ( const MapGroupEntry2GroupEntry::value_type& _rMapEntry ) { - return _rMapEntry.first == aLookingFor ? true : false; + return _rMapEntry.first == aLookingFor; } }; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index cfb62890540e..76ab7dbc9fc4 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -991,7 +991,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const OUString &rStr) aFmtLb.MakeVisible( pEntry ); aFmtLb.SelectAll(false); aFmtLb.Select( pEntry ); - bWaterDisabled = (pTreeBox || aFmtLb.GetSelectionCount() <= 1) ? false : true; + bWaterDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1); FmtSelectHdl( NULL ); } } @@ -1262,7 +1262,7 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem) if(!bWaterDisabled) //make sure the watercan is only activated when there is (only) one selection - bWaterDisabled = (pTreeBox || aFmtLb.GetSelectionCount() <= 1) ? false : true; + bWaterDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1); if(pItem && !bWaterDisabled) { @@ -1805,7 +1805,7 @@ sal_Int32 SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter( SfxObjectShell* nFilter = aFactoryProps.getUnpackedValueOrDefault( "ooSetupFactoryStyleFilter", nDefault ); m_bWantHierarchical = - (nFilter & SFXSTYLEBIT_HIERARCHY) ? true : false; + (nFilter & SFXSTYLEBIT_HIERARCHY) != 0; nFilter &= ~SFXSTYLEBIT_HIERARCHY; // clear it return nFilter; @@ -2155,10 +2155,10 @@ void SfxCommonTemplateDialog_Impl::EnableExample_Impl(sal_uInt16 nId, bool bEnab { if( nId == SID_STYLE_NEW_BY_EXAMPLE ) { - bNewByExampleDisabled = (pTreeBox || aFmtLb.GetSelectionCount() <= 1) ? !bEnable : true; + bNewByExampleDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1) || !bEnable; } else if( nId == SID_STYLE_UPDATE_BY_EXAMPLE ) - bUpdateByExampleDisabled = (pTreeBox || aFmtLb.GetSelectionCount() <= 1) ? !bEnable : true; + bUpdateByExampleDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1) || !bEnable; EnableItem(nId, bEnable); } @@ -2542,7 +2542,7 @@ void SfxCommonTemplateDialog_Impl::UpdateFamily_Impl() } bWaterDisabled = false; - bCanNew = (pTreeBox || aFmtLb.GetSelectionCount() <= 1) ? true : false; + bCanNew = pTreeBox || aFmtLb.GetSelectionCount() <= 1; bTreeDrag = true; bUpdateByExampleDisabled = false; diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx index 320d967e15a5..c0b2a35bafee 100644 --- a/sfx2/source/dialog/tplcitem.cxx +++ b/sfx2/source/dialog/tplcitem.cxx @@ -163,7 +163,7 @@ IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, { case 0 : case 1 : - pState = new SfxBoolItem(SID_STYLE_WATERCAN, pThis->nWaterCanState ? true : false); + pState = new SfxBoolItem(SID_STYLE_WATERCAN, pThis->nWaterCanState != 0); break; } pThis->rTemplateDlg.SetWaterCanState(pState); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 15c992f8a9d7..b33e4f865f4d 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1351,7 +1351,7 @@ bool SfxDocTplService_Impl::RemoveUINamesForTemplateDir_Impl( const OUString& aU aNewUINames.realloc( nNewLen ); - return bChanged ? WriteUINamesForTemplateDir_Impl( aUserPath, aNewUINames ) : true; + return !bChanged || WriteUINamesForTemplateDir_Impl( aUserPath, aNewUINames ); } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index ff7db2686d5e..98dbc7fee6c9 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1343,7 +1343,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad() if( ok ) { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false ); - bool bSalvage = pSalvageItem ? true : false; + bool bSalvage = pSalvageItem != nullptr; if ( !bSalvage ) { diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 4800187f2553..bdb2e9e1b72e 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -931,7 +931,7 @@ Any SfxOleSection::GetAnyValue( sal_Int32 nPropId ) const else if( GetDoubleValue( fDouble, nPropId ) ) aValue <<= fDouble; else if( GetBoolValue( bBool, nPropId ) ) - ::comphelper::setBOOL( aValue, bBool ? true : false ); + ::comphelper::setBOOL( aValue, bBool ); else if( GetStringValue( aString, nPropId ) ) aValue <<= aString; else if( GetFileTimeValue( aApiDateTime, nPropId ) ) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c51aab017fb5..bc1f5e43f585 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1853,7 +1853,7 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA } SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false ); - bool bSalvage = pSalvageItem ? true : false; + bool bSalvage = pSalvageItem != nullptr; // load document if ( !m_pData->m_pObjectShell->DoLoad(pMedium) ) diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx index a08023149483..88867861a3ba 100644 --- a/sfx2/source/inc/statcach.hxx +++ b/sfx2/source/inc/statcach.hxx @@ -91,7 +91,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > GetDispatch() const; void Dispatch( const SfxItemSet* pSet, bool bForceSynchron = false ); bool IsControllerDirty() const - { return bCtrlDirty ? true : false; } + { return bCtrlDirty; } SfxPoolItem* GetItem() const { return pLastItem; } void ClearCache(); diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 70b67aa16b1f..6f217bcb7c09 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -900,7 +900,7 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) { // Find the VirtualMenu for the SubMenu and if possible, bind a // VirtualMenu - bool bRet = pMenu ? Bind_Impl(pMenu) : false; + bool bRet = pMenu && Bind_Impl(pMenu); #ifdef DBG_UTIL if ( !bRet) DBG_WARNING( "W1: Virtual menu could not be created!" ); diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 973875b61e72..6268a1e2abd0 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -866,8 +866,8 @@ void SidebarController::ShowPopupMenu ( { const sal_Int32 nMenuIndex (nIndex+MID_FIRST_PANEL); pMenu->InsertItem(nMenuIndex, iItem->msDisplayName, MenuItemBits::RADIOCHECK); - pMenu->CheckItem(nMenuIndex, iItem->mbIsCurrentDeck ? true : false); - pMenu->EnableItem(nMenuIndex, (iItem->mbIsEnabled&&iItem->mbIsActive) ? true : false); + pMenu->CheckItem(nMenuIndex, iItem->mbIsCurrentDeck); + pMenu->EnableItem(nMenuIndex, iItem->mbIsEnabled&&iItem->mbIsActive); const sal_Int32 nSubMenuIndex (nIndex+MID_FIRST_HIDE); if (iItem->mbIsCurrentDeck) @@ -879,7 +879,7 @@ void SidebarController::ShowPopupMenu ( else { pCustomizationMenu->InsertItem(nSubMenuIndex, iItem->msDisplayName, MenuItemBits::CHECKABLE); - pCustomizationMenu->CheckItem(nSubMenuIndex, iItem->mbIsActive ? true : false); + pCustomizationMenu->CheckItem(nSubMenuIndex, iItem->mbIsActive); } } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index cecb1386bd8c..8bccea79f647 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1996,7 +1996,7 @@ SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const Sf i_rDoc, pFrameItem ? pFrameItem->GetFrame() : NULL, i_nViewId, - pHiddenItem ? pHiddenItem->GetValue() : false + pHiddenItem && pHiddenItem->GetValue() ); } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 86ff4288aac1..d42f4832a884 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -164,7 +164,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) case SID_SHOWPOPUPS : { SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, false); - bool bShow = pShowItem ? pShowItem->GetValue() : true; + bool bShow = pShowItem == nullptr || pShowItem->GetValue(); SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, false); sal_uInt16 nId = pIdItem ? pIdItem->GetValue() : 0; |