o-spreadsheet icon indicating copy to clipboard operation
o-spreadsheet copied to clipboard

[FIX] clipboard: cannot paste chart with deleted ranges

Open hokolomopo opened this issue 10 months ago • 1 comments

Description

Before this commit, when pasting a chart with ranges in its data/labels that were deleted between the copy and the paste, the clipboard would traceback.

That's because getRangeString crashed when the sheetId does not exist anymore. Fixed it by making the function return a string with an invalidSheetName error rather than crashing.

Also replace the uses of getRangeString with getValidRangeString, which will return undefined for invalid ranges so the typing forces us to handle it properly.

Task: : 3618758

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

hokolomopo avatar Apr 11 '24 09:04 hokolomopo

@robodoo r+

rrahir avatar May 30 '24 09:05 rrahir