mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Spreadsheet: Allow copying from one cell to many
This simply fils the target selection with the source cell. Fixes #4010.
This commit is contained in:
parent
48d8534967
commit
3bafef0b15
Notes:
sideshowbarker
2024-07-19 01:16:25 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/3bafef0b159 Pull-request: https://github.com/SerenityOS/serenity/pull/4149 Issue: https://github.com/SerenityOS/serenity/issues/4010 Issue: https://github.com/SerenityOS/serenity/issues/4136
1 changed files with 12 additions and 0 deletions
|
@ -299,6 +299,18 @@ void Sheet::copy_cells(Vector<Position> from, Vector<Position> to, Optional<Posi
|
|||
return;
|
||||
}
|
||||
|
||||
if (from.size() == 1) {
|
||||
// Fill the target selection with the single cell.
|
||||
auto& source = from.first();
|
||||
for (auto& position : to) {
|
||||
#ifdef COPY_DEBUG
|
||||
dbg() << "Paste from '" << source.to_url() << "' to '" << position.to_url() << "'";
|
||||
#endif
|
||||
copy_to(source, resolve_relative_to.has_value() ? offset_relative_to(position, source, resolve_relative_to.value()) : position);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Just disallow misaligned copies.
|
||||
dbg() << "Cannot copy " << from.size() << " cells to " << to.size() << " cells";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue