summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-07 14:23:46 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-03-07 16:37:19 -0600
commit92a2cb1bc23d9b0e099f34bcd4c2b89d3682ce60 (patch)
treef1996691c3d3338c011196fe02296dcc13f8f3d7 /sc
parentcb2a2813f8fdcb3c888c203a72370883df178c60 (diff)
fdo#75718: Correctly count the length of trailing empty range.
This affects auto fill, apparently. Change-Id: I653918d374122bc9bb938231934c149da79a3306 (cherry picked from commit 01de94471c20a8b9c36d6080638d70e57eac55bf) Reviewed-on: https://gerrit.libreoffice.org/8501 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index ae1a722364e3..1c18affb3924 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1368,13 +1368,13 @@ void ScColumn::GetNotesInRange(SCROW nStartRow, SCROW nEndRow,
SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const
{
- // Given a range of rows, find a top or bottom empty segment.
+ // Given a range of rows, find a top or bottom empty segment. Skip the start row.
switch (eDir)
{
case DIR_TOP:
{
// Determine the length of empty head segment.
- size_t nLength = nEndRow - nStartRow + 1;
+ size_t nLength = nEndRow - nStartRow;
std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nStartRow);
sc::CellStoreType::const_iterator it = aPos.first;
if (it->type != sc::element_type_empty)
@@ -1388,8 +1388,8 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti
break;
case DIR_BOTTOM:
{
- // Determine the length empty tail segment.
- size_t nLength = nEndRow - nStartRow + 1;
+ // Determine the length of empty tail segment.
+ size_t nLength = nEndRow - nStartRow;
std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nEndRow);
sc::CellStoreType::const_iterator it = aPos.first;
if (it->type != sc::element_type_empty)
@@ -1397,7 +1397,7 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti
return 0;
// length of this empty block from the tip to the end row position.
- size_t nThisLen = aPos.second;
+ size_t nThisLen = aPos.second + 1;
return std::min(nThisLen, nLength);
}
break;