Commit 2102d0f1 authored by Morten Welinder's avatar Morten Welinder

Foreign paste: improve guessing of pasted range.

LibreOffice's paste format fails to specify the range being pasted
so we have to make a guess.
parent 0c3ba336
......@@ -2,6 +2,9 @@
* src/gui-clipboard.c (gnm_x_claim_clipboard): Plug leak. Debug
improvements.
(table_cellregion_read): Improve paste-range heuristic for
clipboard formats that lack that information, notably
LibreOffice's.
* src/workbook-view.c (get_uri_modtime): Fix criticals on paste
from LibreOffice. (Which sends a zipfile over the clipboard.)
......
......@@ -12,6 +12,7 @@ Morten:
* Test suite improvements.
* Fix problems with boxed types.
* Avoid most punting for object properties.
* Fix paste from LibreOffice.
--------------------------------------------------------------------------
Gnumeric 1.12.39
......
......@@ -327,10 +327,21 @@ table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
if (rp) {
r = *rp;
} else {
r.start.col = 0;
r.start.row = 0;
r.end.col = tmpsheet->cols.max_used;
r.end.row = tmpsheet->rows.max_used;
// File format didn't tell us the range being
// pasted. Looking at you, LibreOffice!
// Make a guess.
GnmRange fullr;
GnmStyle **col_defaults =
sheet_style_most_common (tmpsheet, TRUE);
range_init_full_sheet (&fullr, tmpsheet);
r = sheet_get_cells_extent (tmpsheet);
sheet_style_get_nondefault_extent
(tmpsheet, &r, &fullr, col_defaults);
g_free (col_defaults);
}
ret = clipboard_copy_range (tmpsheet, &r);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment