Bug 160247

Summary: CONVERT becomes CONVERT_OOO when cell formula is set via macro
Product: LibreOffice Reporter: vibrationoflife
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: buzea.bogdan, werner-tietz
Priority: medium    
Version: 7.3.3.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107659    
Attachments: Contains macro that demonstrates bug.

Description vibrationoflife 2024-03-17 21:02:46 UTC
Created attachment 193167 [details]
Contains macro that demonstrates bug.

I attempted to set the cell formaul to CONVERT and it becomes CONVERT_OOO and fails.
I have included an attachment with a simple macro:
The SUM formula works fine. The CONVERT fails.

I have tested this in basic and in python. From version 7.3 to Version 24.2. All fail the same. My testing machine is running Ubuntu 22.04.

Sub Main
  doc = ThisComponent
  sheet = doc.Sheets(0)
  sheet.getCellByPosition(0,0).setValue(1)
  sheet.getCellByPosition(1,0).setValue(2)
  sheet.getCellByPosition(2,0).setFormula("=SUM(A1:B1)")
  sheet.getCellByPosition(3,0).setFormula("=CONVERT(A1, ""yd"", ""m""")
End Sub

Screenshot Link: https://github.com/Amourspirit/python-ooouno-ex/assets/4193389/cdec402a-1386-47c8-838c-6ac50a76a87e
Comment 1 Werner Tietz 2024-03-24 14:46:31 UTC
Hallo

Confirmed with:
Version: 7.4.7.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 4:7.4.7-1+deb12u1
Calc: threaded


___

If I use »…FormulaLocal« instead …»Formula« it works as expected!

```
sheet = XSCRIPTCONTEXT.getDocument().Sheets[0]
sheet[0 , :3].FormulaArray = [[1,2,"=SUM(A1:B1)"]]
# with english Functionnames!
sheet["D1"].FormulaLocal = '=convert(A1;"yd";"m")'