diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 09:25:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 20:59:31 +0200 |
commit | 61d8db6b1a2026a29f61eaa691beb3c6cf05de5c (patch) | |
tree | fc81eda81cf811256290c3e564166ef217f8268e /sc/source/core/data/column.cxx | |
parent | 7baa60a5e9a8c48829f47db8cd98d0f05a30e235 (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/core/data/column.cxx')
-rw-r--r-- | sc/source/core/data/column.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 9388e01ee1f0..a223352b8dd3 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -627,9 +627,11 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, bool& ScAttrIterator aAttrIter( pAttrArray.get(), nTop, nBottom, pDocument->GetDefPattern() ); SCROW nRow; SCROW nDummy; - const ScPatternAttr* pPattern; - while (bEqual && ( pPattern = aAttrIter.Next( nRow, nDummy ) ) != nullptr) + while (bEqual) { + const ScPatternAttr* pPattern = aAttrIter.Next( nRow, nDummy ); + if (!pPattern) + break; pNewStyle = pPattern->GetStyleSheet(); rFound = true; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) @@ -653,9 +655,11 @@ const ScStyleSheet* ScColumn::GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRo ScAttrIterator aAttrIter( pAttrArray.get(), nRow1, nRow2, GetDoc()->GetDefPattern() ); SCROW nRow; SCROW nDummy; - const ScPatternAttr* pPattern; - while (bEqual && ( pPattern = aAttrIter.Next( nRow, nDummy ) ) != nullptr) + while (bEqual) { + const ScPatternAttr* pPattern = aAttrIter.Next( nRow, nDummy ); + if (!pPattern) + break; pNewStyle = pPattern->GetStyleSheet(); rFound = true; if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) ) |