diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:33:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:26 +0200 |
commit | 8039c64822c8de24ea452bff7917193f7cc90669 (patch) | |
tree | a737f86d94d0c11990ffeae7f0661ce9a07eb484 /sd/source/ui | |
parent | 60467763e32833232394e05642338f60346c0d53 (diff) |
loplugin:simplifybool
Change-Id: Ie214d859cb47c64cb6fab6f451a53ef188400026
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/LayerTabBar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuparagr.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/smarttag.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdruler.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 2 |
15 files changed, 28 insertions, 29 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 46b957f51fd7..5a4577aeb74a 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -1377,7 +1377,7 @@ void CustomAnimationEffectTabPage::update( STLPropertySet* pSet ) (mpSet->getPropertyValue( nHandleDimColor ) != aDimColor) ) pSet->setPropertyValue( nHandleDimColor, aDimColor ); - bool bAfterEffectOnNextEffect = nPos != 2 ? true : false; + bool bAfterEffectOnNextEffect = nPos != 2; bool bOldAfterEffectOnNextEffect = !bAfterEffectOnNextEffect; if( mpSet->getPropertyState( nHandleAfterEffectOnNextEffect ) != STLPropertyState_AMBIGUOUS) @@ -1519,7 +1519,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog() aStrWarning = aStrWarning.replaceFirst("%", aFile); WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); aWarningBox.SetModalInputMode (true); - bQuitLoop = aWarningBox.Execute()==RET_RETRY ? false : true; + bQuitLoop = aWarningBox.Execute() != RET_RETRY; bValidSoundFile=false; } @@ -1702,7 +1702,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar sal_Int16 nFill = 0; if( pSet->getPropertyValue( nHandleRewind ) >>= nFill ) { - mpCBXRewind->Check( (nFill == AnimationFill::REMOVE) ? true : false ); + mpCBXRewind->Check( nFill == AnimationFill::REMOVE ); } else { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index ab056b967d82..6e36b0b64d84 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1098,7 +1098,7 @@ STLPropertySet* CustomAnimationPane::createSelectionSet() pTextGroup = pEffectSequence->findGroup( nGroupId ); addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup.get() ? pTextGroup->getTextGrouping() : (sal_Int32)-1 ) ); - addValue( pSet, nHandleAnimateForm, makeAny( pTextGroup.get() ? pTextGroup->getAnimateForm() : true ) ); + addValue( pSet, nHandleAnimateForm, makeAny( pTextGroup.get() == nullptr || pTextGroup->getAnimateForm() ) ); addValue( pSet, nHandleTextGroupingAuto, makeAny( pTextGroup.get() ? pTextGroup->getTextGroupingAuto() : (double)-1.0 ) ); addValue( pSet, nHandleTextReverse, makeAny( pTextGroup.get() && pTextGroup->getTextReverse() ) ); @@ -2024,7 +2024,7 @@ IMPL_LINK( CustomAnimationPane, implControlHdl, Control*, pControl ) else if( pControl == mpCBAutoPreview ) { SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); - pOptions->SetPreviewChangedEffects( mpCBAutoPreview->IsChecked() ? true : false ); + pOptions->SetPreviewChangedEffects( mpCBAutoPreview->IsChecked() ); } updateControls(); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 680a49928585..56bf1437dcb3 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -1044,7 +1044,7 @@ IMPL_LINK_NOARG(SlideTransitionPane, LoopSoundBoxChecked) IMPL_LINK_NOARG(SlideTransitionPane, AutoPreviewClicked) { SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); - pOptions->SetPreviewTransitions( mpCB_AUTO_PREVIEW->IsChecked() ? true : false ); + pOptions->SetPreviewTransitions( mpCB_AUTO_PREVIEW->IsChecked() ); return 0; } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index a1a445302f55..015c5a457570 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -251,7 +251,7 @@ void AnnotationManagerImpl::ShowAnnotations( bool bShow ) SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); if( pOptions ) - pOptions->SetShowComments( mbShowAnnotations ? true : false ); + pOptions->SetShowComments( mbShowAnnotations ); UpdateTags(); } @@ -929,7 +929,7 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation aStr = aStr.replaceFirst("%1", aReplace); pMenu->SetItemText( SID_DELETEALLBYAUTHOR_POSTIT, aStr ); pMenu->EnableItem( SID_REPLYTO_POSTIT, (sAuthor != sCurrentAuthor) && !bReadOnly ); - pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? true : false ); + pMenu->EnableItem( SID_DELETE_POSTIT, xAnnotation.is() && !bReadOnly ); pMenu->EnableItem( SID_DELETEALLBYAUTHOR_POSTIT, !bReadOnly ); pMenu->EnableItem( SID_DELETEALL_POSTIT, !bReadOnly ); diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 09cb270a24d0..cfc97fd3a543 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -185,7 +185,7 @@ bool LayerTabBar::StartRenaming() } } - return bOK ? true : false; + return bOK; } TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming() diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 5d54b1a4af91..be9a112fcedc 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -612,13 +612,13 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) { bool bSet = false; - bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) && - mpDoc->GetAnimationInfo(pObj)) ? true:false; + bool bAnimationInfo = !mpDocSh->ISA(GraphicDocShell) && + mpDoc->GetAnimationInfo(pObj); bool bImageMapInfo = false; if (!bAnimationInfo) - bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? true:false; + bImageMapInfo = mpDoc->GetIMapInfo(pObj) != nullptr; if (bAnimationInfo || bImageMapInfo) { diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 4e4618e7bfda..bbccfbcaa613 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -197,7 +197,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) SvxPageItem aPageItem( SID_ATTR_PAGE ); aPageItem.SetDescName( mpPage->GetName() ); aPageItem.SetPageUsage( (SvxPageUsage) SVX_PAGE_ALL ); - aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE ? true: false ); + aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE ); aPageItem.SetNumType( mpDoc->GetPageNumType() ); aNewAttr.Put( aPageItem ); @@ -222,7 +222,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) // Applikation bool bScale = mpDoc->GetDocumentType() != DOCUMENT_TYPE_DRAW; - aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ? true : false ) ); + aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ) ); bool bFullSize = mpPage->IsMasterPage() ? mpPage->IsBackgroundFullSize() : static_cast<SdPage&>(mpPage->TRG_GetMasterPage()).IsBackgroundFullSize(); diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index 60abef032c08..7d1393ac2108 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -120,7 +120,7 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) const SfxPoolItem *pItem = 0; if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART, false, &pItem ) ) { - const bool bNewStart = static_cast<const SfxBoolItem*>(pItem)->GetValue() ? true : false; + const bool bNewStart = static_cast<const SfxBoolItem*>(pItem)->GetValue(); pOutliner->SetParaIsNumberingRestart( eSelection.nStartPara, bNewStart ); } diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx index 53e4010878f6..81b915dccb93 100644 --- a/sd/source/ui/func/smarttag.cxx +++ b/sd/source/ui/func/smarttag.cxx @@ -297,7 +297,7 @@ bool SmartTagSet::getContext( SdrViewContext& rContext ) const bool SmartTagSet::HasMarkablePoints() const { - return GetMarkablePointCount() != 0 ? true : false; + return GetMarkablePointCount() != 0; } sal_uLong SmartTagSet::GetMarkablePointCount() const @@ -309,7 +309,7 @@ sal_uLong SmartTagSet::GetMarkablePointCount() const bool SmartTagSet::HasMarkedPoints() const { - return GetMarkedPointCount() != 0 ? true : false; + return GetMarkedPointCount() != 0; } sal_uLong SmartTagSet::GetMarkedPointCount() const diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 694f43579c3f..1dccec07aa7e 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2476,7 +2476,7 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) for( sal_Int32 i = 0; i < nSlideCount; i++ ) { - bool bVisible = ( mpDoc->GetSdPage( (sal_uInt16)i, PK_STANDARD ) )->IsExcluded() ? false : true; + bool bVisible = !( mpDoc->GetSdPage( (sal_uInt16)i, PK_STANDARD ) )->IsExcluded(); if( bVisible || (eMode == AnimationSlideController::ALL) ) mpSlideController->insertSlideNumber( i, bVisible ); } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index dcba9be890ed..e87705cdb097 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -461,7 +461,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const : SdrObject* pObj = mpShape->GetSdrObject(); if( pObj ) { - SdAnimationInfo* pInfo = GetAnimationInfo((pEntry->nWID <= WID_THAT_NEED_ANIMINFO)?true:false); + SdAnimationInfo* pInfo = GetAnimationInfo((pEntry->nWID <= WID_THAT_NEED_ANIMINFO)); switch(pEntry->nWID) { @@ -972,7 +972,7 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) if(!bEmpty) { OutlinerParaObject* pOutlinerParaObject = pObj->GetOutlinerParaObject(); - const bool bVertical = pOutlinerParaObject ? pOutlinerParaObject->IsVertical() : false; + const bool bVertical = pOutlinerParaObject && pOutlinerParaObject->IsVertical(); // really delete SdrOutlinerObj at pObj pObj->NbcSetOutlinerParaObject(0L); @@ -1409,7 +1409,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno pInfo->SetBookmark( aStrSoundURL ); if( eClickAction != presentation::ClickAction_SOUND ) pInfo->mbSecondSoundOn = !aStrSoundURL.isEmpty(); - pInfo->mbSecondPlayFull = nFound & FOUND_PLAYFULL ? bPlayFull : false; + pInfo->mbSecondPlayFull = (nFound & FOUND_PLAYFULL) && bPlayFull; bOk = true; } diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 97b1042100be..c95dd452142d 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -1064,7 +1064,7 @@ void ViewShellBase::Implementation::ShowViewTabBar (bool bShow) if (mpViewTabBar.is() && mpViewTabBar->GetTabControl()->IsVisible() != bShow) { - mpViewTabBar->GetTabControl()->Show(bShow ? true : false); + mpViewTabBar->GetTabControl()->Show(bShow); mrBase.Rearrange(); } } diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx index 8fd90d856aca..ba5c97e66fb0 100644 --- a/sd/source/ui/view/sdruler.cxx +++ b/sd/source/ui/view/sdruler.cxx @@ -60,7 +60,7 @@ void RulerCtrlItem::StateChanged( sal_uInt16 nSId, SfxItemState, const SfxPoolIt case SID_RULER_NULL_OFFSET: { const SfxPointItem* pItem = dynamic_cast< const SfxPointItem* >(pState); - DBG_ASSERT(pState ? pItem != NULL : true, "SfxPointItem expected"); + DBG_ASSERT(pState == nullptr || pItem != nullptr, "SfxPointItem expected"); if ( pItem ) rRuler.SetNullOffset(pItem->GetValue()); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 9afeccc26b5b..e5925fa47318 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1304,7 +1304,7 @@ bool View::ShouldToggleOn( continue; pOutliner->SetText(*(pText->GetOutlinerParaObject())); sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus(); - bToggleOn = ((bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1)) ? true : bToggleOn; + bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1) || bToggleOn; pOutliner->Clear(); } } @@ -1316,7 +1316,7 @@ bool View::ShouldToggleOn( continue; pOutliner->SetText(*pParaObj); sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus(); - bToggleOn = ((bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1)) ? true : bToggleOn; + bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1) || bToggleOn; pOutliner->Clear(); } } @@ -1338,9 +1338,8 @@ void View::ChangeMarkedObjectsBulletsNumbering( SdrUndoGroup* pUndoGroup = bUndoEnabled ? new SdrUndoGroup(*pSdrModel) : 0; const bool bToggleOn = - bSwitchOff - ? false - : ShouldToggleOn( bToggle, bHandleBullets ); + !bSwitchOff + && ShouldToggleOn( bToggle, bHandleBullets ); boost::scoped_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrModel)); boost::scoped_ptr<OutlinerView> pOutlinerView(new OutlinerView(pOutliner.get(), pWindow)); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index a078414d21ff..a229e4df2afa 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -845,7 +845,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv /* In order t ensure unique page names, we test the ones we want to insert. If necessary. we put them into and replacement list (bNameOK == sal_False -> User canceled). */ - bool bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ? true : false ); + bool bLink = pPageObjsTransferable->GetDragType() == NAVIGATOR_DRAGTYPE_LINK; bool bNameOK = GetExchangeList( aExchangeList, aBookmarkList, 2 ); bool bReplace = false; |