Description: If I try to clear formatting within parts of the cell contents on a cell range by a macro, nothing happens: oRange.clearContents(com.sun.star.sheet.CellFlags.EDITATTR) This behavior is proved for Windows 7, LO 5.3.7., Windows 10, LO 6.0.0.2 (32 bit) and for Linux openSUSE LEAP 42.2 with LO 5.3.0 and LO 6.0.1.1 (both generic versions). Doing so in AOO (any version) operates as desired, it clears the formatting of text portions and gives the whole text the actual cell format. Steps to Reproduce: 1. Take a sheet cell containing the text "blue and yellow". 2. Select the words "blue" and "yellow" and give them the CharColors blue and yellow resp. 3. Take a cell range oRange containing that cell. 4. oRange.clearContents(com.sun.star.sheet.CellFlags.EDITATTR) Actual Results: All formats of text portions in a Calc sheet cell remain untouched. Expected Results: The formatting of text portions should be cleared and the whole text should be given the color of the actual cell format. Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Confirmed for: + LibO 5.3.7.2 (x64) @ Windows 7 Home Premium 64-bit + LibO 6.0.2.1 (x64) @ Windows 7 Home Premium 64-bit Greetings Hans-Werner
I can confirm it for LibO 6.0.0.2 32-Bit, Windows 10
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Created attachment 140289 [details] Macros to display bugs using Calc cell range method clearContents with some CellFlags This attachment shows a set of formatted cells, numbers, date/time, strings, as well as two cells (B4 and C4) with text portion formatting. You can try the effect on B4:C4 (in fact no effect) by calling the macro Sub ClearContentsByCellFlagsEDITATTR The file comes with two additional macros to serve as an example for bug 116129 as well: Sub ClearContentsByCellFlagsHARDATTROrSTYLES Sub ClearContentsByCellFlagsSTYLES
.
Just a guess: https://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/cellsuno.cxx?r=316b07d0#1819 https://opengrok.libreoffice.org/xref/core/sc/inc/global.hxx?r=a2601800#177 https://opengrok.libreoffice.org/xref/core/sc/inc/global.hxx?r=a2601800#169 InsertDeleteFlags::ALL does not contain flags for EDITATTR Shouldn't this be ( static_cast<InsertDeleteFlags>(nContentFlags) & InsertDeleteFlags::EDITATTR ) instead of ( nDelFlags & InsertDeleteFlags::EDITATTR ) ?
Dear Volker Lenhardt, 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 with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. 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) from https://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: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
As with LO 7.1.6.2 and 7.2.1.2 both on macOS Big Sur (11.6) and with LO 7.1.6.2 on openSUSE Leap Tumbleweed there is no different behaviour. The bug persists as specified before. With regards, Volker
In addition: With LO 3.3.0 on Linux openSUSE Tumbleweed (Leap 15.2) the macro works as desired, it clears the formatting of text portions and gives the whole text the actual cell format. Greetings, Volker
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e8de03a18ed8684ed94d93b09aa1662ba799e877 tdf#116127 - Add EDITATTR to ALL flags to check for valid function inputs It will be available in 7.6.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.