Bug 144085 - (Spreadsheets) XUsedAreaCursor broken: the methods don't accept formatted cells as used.
Summary: (Spreadsheets) XUsedAreaCursor broken: the methods don't accept formatted cel...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.2
Keywords: bibisected, bisected, regression
: 144259 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-25 16:40 UTC by Wolfgang Jäger
Modified: 2021-09-13 14:25 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The mentioned example (10.67 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-08-25 16:40 UTC, Wolfgang Jäger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2021-08-25 16:40:21 UTC
Created attachment 174535 [details]
The mentioned example

The methods .gotoStartOfUsedArea and .gotEndOfUsedArea no longer regard formatted cells (directly or by assigning a cell style) as used.  
The previous 7.2.0.2RC also didn't.  
In V7.1.1.2 the methods work as expected in most cases, but do not accept cells having set text attributes, but not containing a string.  

The example sheet contains a link to the demonstrating Sub created with =HYPERLINK() in C7. B3 has Bold, Italic, and red text color, but no string.

The Basic module:  

REM  *****  BASIC  *****

Sub showUsedAreaOfActiveSheet()
Dim cellCursor As Object, cCtrl As Object, sheet As Object
  cCtrl = ThisComponent.CurrentController
  sheet = cCtrl.ActiveSheet
  cellCursor = sheet.createCursor()
  cellCursor.gotoStartOfUsedArea(False)
  cellCursor.gotoEndOfUsedArea(True)
  cCtrl.select(cellCursor)
  MsgBox(cellCursor.AbsoluteName)
  REM Expected: "$Sheet1.$B$3:$E$17 (B3 set to Bold....)
  REM With V7.2.0.4 : "$Sheet1.$B$5:$C$10"
  REM With V7.1.1.2 : NEARLY as expected: B5:E17. 
  REM Cell B3 has text attributes, but no string. It sis NOT accepted as usede in 7.1.1.2
End Sub

Probably related: tdf#135203 (?? tdff#137667 ??)
Comment 1 Mike Kaganski 2021-08-25 17:15:59 UTC
Regression after https://git.libreoffice.org/core/+/61386aa03cd166473a58dbb4be0dd5e0ce82195c
Comment 2 Commit Notification 2021-09-12 06:04:58 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d8b765e6c45792bff5717cd0e0d9d42311c33461

tdf#144085 XUsedAreaCursor broken: the methods don't accept formatted cells as used

It will be available in 7.3.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 3 Commit Notification 2021-09-12 15:29:54 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/e7a9929f873d6708c9a0c7081b492d8f8d969b8e

tdf#144085 XUsedAreaCursor broken: the methods don't accept formatted cells as used

It will be available in 7.2.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.
Comment 4 Xisco Faulí 2021-09-13 08:26:34 UTC
*** Bug 144259 has been marked as a duplicate of this bug. ***
Comment 5 Commit Notification 2021-09-13 14:25:20 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ded2c1eee423235bc26ff4ab467988ab286e59d4

tdf#144085: sc_macros_test: Add unittest

It will be available in 7.3.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.