diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 00:13:29 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 07:55:59 +0100 |
commit | 5f0ddb2d2068a4388a7df12cd0e11f628b91e4c0 (patch) | |
tree | 2007c4a1f6c21a9f0d5a11aab60a10cd178d1d8b /sc/source/ui/Accessibility | |
parent | 8522572cdd27f62a031bb07c9cf7f6f85e8453ad (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: Ic92cc594979cac2edac04a085957398672a5dfcc
Reviewed-on: https://gerrit.libreoffice.org/62450
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui/Accessibility')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 5 |
3 files changed, 11 insertions, 23 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index d07a2a07f3fb..0c414eaf1beb 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -445,24 +445,21 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange, uno::Reference < XAccessibleTable > xTable ( getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY ); if (xTable.is()) { - sal_uInt32 nCount(static_cast<sal_uInt32>(rRange.aEnd.Col() - + const sal_uInt32 nCount(static_cast<sal_uInt32>(rRange.aEnd.Col() - rRange.aStart.Col() + 1) * (rRange.aEnd.Row() - rRange.aStart.Row() + 1)); uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount ); uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray(); - if (pTargetSet) + sal_uInt32 nPos(0); + for (sal_uInt32 nRow = rRange.aStart.Row(); nRow <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Row()); ++nRow) { - sal_uInt32 nPos(0); - for (sal_uInt32 nRow = rRange.aStart.Row(); nRow <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Row()); ++nRow) + for (sal_uInt32 nCol = rRange.aStart.Col(); nCol <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Col()); ++nCol) { - for (sal_uInt32 nCol = rRange.aStart.Col(); nCol <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Col()); ++nCol) - { - pTargetSet[nPos] = xTable->getAccessibleCellAt(nRow, nCol); - ++nPos; - } + pTargetSet[nPos] = xTable->getAccessibleCellAt(nRow, nCol); + ++nPos; } - OSL_ENSURE(nCount == nPos, "something wents wrong"); } + OSL_ENSURE(nCount == nPos, "something wents wrong"); AccessibleRelation aRelation; aRelation.RelationType = aRelationType; aRelation.TargetSet = aTargetSet; diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 6966e9ac9428..fc59f7a4acc8 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1860,17 +1860,13 @@ void SAL_CALL if (xAccessible.is()) { bool bWasTableSelected(IsTableSelected()); - - if (mpChildrenShapes) - mpChildrenShapes->Select(nChildIndex); // throws no lang::IndexOutOfBoundsException if Index is too high - + mpChildrenShapes->Select(nChildIndex); // throws no lang::IndexOutOfBoundsException if Index is too high if (bWasTableSelected) mpViewShell->SelectAll(); } else { - if (mpViewShell) - mpViewShell->SelectAll(); + mpViewShell->SelectAll(); } } } @@ -1998,9 +1994,7 @@ void SAL_CALL uno::Reference < XAccessible > xAccessible = mpChildrenShapes->Get(nChildIndex); if (xAccessible.is()) { - if (mpChildrenShapes) - mpChildrenShapes->Deselect(nChildIndex); // throws no lang::IndexOutOfBoundsException if Index is too high - + mpChildrenShapes->Deselect(nChildIndex); // throws no lang::IndexOutOfBoundsException if Index is too high if (bTabMarked) mpViewShell->SelectAll(); // select the table again } diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index faff13dda9f7..d69114e07517 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -444,10 +444,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint { OSL_ENSURE(!((nX > 0) && (nY > 0)), "should not be possible to add row and column at the same time"); nId = AccessibleTableModelChangeType::INSERT; - if (nX < 0) - nY = aRange.aEnd.Row() - aRange.aStart.Row(); - else - nX = aRange.aEnd.Col() - aRange.aStart.Col(); + nX = aRange.aEnd.Col() - aRange.aStart.Col(); } else { |