Bug 147122 - Different behavior in basic LO 6.x and 7.2.4.1 (calc)
Summary: Different behavior in basic LO 6.x and 7.2.4.1 (calc)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL: https://ask.libreoffice.org/t/differe...
Whiteboard: target:7.6.0 target:7.5.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-02-02 09:08 UTC by paolo möseneder
Modified: 2023-06-16 12:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paolo möseneder 2022-02-02 09:08:49 UTC
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
Comment 1 Mike Kaganski 2022-02-02 09:16:53 UTC
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.
Comment 2 Andreas Heinisch 2023-01-09 20:48:52 UTC
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.
Comment 3 Andreas Heinisch 2023-01-13 08:04:22 UTC
Proposed patch: https://gerrit.libreoffice.org/c/core/+/145378
Comment 4 Commit Notification 2023-01-16 08:29:23 UTC
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.
Comment 5 Commit Notification 2023-01-16 11:19:56 UTC
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.