Description: this macro worked with libreoffice 6.x and earlier, but with the new version it no longer works when I try to intercept merged cells. (with LO 7.x it only works when it comes to intercepting single cells) sub CellPrint oSheet = ThisComponent.CurrentController.ActiveSheet oActiveCell = ThisComponent.getCurrentSelection() testo = oActiveCell.string print testo end sub BASIC runtime error. Property or method not found: string Steps to Reproduce: 1 enter text in a cell 2 merge with adjacent cell 3 run the macro Actual Results: BASIC runtime error. Property or method not found: string Expected Results: print text Reproducible: Always User Profile Reset: No OpenGL enabled: Yes Additional Info: no
Regression after https://git.libreoffice.org/core/+/605b4ba57b2daa447af9d43d3759079e15df8148 > author Attila Szűcs <szucs.attila3@nisz.hu> Fri Sep 18 12:59:38 2020 +0200 > tdf#43958 sc: fix fill by selecting merged cell This is accidental API change. Note also that clicking at a merged cell now shows all related columns and rows selected, and the full range shown in Name Box.
In the function ScTabViewObj::getSelection() either a ScCellObj or a ScCellRangeObj will be created based on the selection. Imho, we could check if the contained range is merged and create the object accordingly, or we could add the XTextRange to the ScCellRangeObj. I would opt for the former, i.e., a check if the range is merged.
Proposed patch: https://gerrit.libreoffice.org/c/core/+/145378
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b9411e587586750f36ba9009b5f1e29fe461d8b5 tdf#147122 - Return cell object when a simple selection is merged It will be available in 7.6.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.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/bf39a7a45a9e6d1292a4425e5d25f9ce6551205a tdf#147122 - Return cell object when a simple selection is merged It will be available in 7.5.1. 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.