mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-02 02:33:55 -06:00
Tables never hold merged cells, which Excel removes the table for on open
A table with a merged cell in it opened in Excel with the repair prompt, and Excel removed the
table and its AutoFilter ("Removed Feature: Table from /xl/tables/table1.xml"). GridCraft let
merged cells into a table four ways; each now does what Excel does:
- Merge Cells, Merge & Center and Merge Across refuse a range that touches a table ("You can't
merge cells in a table."). Unmerging is still allowed, so a file that has one can be fixed.
- Insert Table / Format as Table and Resize Table unmerge the merged cells the table covers
(observed: Excel creates the table and A2:B2 is no longer merged).
- Paste brings merged areas along, except into a table, where the cells arrive unmerged.
The command-sequence fuzzer checks the invariant (it found the paste case, seed 230).
This commit is contained in:
committed by
David Leonardo Ardila
parent
f2044337c7
commit
f32fefddcf
@@ -37,6 +37,8 @@ pub(super) fn table_resize(s: &mut Session, p: &Json) -> Result<Json> {
|
||||
}
|
||||
t.columns = cols;
|
||||
t.range = r;
|
||||
// A table can't hold merged cells: those it now covers are unmerged, as by Insert Table.
|
||||
sheet.merges.retain(|m| !m.intersects(&r));
|
||||
cx.structural = true;
|
||||
Ok(Json::Null)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user