Description: I have a spreadsheet that contains a lot of formulas. Since I don't like seeing "0"s where there is no data, and, I don't like changing the application/global option^^ just for one sheet, I make the formulas return "" when there is no data; a blank string. I've been experimenting with turning off screen updates in my macro code to make my macros run faster, and got into a state where, despite the formulas returning "", "0"s were being displayed instead. Hitting F2 + enter on an affected cell did not affect the issue. Resetting my user profile did not affect the issue. Examining a backup copy showed that the problem was constrained within the affected sheet somehow. Critically, changing the global option _did not affect the issue_. Zeros were always displayed. I took apart the ODS zip and did some digging. This line was present in settings.xml and setting its value to "true" fixed the issue. <config:config-item config:name="AutoCalculate" config:type="boolean">false</config:config-item> ^^Changing the global option would alter other sheets that may depend on this option being set a particular way, and, would make my sheet display differently in others' Calc instances that don't have the global option set the expected way. So not changing the global option, and making my sheet work with the default settings is the proper way to handle this. Steps to Reproduce: Run a macro that does ThisComponent.enableAutomaticCalculation(False) without the corresponding "True" call, and then save the sheet. I think. I'm not sure how else the sheet could get into that state, and, I had just tried enableAutomaticCalculation while testing turning off screen updating. Actual Results: Sheet forever displays "0"s instead of the expected ""s. Expected Results: Formulas are respected, and ""s are displayed. Also expect that changing the global option would correct the option in the sheet, or if that's not feasible, then there is UI to correct this. Reproducible: Always User Profile Reset: Yes Additional Info: Posting this bug mainly to help others who end up having a sheet showing "0"s instead of ""s and can't figure out how to correct the situation. Version: 24.8.4.2 (X86_64) / LibreOffice Community Build ID: 480(Build:2) CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: en-US (C.UTF-8); UI: en-US Ubuntu package version: 4:24.8.4~rc2-0ubuntu0.24.04.1~lo1 Calc: threaded
Please attach a sample file, reduce the size as much as possible without private information.
Request seen. This may take some time to generate.
Took less time than expected. I tested with a fresh user profile, so there's no interference from my actual user profile. I created Holdings-165695-bug--AutoCalculate-true.ods by: - open Calc, save a new blank spreadsheet - organize macros, add Module1, paste in the Basic code from external storage - run macro Create_Blank to make a blank sheet - fill in one line of data and a couple of details - save Holdings-165695-bug--AutoCalculate-true.ods - observe blanks in the formatted section below the freeze line, as expected - close Holdings-165695-bug--AutoCalculate-true.ods Then I unzipped Holdings-165695-bug--AutoCalculate-true.ods , changed the AutoCalculate setting in settings.xml to false and rezipped the file to Holdings-165695-bug--AutoCalculate-false.ods . - open Holdings-165695-bug--AutoCalculate-false.ods - observe zeros where blanks should be The macros are probably not part of the issue but the sheet calls a few of them, so I didn't cut them out.
Created attachment 199798 [details] Example test case, working as expected
Created attachment 199799 [details] Example test case, broken The only change between this and the working case is the AutoCalculate setting in settings.xml
Just in case it matters: unzip_ods () { local filename="${1}"; if [[ -z "${filename}" ]]; then echo "ERROR: Required parameter <filename> missing"; return 1; fi; local dirname="${filename}.dir"; if [[ -e "${dirname}" ]]; then echo "ERROR: '${dirname}' exists, not overwriting"; return 2; fi; mkdir "${dirname}"; cd "${dirname}"; unzip "../${filename}"; for f in *.xml; do local name="${f%.*}"; local extension="${f##*.}"; local bakfilename="${name}-bak.${extension}"; cp -pr "${f}" "${bakfilename}"; xmllint --format "${bakfilename}" > "${f}"; done } zip_ods () { local filename="${1}"; if [[ -z "${filename}" ]]; then echo "ERROR: Required parameter <filename> missing"; return 1; fi; if [[ -e "${filename}" ]]; then echo "ERROR: '${filename}' exists, not overwriting"; return 2; fi; zip -0qX "${filename}" mimetype; zip -DqrX "${filename}" Basic/ settings.xml; zip -DqrX "${filename}" $(find Configurations2 -type f); zip -0qX "${filename}" $(find Configurations2 -type d -empty); zip -DqrX "${filename}" Scripts/ styles.xml manifest.rdf content.xml meta.xml Thumbnails/ META-INF/; echo "===================================================================================================="; echo "WARNING: This is a hand-rolled solution and may be incomplete"; echo " Please verify against the original ODS file where possible"; echo "===================================================================================================="; echo; unzip -v "${filename}" }
Example files provided some time ago. I thought that would get seen and the status would change away from NEEDINFO, but I was wrong. Trying to update the status manually now.
NOTE: It is not necessary to "Enable Macros" when opening the godo and bad test cases, the problem is present either way. Reproduced on: Version: 25.2.5.2 (X86_64) / LibreOffice Community Build ID: 520(Build:2) CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: gtk3 Locale: en-US (C.UTF-8); UI: en-US Ubuntu package version: 4:25.2.5~rc2-0ubuntu0.24.04.1~lo1 Calc: threaded
I did not test but please see if duplicate of bug 153766.
(In reply to Timur from comment #9) > I did not test but please see if duplicate of bug 153766. I checked my examples. This bug is a duplicate of bug 153766 in that, [ Data -> Calculate -> Autocalculate ] is off for my bad case and is off for 153766's case. This bug is not a duplicate in that, my bad case isn't doing any conditional formatting. Rather, there is some mishandling of macros occurring; either not being run, or not properly displaying the output.