Bug 146689 - calc formula to value (linkvalue, sheetlinkmode) changed by macro copies first sheet
Summary: calc formula to value (linkvalue, sheetlinkmode) changed by macro copies firs...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
 
Reported: 2022-01-10 21:03 UTC by debewerking
Modified: 2022-12-05 17:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
spreadsheet - two sheets - embedded python (8.25 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-01-10 21:03 UTC, debewerking
Details
result of dpkg -l | grep libreoffice (4.64 KB, text/plain)
2022-01-10 21:04 UTC, debewerking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description debewerking 2022-01-10 21:03:06 UTC
Created attachment 177445 [details]
spreadsheet - two sheets - embedded python

I want to convert formulas to values in all spreadsheets of a document.
To this end wrote a macro (embedded) to do so. Summary

from com.sun.star.sheet.SheetLinkMode import VALUE  as LINKVALUE
for j in range(oSheets.Count):
    oSheet = oSheets.getByIndex(j)
    oSheet.LinkMode = LINKVALUE

1. reproduce result by running embedded macro.

2. expected result is a document with no formulas present in each sheet

3. produced are sheets with no formulas on it and >>>>
   sheet2 is now a copy of sheet1

used: linuxMint 20.2 with distributed LibO
Comment 1 debewerking 2022-01-10 21:04:48 UTC
Created attachment 177446 [details]
result of dpkg -l | grep libreoffice
Comment 2 debewerking 2022-01-12 20:53:17 UTC
ad 3) produced is the first sheet with no formulas, the second has become a copy of the first.

This is also the case when the document contains more sheets: all become a copy of the first
Comment 3 Buovjaga 2022-12-05 17:03:41 UTC
I copied the file to my home directory as bug.ods (as the macro was expecting the path).

There is a formula in D3 of Sheet1.

Running the macro createUpdateSource creates a document bug_tmp.ods which shows how Sheet2 becomes overwritten by Sheet1 contents.

Not sure about the specifics, but setting to NEW for now.

Arch Linux 64-bit
Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 400e44cebd993f4b9b3d878fb9264f99e005c9fb
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 5 December 2022