SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.66k stars 3.19k forks source link

Spreadsheet: cannot copy one cell to many #4010

Closed danboid closed 3 years ago

danboid commented 4 years ago

Currently you cannot copy the data from one cell and paste it into multiple other cells.

alimpfard commented 4 years ago

I unintentionally left this out when implementing copying, here's some food for thought though, what should happen if we try to copy a bunch of cells to another bunch of cells (with different sizes)?

danboid commented 4 years ago

With different sizes? Do you mean if the user has resized the cells width or height? I don't think the user would want to copy that, only the data.

In pretty much all "what should we do?" cases, just look at how libreoffice calc does it and replicate that in the easiest or most sane way.

alimpfard commented 4 years ago

Different sizes as in "copy 4 cells into 9 cells", for instance.

Libreoffice seems to be tiling the target selection with the source selection...interesting Doubly interesting: it doesn't allow copying a non-rectangular selection

danboid commented 3 years ago

Will this be tricky to fix?

alimpfard commented 3 years ago

the "copy one cell to many"? no, not really, I believe another special case in copy_cells() for from.size() == 1 would resolve this issue the "tile the selection with the copied cells", however? perhaps, I haven't given it much thought.