diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 11:36:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 20:56:17 +0200 |
commit | 80f28e377db0ca04da57eed77d42f44cbdea363d (patch) | |
tree | 44268ab2601aedd6a34a9a40f943cd1f55e400ea /sc/source/ui/view | |
parent | 5f56f07e9278e357a079cbecb5366da98e36d97f (diff) |
loplugin:simplifybool in oox..sd
Change-Id: I76cbd5d3e65f0b392d713a51607f5c88dae79593
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95101
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview2.cxx | 8 |
4 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index a9dfdc4db199..ff7e37538c08 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1117,7 +1117,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) else { CommentCaptionState eState = pDoc->GetAllNoteCaptionsState( aRanges ); - bool bAllNotesInShown = !(eState == ALLHIDDEN || eState == MIXED); + bool bAllNotesInShown = (eState != ALLHIDDEN && eState != MIXED); rSet.Put( SfxBoolItem( SID_TOGGLE_NOTES, bAllNotesInShown) ); } } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 4db57dc43f26..0ee0cc1b2f9d 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1381,9 +1381,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY ); pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, true ); - if ( !( pData->GetSimpleArea( nStartX, nStartY, nStartTab, - nEndX, nEndY, nEndTab ) == SC_MARK_SIMPLE && - nStartTab == nEndTab ) ) + if ( pData->GetSimpleArea( nStartX, nStartY, nStartTab, + nEndX, nEndY, nEndTab ) != SC_MARK_SIMPLE || + nStartTab != nEndTab ) { // the destination is not a simple range, // assume the destination as the current cell diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1de54e8f03e5..284fc13a29a8 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6056,7 +6056,7 @@ void ScGridWindow::UpdateCursorOverlay() SCCOL nX2 = nX + rMerge.GetColMerge() - 1; SCROW nY2 = nY + rMerge.GetRowMerge() - 1; // Check if the middle or tail of the merged range is visible. - if (!(maVisibleRange.mnCol1 <= nX2 && maVisibleRange.mnRow1 <= nY2)) + if (maVisibleRange.mnCol1 > nX2 || maVisibleRange.mnRow1 > nY2) return; // no visible part } diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 97e5dd9babd9..bf78bc7f21ee 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -513,7 +513,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCCOL nColSpan = pMergeAttr->GetColMerge(); SCROW nRowSpan = pMergeAttr->GetRowMerge(); - if ( !( nCurX >= nBlockStartXOrig + nColSpan - 1 && nCurY >= nBlockStartYOrig + nRowSpan - 1 ) ) + if ( nCurX < nBlockStartXOrig + nColSpan - 1 || nCurY < nBlockStartYOrig + nRowSpan - 1 ) { nBlockStartX = nCurX >= nBlockStartXOrig ? nBlockStartXOrig : nBlockStartXOrig + nColSpan - 1; nBlockStartY = nCurY >= nBlockStartYOrig ? nBlockStartYOrig : nBlockStartYOrig + nRowSpan - 1; @@ -538,7 +538,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCCOL nColSpan = pMergeAttr->GetColMerge(); SCROW nRowSpan = pMergeAttr->GetRowMerge(); - if ( !( nBlockStartX >= nCurX + nColSpan - 1 && nBlockStartY >= nCurY + nRowSpan - 1 ) ) + if ( nBlockStartX < nCurX + nColSpan - 1 || nBlockStartY < nCurY + nRowSpan - 1 ) { if ( nBlockStartX <= nCurX + nColSpan - 1 ) { @@ -550,8 +550,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCROW nCurYOffsetTemp = (nCurY < nCurY + nRowSpan - 1) ? nRowSpan - 1 : 0; nCurYOffset = std::max(nCurYOffset, nCurYOffsetTemp); } - if ( !( nBlockStartX <= nCurX && nBlockStartY <= nCurY ) && - !( nBlockStartX > nCurX + nColSpan - 1 && nBlockStartY > nCurY + nRowSpan - 1 ) ) + if ( ( nBlockStartX > nCurX || nBlockStartY > nCurY ) && + ( nBlockStartX <= nCurX + nColSpan - 1 || nBlockStartY <= nCurY + nRowSpan - 1 ) ) { nBlockStartXOffset = (nBlockStartX > nCurX && nBlockStartX <= nCurX + nColSpan - 1) ? nCurX - nBlockStartX : 0; nBlockStartYOffset = (nBlockStartY > nCurY && nBlockStartY <= nCurY + nRowSpan - 1) ? nCurY - nBlockStartY : 0; |