Bug 45958 - Only Copy Visible Cells (after a filter) doesn't work when only unfiltered columns are selected
Summary: Only Copy Visible Cells (after a filter) doesn't work when only unfiltered co...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.3.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
: 92125 (view as bug list)
Depends on:
Blocks: Cut-Copy Cell-Selection
  Show dependency treegraph
Reported: 2012-02-12 11:38 UTC by pirri
Modified: 2018-07-10 18:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

CALC example (9.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-02-12 11:38 UTC, pirri

Note You need to log in before you can comment on or make changes to this bug.
Description pirri 2012-02-12 11:38:40 UTC
Created attachment 56922 [details]
CALC example

In the LibO online manual (http://help.libreoffice.org/Calc/Only_Copy_Visible_Cells) says : 

Cells were filtered by AutoFilters, standard filters or advanced filters. --> Only the visible cells of the selection are copied, deleted, moved, or formatted. 

This is not completly true, at least when you want to COPY data. 

Try this:

1. Open the attachment.
2. Filter the data (for example, by Country).
3. Edit-->Select all, then copy, then go to sheet 2 and paste the data. Only the visible cells are copied (as expected ).

Now, try this:

1. With the data still filtered, select column "Name" and then hold CTRL and select column "Salary"
2. Edit -> Copy, and then paste the date in the sheet 2.

As you can see, ALL cells are copied, not only the visible ones. The expected behavior should be copy the visible cells only (I think).
Comment 1 pirri 2012-02-12 12:16:38 UTC Comment hidden (obsolete)
Comment 2 Roman Eisele 2012-05-03 10:09:46 UTC Comment hidden (obsolete)
Comment 3 sasha.libreoffice 2012-05-17 06:32:50 UTC
Thanks for bugreport
reproduced in 3.3.4 and 3.5.3 on Fedora 64 bit

What is interesting: in 3.3.4 after apply filter, all rows except selected by filter are hidden (in msExcel 2007 the same). But in 3.5.3 not only rows selected by filter are shown, but also all empty rows.

Changing version to 3.3.4 as most early reproducible
Comment 4 Mirosław Zalewski 2013-08-16 21:33:33 UTC
@Kohei: could you take a look at this? Check if this qualifies as EasyHack and possibly give some code pointer for anyone interested in working on this?

It seems that "Copy only visible cells" feature is triggered only if filtered column is copied along.
Comment 5 QA Administrators 2015-04-01 14:41:37 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2015-04-23 18:48:01 UTC
Repro with attachment 56922 [details].

Win 7 Pro 64-bit Version: (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: fi_FI
Comment 7 QA Administrators 2016-09-20 09:32:08 UTC Comment hidden (obsolete)
Comment 8 Mirosław Zalewski 2016-09-20 17:06:32 UTC
Reproduced on:
Build ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU Threads: 1; OS Version: Windows 6.2; UI Render: default; 
Locale: pl-PL (pl_PL)
Comment 9 UserBDF1011 2017-03-21 01:11:44 UTC
I have stumbled upon this nasty bug also on Calc version
Some more info about it: it happens on ods and xls, so document type seems irrelevant.
I was copying rows, not columns but behavior is the same.

There is a catch how to avoid the bug with some extra steps, but most people will not do this in real life when using Calc.
When I open the document and just open filter combo box that effectively filters visible data, I just (re)click the filter to be exactly the same as it was originally and apply it (again). So it does not result in any visible changes. But then copy/paste works as expected.
Comment 10 Timur 2018-02-21 12:42:22 UTC
*** Bug 92125 has been marked as a duplicate of this bug. ***