| 
1 | 1 | import { BACKGROUND_CHART_COLOR, FORMULA_REF_IDENTIFIER } from "../constants";  | 
2 |  | -import { getItemId, getUniqueText, sanitizeSheetName } from "../helpers";  | 
 | 2 | +import { getItemId, getUniqueText, recomputeZones, sanitizeSheetName } from "../helpers";  | 
3 | 3 | import { toXC } from "../helpers/coordinates";  | 
4 | 4 | import { getMaxObjectId } from "../helpers/pivot/pivot_helpers";  | 
5 | 5 | import { DEFAULT_TABLE_CONFIG } from "../helpers/table_presets";  | 
6 | 6 | import { overlap, toZone, zoneToXc } from "../helpers/zones";  | 
7 | 7 | import { Registry } from "../registries/registry";  | 
8 |  | -import { CustomizedDataSet, DEFAULT_LOCALE, Format, WorkbookData, Zone } from "../types";  | 
 | 8 | +import { CustomizedDataSet, DEFAULT_LOCALE, Format, UID, WorkbookData, Zone } from "../types";  | 
9 | 9 | import { normalizeV9 } from "./legacy_tools";  | 
10 | 10 | import { WEEK_START } from "./locale";  | 
11 | 11 | 
 
  | 
@@ -548,6 +548,32 @@ migrationStepRegistry  | 
548 | 548 |       }  | 
549 | 549 |       return data;  | 
550 | 550 |     },  | 
 | 551 | +  })  | 
 | 552 | +  .add("19.0", {  | 
 | 553 | +    migrate(data: WorkbookData): any {  | 
 | 554 | +      for (const sheet of data.sheets || []) {  | 
 | 555 | +        const borderType: Record<UID, Zone[]> = {};  | 
 | 556 | +        for (const zoneXc in sheet.borders) {  | 
 | 557 | +          const borderId = sheet.borders[zoneXc];  | 
 | 558 | +          if (!borderId) continue;  | 
 | 559 | +          if (!(borderId in borderType)) borderType[borderId] = [];  | 
 | 560 | +          borderType[borderId].push(toZone(zoneXc));  | 
 | 561 | +        }  | 
 | 562 | +        const borders = {};  | 
 | 563 | +        for (const borderId in borderType) {  | 
 | 564 | +          const border = data.borders[borderId];  | 
 | 565 | +          if (!border) continue;  | 
 | 566 | +          const zones = recomputeZones(borderType[borderId]);  | 
 | 567 | +          if (border.left || border.right) border.vertical = border.left || border.right;  | 
 | 568 | +          if (border.top || border.bottom) border.horizontal = border.top || border.bottom;  | 
 | 569 | +          for (const zone of zones) {  | 
 | 570 | +            borders[zoneToXc(zone)] = borderId;  | 
 | 571 | +          }  | 
 | 572 | +        }  | 
 | 573 | +        sheet.borders = borders;  | 
 | 574 | +      }  | 
 | 575 | +      return data;  | 
 | 576 | +    },  | 
551 | 577 |   });  | 
552 | 578 | 
 
  | 
553 | 579 | function fixOverlappingFilters(data: any): any {  | 
 | 
0 commit comments