Created attachment 88706 [details] Example document of not-saved-CodeName value When sheet's .CodeName value is changed by basic macro and document is saved and then reopened, new .CodeName value is lost. See attached example - using two functions, first for setting .CodeName before saving the document, second for displaying it after reopen: Sub ABCD Dim MySheet As Object Set MySheet = ThisComponent.getSheets().getByName("List1") MsgBox(MySheet.CodeName) MySheet.CodeName = "NewName" MsgBox(MySheet.CodeName) End Sub Sub EFGH Dim MySheet As Object Set MySheet = ThisComponent.getSheets().getByName("List1") MsgBox(MySheet.CodeName) End Sub
Yep, I don't get NewName after saving & reopening. Win 7 64-bit Version: 4.4.0.0.alpha1+ Build ID: 8b21b5cbe78945b27525b4ce78ae3d981f90590f TinderBox: Win-x86@39, Branch:master, Time: 2014-11-06_03:55:51
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.4 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-12-20
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.1.6 or 5.2.3 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20170103
Still repro Arch Linux 64-bit Version: 6.4.0.0.alpha0+ Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503 CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US Calc: threaded Built on 6 August 2019
just a guess: https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/xmlexprt.cxx?r=09402293#5149 https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/xmlexprt.cxx?r=09402293#5172 https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/xmlwrap.cxx?r=889dc7bf#570
https://opengrok.libreoffice.org/search?project=core&full=&defs=&refs=setVBACompatibilityMode&path=&hist=&type=&si=refs
Still repro Arch Linux 64-bit Version: 7.0.1.2 Build ID: 00(Build:2) CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US =7.0.1-1 Calc: threaded
Comment on attachment 88706 [details] Example document of not-saved-CodeName value Version: 7.0.1.2 Build ID: 00(Build:2) CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: kf5 Locale: es-ES (es_ES.UTF-8); Interfaz: es-ES =7.0.1-1 Calc: threaded Please, this behavior has been like this for a long time. Time to fix it and it won't take much developer time. CodeName is updated on all sheets when the document is opened. In the first one, it takes the default value for the new sheet, for the rest, it takes the value of the sheet name. sheet.CodeName = sheet.Name CodeName should be persistent.
As himajin100000@gmail.com pointed out, if we drop the line at https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/xmlexprt.cxx?r=09402293#5143 (vba compatibility mode) the codename persists after closing and reopening the document. I have to clarify via IIRC, how we could solve this issue.
It seems that this was done on purpose: https://github.com/LibreOffice/core/commit/d51b5501b66fd73252a4788ba0e2e215156c5488 So what do you think about dropping it again?
175/5000 I dont know. I don't understand what CodeName has to do with CodeNameProvider and CodeNameAccess. However, if you think that fixes the CodeName persistence issue, go ahead.
https://gerrit.libreoffice.org/c/core/+/103589
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7f43c1d203b3513462bb36eaea7bf7b41956c7b6 tdf#71271 - add code names regardless of VBA compatibility mode It will be available in 7.1.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.
Thx again to himajin100000@gmail.com and Mike Kaganski.
Confirm fix it in: Version 7.1.0.0 alpha1 Thanks.
note: It seems that closing the ods file after running this program does not give any warning about being unsaved.
Should there be filed a different bug for this behaviour?