summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-15 20:07:12 +0100
committerEike Rathke <erack@redhat.com>2018-03-15 23:43:56 +0100
commitfd5e480eaf78c8bd2ea4315649fcbd5b8edaa3da (patch)
tree64d8c4cd9a6cb7c546d6ef0b021f9e2f8d2ce248
parentcfb9ebc12a9f1084227d6b85827ef185a42a619a (diff)
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 <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/source/core/data/markdata.cxx12
-rw-r--r--sc/source/core/data/table5.cxx9
2 files changed, 14 insertions, 7 deletions
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;