Commit 2ec7c34
committed
[FIX] borders: preserve side borders when combining External and All
When applying an External border on a range and then applying All borders on
an inner/overlapping range, the side borders (left/right) of the inner cells
were lost after re-opening the spreadsheet.
The exported border data was correct, but the BordersPlugin recomputation
logic in addBorder incorrectly cleared adjacent borders on import/update. The
adjacency check (adjacent(existingBorder.zone, zone)) reported the side of the
existing zone, but we were deciding whether to clear it based on the same side
key in the new border, instead of the opposite side (shared edge) on the new
zone. As a result, importing the combination of:
C2:C4 with All borders
B2:B4 with left/top/bottom
D2:D4 with right/top/bottom
ended up clearing the left and right borders of C2:C4.
This commit adjusts the adjacent clearing logic to:
Map the adjacent side of the existing zone to the opposite side on the new
zone.
Only clear the existing side if the corresponding opposite side is actually
being written on the new border.
Task: 52701711 parent eccc2e0 commit 2ec7c34
File tree
2 files changed
+80
-18
lines changed- src/plugins/core
- tests/borders
2 files changed
+80
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
374 | 387 | | |
375 | | - | |
| 388 | + | |
| 389 | + | |
376 | 390 | | |
377 | 391 | | |
378 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1258 | 1306 | | |
1259 | 1307 | | |
1260 | 1308 | | |
| |||
0 commit comments