Bug 119957 - overwrites the contents of all cells when the filter is active (dragging up)
Summary: overwrites the contents of all cells when the filter is active (dragging up)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard:
Keywords:
Depends on: 113785
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-18 13:52 UTC by kabilo
Modified: 2022-02-10 17:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kabilo 2018-09-18 13:52:11 UTC
Description:
copying cell contents by dragging from bottom to top overwrites the contents of all cells (in copying range) when the filter is active (some rows are filtered)

Steps to Reproduce:
1.turn on the filter
2.filter the test data
3.copy the contents of the drag cell from the bottom through the hidden lines
4.clear the filter


Actual Results:
content hidden cells is overwritten

Expected Results:
content of hidden cells should not be overwritten


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Buovjaga 2018-10-12 17:02:43 UTC

*** This bug has been marked as a duplicate of bug 113785 ***
Comment 2 Justin L 2022-02-09 12:21:07 UTC
This is not a duplicate. The hidden cells have been erased since at least LO 3.5.

Bug 113785 is about the NON-HIDDEN cells being erased as well.
Comment 3 Justin L 2022-02-09 18:34:20 UTC
from bug 113785 comment 3, we have attachment 137778 [details] to test with.

1- filter the "Data-2" to "test1"

2- Put with mousepointer on "C11" on the lower right edge and pull it up
to "C5".

3- turn off the filter. All of the hidden lines are now blank. They should have been unaffected.

Note that in the bPositive direction, this problem is not seen.

The problem is crazy simple. IsDataFiltered is returning FALSE, because the range provided to the function is not normalized in the negative direction. And so
if (!IsDataFiltered) 
   DeleteArea() // erase everything. Ouch.

See proposed fix at http://gerrit.libreoffice.org/c/core/+/129735
Comment 4 Justin L 2022-02-10 17:19:59 UTC
I put the wrong bug number on the patches specifically for this bug report. The patch is landing in bug 113785 instead.

In master, it is 
https://git.libreoffice.org/core/commit/bda200a5e9c4592bd61b7924fa171ec3265bfd24

tdf#113785 sc: IsDataFiltered must be normalized

It has been pushed for 7.4 and 7.3.1, and I'll propose it for 7.2 as well if the prerequisite patch is accepted first.