odoo/o-spreadsheet#4120

Created by fw-bot
Merged at 9b3096358c5e81c12d7a20c5c7984c2c275b2aab

Statuses:

label
odoo:saas-16.4-16.0-fix-remove-rows-borders-adrm-UPCG-fw
head
86e7432cbaf4c5dd5764e53f6fd0c647ee7e0df9
merged
1 year ago by BI, Lucas Lefèvre (lul)
odoo/o-spreadsheet
saas-16.3 #4119
15.0
saas-16.4 #4120
16.0 #4109
17.0 #4121
saas-17.1 #4122
18.0
saas-17.2 #4123
saas-18.1
saas-18.2
saas-18.3
saas-18.4
master #4124

[FW][FIX] borders: wrong borders on remove rows

Description

When removing multiple headers, the borders are not shifted correctly, leading to incorrect borders.

This happens because we modify the borders for each deleted rows separately. But we don't sort the rows before modifying the borders. So we first delete the row 1, then the row 2. But the row 2 is now the row 1, since the old row 1 has been deleted. So we end up with wrong operations.

This is solved by simply sorting the rows in reverse order before modifying the borders.

Task: : 3884112

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo

Forward-Port-Of: #4119
Forward-Port-Of: #4109