1. Create a new Calc document with two sheets Sheet1 and Sheet2. Activate Sheet1 and add Named range: Name: n_1 Range or Formula expression: $Sheet2.$A$1 Scope: Document (Global) Save document as Book1.ods and close it. 2. Open Book1.ods. Delete sheet Sheet1. Save document as Book2.ods and close it. 3. Open Book2.ods. It doesn't have Named Range n_1! Save document as Book3.ods and close it. In my opinion, the reason is in the tag attribute table:base-cell-address. Book1.ods: <table:named-range table:name="n_1" table:base-cell-address="$Sheet1.$A$1" table:cell-range-address="$Sheet2.$A$1"/> Book2.ods: <table:named-range table:name="n_1" table:base-cell-address="" table:cell-range-address="$Sheet2.$A$1"/> Book3.ods does not contain these tags.
No repro with 7.3 or 7.5+. Vladimir, do not add devs yourself. Instead, check your steps and wait for confirmation.
Repro exactly as explained in comment 0, using Version: 7.4.0.2 (x64) / LibreOffice Community Build ID: 1512ce97d7ed39dce3121f7e15651fd8895f950e CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: CL To clarify a possible confusion: step #1 involves Sheet->Named Ranges and Expressions->Define..., while staying on Sheet1. Timur: this bug was created as a result of discussion in https://ask.libreoffice.org/t/named-ranges-disappear-in-calc/79464/36; so the devs participated there (erAck and me) were added to the created issue. Vladimir: it is best to mention the context in the bug description, like "Ref: URL", or putting the URL to the respective metadata.
Thanks Mike. I reproduce now. Steps are really OK, I first didn't stay on Sheet1.
Colleagues, thank you for your attention to the topic and clarifications!
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9a6c350d8dff4b5228ec7451006115e387f819f2 Resolves: tdf#150312 Move base-cell-address to a valid sheet upon deletion It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6afb3232d32f1ebad0cefb94c145922e217526bd tdf#150312 unit test It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5a1bd80e0d685bbd76de2ebfaa1c6b0380d528f4 Related: tdf#150312 "Repair" broken table:base-cell-address of defined names It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike, thank you so much!
Pending review https://gerrit.libreoffice.org/c/core/+/139659 for 7-4
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d2c500fb40be23aa7bd1d2b7cc02e47ea109d25c Related: tdf#150312 Assert a defined name's non-empty table:base-cell-address It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/98516c7698aa5a492c4e59b4dc6d29815ae77327 Resolves: tdf#150312 Move base-cell-address to a valid sheet upon deletion It will be available in 7.4.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.