[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jul 13 17:54:09 UTC 2018
sc/inc/columniterator.hxx | 1 +
sc/source/core/data/columniterator.cxx | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 4e4421325d406cc555f15c2b8b5bbab443eb6a7d
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Jul 12 19:06:03 2018 +0100
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Fri Jul 13 19:53:45 2018 +0200
tdf#118620 - avoid out of bounds iterator for end of sheet pivots.
Change-Id: I2ddcf56dc94175718739611f0791558fda87b1ba
Reviewed-on: https://gerrit.libreoffice.org/57358
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit d3387b38fe0eea3fb7ac630c026f02986e8dafc4)
Reviewed-on: https://gerrit.libreoffice.org/57383
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/inc/columniterator.hxx b/sc/inc/columniterator.hxx
index b36a4c7028b2..6e6e696d5070 100644
--- a/sc/inc/columniterator.hxx
+++ b/sc/inc/columniterator.hxx
@@ -68,6 +68,7 @@ class ColumnIterator
{
CellStoreType::const_position_type maPos;
CellStoreType::const_position_type maPosEnd;
+ bool mbComplete;
public:
ColumnIterator( const CellStoreType& rCells, SCROW nRow1, SCROW nRow2 );
diff --git a/sc/source/core/data/columniterator.cxx b/sc/source/core/data/columniterator.cxx
index f7367193d9cb..ad96639ca9d4 100644
--- a/sc/source/core/data/columniterator.cxx
+++ b/sc/source/core/data/columniterator.cxx
@@ -172,7 +172,8 @@ namespace sc {
ColumnIterator::ColumnIterator( const CellStoreType& rCells, SCROW nRow1, SCROW nRow2 ) :
maPos(rCells.position(nRow1)),
- maPosEnd(rCells.position(maPos.first, nRow2+1))
+ maPosEnd(rCells.position(maPos.first, nRow2)),
+ mbComplete(false)
{
}
@@ -180,7 +181,10 @@ ColumnIterator::~ColumnIterator() {}
void ColumnIterator::next()
{
- maPos = CellStoreType::next_position(maPos);
+ if ( maPos == maPosEnd)
+ mbComplete = true;
+ else
+ maPos = CellStoreType::next_position(maPos);
}
SCROW ColumnIterator::getRow() const
@@ -190,7 +194,7 @@ SCROW ColumnIterator::getRow() const
bool ColumnIterator::hasCell() const
{
- return maPos != maPosEnd;
+ return !mbComplete;
}
mdds::mtv::element_t ColumnIterator::getType() const
More information about the Libreoffice-commits
mailing list