Bug 155359 - If the first row of a selected cell range contains merged cells, ThisComponent.getCurrentSelection() only selects the merged cell.
Summary: If the first row of a selected cell range contains merged cells, ThisComponen...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-16 15:00 UTC by Nick
Modified: 2023-06-16 12:39 UTC (History)
1 user (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 Nick 2023-05-16 15:00:53 UTC
Description:
I select a range of cells and then run a macro that places a border around the selected cells. The macro uses ThisComponent.getCurrentSelection(), and I've checked it to see that it does get ScCellRangeObj. The macro works as expected.
However, if the first row of the selected range contains merged cells, ThisComponent.getCurrentSelection() only "gets" the first row of merged cells as ScCellObj.
Note: If the any other row conatins merged cells, ThisComponent.getCurrentSelection() gets the complete range, ScCellRangeObj.

Steps to Reproduce:
1.In a Calc document merge cells A1:E1
2.Select A1:E10
3.Run a simple macro containing:
Dim oSel As Object
oSel = ThisComponent.getCurrentSelection()
MsgBox oSel.ImplementationName
 

Actual Results:
ScCellObj, i.e., A1:E1

Expected Results:
ScCellRangeObj, i.e, A1:E10


Reproducible: Always


User Profile Reset: No

Additional Info:
Unable to copy the information from menu Help - About LibreOffice.
Comment 1 Werner Tietz 2023-05-16 16:36:45 UTC
Hallo

Cannot reproduce with:

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Raspbian package version: 1:7.0.4-4+rpi1+deb11u3
Calc: threaded
Comment 2 Julien Nabet 2023-05-16 20:06:38 UTC
It only displays: "ScCellRangeObj"
Comment 3 Nick 2023-05-16 20:16:03 UTC
(In reply to Werner Tietz from comment #1)
> Hallo
> 
> Cannot reproduce with:
> 
> Version: 7.0.4.2
> Build ID: 00(Build:2)
> CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
> Locale: de-DE (de_DE.UTF-8); UI: de-DE
> Raspbian package version: 1:7.0.4-4+rpi1+deb11u3
> Calc: threaded

I'm not surprised. I forgot to mention, I did not have this happen with older versions.
Comment 4 Werner Tietz 2023-05-17 07:21:00 UTC
@Julien Nabet: Thats the expected return!
Comment 5 Julien Nabet 2023-05-17 08:34:22 UTC
(In reply to Werner Tietz from comment #4)
> @Julien Nabet: Thats the expected return!

Ok so then how to know if the range is A1:E1 or A1:E10 ?
Comment 6 Nick 2023-05-17 10:57:58 UTC
If I highlight A1:E10 I expect ThisComponent.getCurrentSelection() to get me A1:E10, and not A1:E1.
Comment 7 Nick 2023-05-17 15:45:23 UTC
I just upgraded to:
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

BUG no longer exists!
Comment 8 Julien Nabet 2023-05-17 15:58:29 UTC
Let's rather put this one as WFM since there's no specific fix spotted here.
Comment 9 Mike Kaganski 2023-06-16 12:39:50 UTC
This is *most likely* bug 147122; however, neither comment 0, nor comment 3 mentioned the version that experienced the problem (and Julien didn't mention it, 
too ;-P)

The version in the meta shows "7.5.2.2", which is confusing, since the problem is expected to be fixed in 7.5.1 already.

In the future, please do not omit the full version info in the problem description, even if you believe it's "redundant", being filled in the metadata. No it is not; the metadata may change with time; and comments allow to track the evolution and e.g. if original problem isn't hijacked by someone experiencing a similar, but different thing. Thank you.