sc/source/core/data/markdata.cxx | 12 ++++++++---- sc/source/core/data/table5.cxx | 9 ++++++--- 2 files changed, 14 insertions(+), 7 deletions(-)
New commits: commit fd5e480eaf78c8bd2ea4315649fcbd5b8edaa3da Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 15 20:07:12 2018 +0100 Check return of ScFlatBoolRowSegments::ForwardIterator::getValue() And if it is only an assert() where code (probably rightly) assumed there is a value.. if there wasn't then we'll have to handle it. Change-Id: Icbdb4a7727ca4cf8a6372c03e02d3bffa6156b6c Reviewed-on: https://gerrit.libreoffice.org/51374 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index ecd2b2ecaf13..eadff07dc455 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -714,7 +714,8 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) while( nTop1 <= nBottom && nBottom1 <= nBottom ) { bool bRangeMarked = false; - aPrevItr.getValue( nTop1, bRangeMarked ); + const bool bHasValue = aPrevItr.getValue( nTop1, bRangeMarked ); + assert(bHasValue); (void)bHasValue; if( bRangeMarked ) { nTop1 = aPrevItr.getLastPos() + 1; @@ -735,7 +736,8 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) while( nTopPrev <= nBottom && nBottomPrev <= nBottom ) { bool bRangeMarked; - aPrevItr1.getValue( nTopPrev, bRangeMarked ); + const bool bHasValue = aPrevItr1.getValue( nTopPrev, bRangeMarked ); + assert(bHasValue); (void)bHasValue; if( bRangeMarked ) { nBottomPrev = aPrevItr1.getLastPos(); @@ -788,7 +790,8 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) while( nTopPrev <= MAXROW && nBottomPrev <= MAXROW && ( nCol > nStartCol ) ) { bool bRangeMarked; - aPrevItr1.getValue( nTopPrev, bRangeMarked ); + const bool bHasValue = aPrevItr1.getValue( nTopPrev, bRangeMarked ); + assert(bHasValue); (void)bHasValue; if( bRangeMarked ) { nBottomPrev = aPrevItr1.getLastPos(); @@ -813,7 +816,8 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) ScFlatBoolRowSegments::ForwardIterator aPrevItr( pPrevColMarkedRows.get() ? *pPrevColMarkedRows : aNoRowsMarked ); while( nTopPrev <= MAXROW && nBottomPrev <= MAXROW ) { - aPrevItr.getValue(nTopPrev, bRangeMarked); + const bool bHasValue = aPrevItr.getValue(nTopPrev, bRangeMarked); + assert(bHasValue); (void)bHasValue; if( bRangeMarked ) { nBottomPrev = aPrevItr.getLastPos(); diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 41de2787dbef..c39fb3816c94 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -206,13 +206,16 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) { bool bStartOfPage = false; bool bThisRowHidden = false; - aIterHidden.getValue(nY, bThisRowHidden); + const bool bHasValue = aIterHidden.getValue(nY, bThisRowHidden); + assert(bHasValue); (void)bHasValue; long nThisY = 0; if (!bThisRowHidden) { sal_uInt16 nTmp; - aIterHeights.getValue(nY, nTmp); - nThisY = static_cast<long>(nTmp); + const bool bHasHeight = aIterHeights.getValue(nY, nTmp); + assert(bHasHeight); + if (bHasHeight) + nThisY = static_cast<long>(nTmp); } bool bManualBreak = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits