diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-12 15:56:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 08:49:10 +0200 |
commit | cd779b5f4e457678bd306ee2c873aac7f0e058c4 (patch) | |
tree | 63d7baa83eb200b7587a129a24f287748a7be671 /sc/inc | |
parent | 3563220f048da5e0e893b8ac7faf5e8f14889fa5 (diff) |
rename ScAttrEntry.nRow to nEndRow
since it's the last row that the pattern applies to
Change-Id: I80d6d5787768b1e98e958d7adc4c13c37c560ccd
Reviewed-on: https://gerrit.libreoffice.org/42211
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/attarray.hxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index e6767a32a8dd..aa5d8ad91e61 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -75,9 +75,10 @@ struct ScMergePatternState mbValidPatternId(true), mnPatternId(0) {} }; +// we store an array of these where the pattern applies to all rows up till nEndRow struct ScAttrEntry { - SCROW nRow; + SCROW nEndRow; const ScPatternAttr* pPattern; }; @@ -267,7 +268,7 @@ inline const ScPatternAttr* ScAttrIterator::Next( SCROW& rTop, SCROW& rBottom ) if ( nPos < pArray->nCount && nRow <= nEndRow ) { rTop = nRow; - rBottom = std::min( pArray->pData[nPos].nRow, nEndRow ); + rBottom = std::min( pArray->pData[nPos].nEndRow, nEndRow ); pRet = pArray->pData[nPos].pPattern; nRow = rBottom + 1; ++nPos; @@ -289,13 +290,13 @@ inline const ScPatternAttr* ScAttrIterator::Resync( SCROW nRowP, SCROW& rTop, SC // starting right there. Assume that Next() was called so nPos already // advanced. Another high chance is that the change extended a previous or // next pattern. In all these cases we don't need to search. - if (3 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-3].nRow < nRowP && - nRowP <= pArray->pData[nPos-2].nRow) + if (3 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-3].nEndRow < nRowP && + nRowP <= pArray->pData[nPos-2].nEndRow) nPos -= 2; - else if (2 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-2].nRow < nRowP && - nRowP <= pArray->pData[nPos-1].nRow) + else if (2 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-2].nEndRow < nRowP && + nRowP <= pArray->pData[nPos-1].nEndRow) --nPos; - else if (pArray->nCount > 0 && nRowP <= pArray->pData[0].nRow) + else if (pArray->nCount > 0 && nRowP <= pArray->pData[0].nEndRow) nPos = 0; else pArray->Search( nRowP, nPos ); |