summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/dbfunc3.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 09:25:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 20:59:31 +0200
commit61d8db6b1a2026a29f61eaa691beb3c6cf05de5c (patch)
treefc81eda81cf811256290c3e564166ef217f8268e /sc/source/ui/view/dbfunc3.cxx
parent7baa60a5e9a8c48829f47db8cd98d0f05a30e235 (diff)
loplugin:buriedassign in sc
Change-Id: I9b4146c4e8814a36c7bfcd4c31f913c8412320e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/dbfunc3.cxx')
-rw-r--r--sc/source/ui/view/dbfunc3.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 0093c96820f6..8b7782ed2e25 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -145,8 +145,11 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
{
ScOutlineArray& rArray = pTable->GetColArray();
ScSubOutlineIterator aColIter( &rArray );
- while ((pEntry=aColIter.GetNext()) != nullptr && !bColFound)
+ while (bColFound)
{
+ pEntry=aColIter.GetNext();
+ if (!pEntry)
+ break;
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
if ( nStartCol<=static_cast<SCCOL>(nEnd) && nEndCol>=static_cast<SCCOL>(nStart) )
@@ -160,8 +163,11 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
{
ScOutlineArray& rArray = pTable->GetRowArray();
ScSubOutlineIterator aRowIter( &rArray );
- while ((pEntry=aRowIter.GetNext()) != nullptr && !bRowFound)
+ while (!bRowFound)
{
+ pEntry=aRowIter.GetNext();
+ if (!pEntry)
+ break;
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
if ( nStartRow<=nEnd && nEndRow>=nStart )
@@ -284,7 +290,6 @@ bool ScDBFunc::OutlinePossible(bool bHide)
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
- ScOutlineEntry* pEntry;
SCCOLROW nStart;
SCCOLROW nEnd;
@@ -292,8 +297,11 @@ bool ScDBFunc::OutlinePossible(bool bHide)
ScOutlineArray& rColArray = pTable->GetColArray();
ScSubOutlineIterator aColIter( &rColArray );
- while ((pEntry=aColIter.GetNext()) != nullptr && !bEnable)
+ while (!bEnable)
{
+ ScOutlineEntry* pEntry = aColIter.GetNext();
+ if (!pEntry)
+ break;
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
if ( bHide )
@@ -314,8 +322,11 @@ bool ScDBFunc::OutlinePossible(bool bHide)
ScOutlineArray& rRowArray = pTable->GetRowArray();
ScSubOutlineIterator aRowIter( &rRowArray );
- while ((pEntry=aRowIter.GetNext()) != nullptr)
+ for (;;)
{
+ ScOutlineEntry* pEntry = aRowIter.GetNext();
+ if (!pEntry)
+ break;
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
if ( bHide )