diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-02-23 13:52:56 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-24 09:46:18 +0100 |
commit | 57782b9a56309dcc3bb402b17691d4f46706ca73 (patch) | |
tree | 2696193da562d2b87c46e54d4ec308b5f241a0fa | |
parent | 67a862f6d146ea7e0ec0789563bf0f51961348c9 (diff) |
Revert ""delete" also empty Calc cells if it helps mdds (tdf#139820)"
It's much simpler to just delete in reverse order.
This reverts commit 2ac0ab976f814e97a38a9685bc23b7255cfef2f2.
Change-Id: I310ebb7d517cbfbb7a22206d3c04660097d4ae1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111394
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111437
-rw-r--r-- | sc/source/core/data/column3.cxx | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index a72619bd1a3a..f1a621a985b5 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -812,11 +812,6 @@ class DeleteAreaHandler bool mbDateTime:1; ScColumn& mrCol; - SCROW mLastToDeleteRow1; - SCROW mLastToDeleteRow2; - SCROW mLastEmptyRow1; - SCROW mLastEmptyRow2; - public: DeleteAreaHandler(ScDocument& rDoc, InsertDeleteFlags nDelFlag, ScColumn& rCol) : mrDoc(rDoc), @@ -825,12 +820,7 @@ public: mbString(nDelFlag & InsertDeleteFlags::STRING), mbFormula(nDelFlag & InsertDeleteFlags::FORMULA), mbDateTime(nDelFlag & InsertDeleteFlags::DATETIME), - mrCol(rCol), - mLastToDeleteRow1(-1), - mLastToDeleteRow2(-1), - mLastEmptyRow1(-1), - mLastEmptyRow2(-1) - {} + mrCol(rCol) {} void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize) { @@ -868,20 +858,6 @@ public: } break; case sc::element_type_empty: - { - // See usage below. - if( mLastToDeleteRow1 >= 0 ) - { - SCROW nRow1 = node.position + nOffset; - SCROW nRow2 = nRow1 + nDataSize - 1; - if( nRow1 == mLastToDeleteRow2 + 1 ) - { - mLastEmptyRow1 = nRow1; - mLastEmptyRow2 = nRow2; - } - } - return; - } default: return; } @@ -889,16 +865,7 @@ public: // Tag these cells for deletion. SCROW nRow1 = node.position + nOffset; SCROW nRow2 = nRow1 + nDataSize - 1; - // tdf#139820: Decide whether to include 'empty' cells in the range to delete. - // This may make sense because if the column contains a mix of empty and non-empty - // cells, then deleting a range of those cells would normally make mdds operate - // on ranges of such cells, event though it could simply delete them all in one go. - if( mLastEmptyRow1 >= 0 && nRow1 == mLastEmptyRow2 + 1 ) - nRow1 = mLastEmptyRow1; maDeleteRanges.set(nRow1, nRow2, true); - mLastToDeleteRow1 = nRow1; - mLastToDeleteRow2 = nRow2; - mLastEmptyRow1 = mLastEmptyRow2 = -1; } void deleteNumeric(const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize) |