Bug 124820 - FILEOPEN XLSX Cell strike through cannot be applied on cell with differently colored text, after xlsx import
Summary: FILEOPEN XLSX Cell strike through cannot be applied on cell with differently ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords: bibisected, bisected, filter:xlsx, regression
Depends on:
Blocks: XLSX
  Show dependency treegraph
 
Reported: 2019-04-18 11:56 UTC by NISZ LibreOffice Team
Modified: 2022-05-19 14:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file for edition (15.50 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-04-18 11:57 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Excel and Calc side by side (140.79 KB, image/png)
2019-04-18 11:57 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-04-18 11:56:23 UTC
Description:
Cell strikethrough formatting on XLSX documents created with Microsoft Excel 2010 is not applied on cell with differently colored text when the document is edited in LibreOffice Calc 6.3.0.0.alpha0+.
The problem does not occur if a document is created in Calc and saved in ods format.

Steps to Reproduce:
    1. Open the attached XLSX file in LibreOffice Calc.
    2. Try to apply strikethrough on the B1 or B2 cell. These cells contain text with different color set on them.
    3. View the attached screenshot.
    4. Notice, that the strikethrough doesn’t apply, although the Cell Format window, the toolbar and the sidebar all report that strikethrough is set. 
    5. Bold formatting can be applied the same way, but italic or underline can’t.

Actual Results:
Cell strikethrough is not applied on cell with differently colored text when the document is edited in LibreOffice Calc 6.3.0.0.alpha0+.

Expected Results:
Cell strikethrough should be applied on cell with differently colored text when the document is edited in LibreOffice Calc 6.3.0.0.alpha0+.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.3.0.0.alpha0+
Build ID: 05a8749ee6f251d4b92eecb97763fa1fe94c68c8
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: threaded 

Already happens in:

Verzió: 5.0.0.5
Build az.: 1b1a90865e348b492231e1c451437d7a15bb262b
Területi beállítások: hu-HU (hu_HU) 


Was good (only strikethrough, not italic or underline) in:
Verzió: 4.4.0.3
Build az.: de093506bcdc5fafd9023ee680b8c60e3e0645d7

Verzió: 4.1.0.4
Build az.: 89ea49ddacd9aa532507cbf852f2bb22b1ace28 

Strikethrough was applied to the first part of the cell contents:
Verzió: 4.0.0.3 (Build az.: 7545bee9c2a0782548772a21bc84a9dcc583b89) 
and earlier.
Comment 1 NISZ LibreOffice Team 2019-04-18 11:57:03 UTC
Created attachment 150849 [details]
Test file for edition
Comment 2 NISZ LibreOffice Team 2019-04-18 11:57:28 UTC
Created attachment 150850 [details]
Screenshot of the problem in Excel and Calc side by side
Comment 3 raal 2019-04-18 15:42:07 UTC
Confirm with 6.3,windows
Comment 4 raal 2019-04-18 15:55:43 UTC
This seems to have begun at the below commit.
Adding Cc: to Markus Mohrhard; Could you possibly take a look at this one? Thanks
 bd535779b3700af3c632c6a740af22e3b5bdd23d is the first bad commit
commit bd535779b3700af3c632c6a740af22e3b5bdd23d
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu May 28 19:50:50 2015 -0500

    source 8dd2888ac75c2c2ee9ca0ed0c6abda4dab7420cc

author	Markus Mohrhard <markus.mohrhard@collabora.co.uk>	2015-03-27 19:11:35 +0100
committer	Markus Mohrhard <markus.mohrhard@collabora.co.uk>	2015-03-27 19:58:28 +0100
commit 8dd2888ac75c2c2ee9ca0ed0c6abda4dab7420cc (patch)
tree b8e6f4f5d5cbc41fecccf4aa1787c39642362128
parent d63c5326b1d03a7a40cd14833853b7bdf324cdd2 (diff)
we need to use the edit engine attibute id for rich text, tdf#89170
Comment 5 Justin L 2022-02-08 12:39:55 UTC
The commit is simple enough. It suggests that somewhere a function calls with with bEditEngineText == true, when it should be false.

However, it isn't that simple. When I changed sc/source/filter/oox/richstring.cxx to do just that, the file loaded without any colour in the text.

I would guess that this has exposed something fairly insidious and nasty.
Comment 6 Justin L 2022-05-06 12:41:37 UTC
Perhaps the person who fixes bug 107765 can also fix this one. There might be some kind of connection based on character run properties handled by editeng/sc differences.
Comment 7 Justin L 2022-05-12 16:10:47 UTC
Also working (in addition to bold) are font colour and font size.

For italic, underline/overline, and strike-through the char-run values are not being removed and therefore take priority over the cell's value.

I actually find it interesting that these work - especially font colour. In this bug, we are attempting to set attributes at the entire cell level, while the "char runs" have specified other values - which should have priority. In other words, it must be that the char runs are being removed for font size, colour, and bold when we assign a value at the cell level.

Oh, here it is in editutil.cxx's ScEditUtil::RemoveCharAttribs which comes from
commit 4ef978de83610b0e1912bce1d59432b9c382b9fc
Author: Kohei Yoshida on Wed Sep 15 12:28:47 2010 +0200
    sc-overwrite-char-font-attrs.diff: overwrite character level font attributes
    
    n#374580, i#53545, i#96853
    Overwrite character level font attributes when changing them at cell level
Comment 8 Justin L 2022-05-13 04:51:13 UTC
Comment 6 was fixing a mistake from
commit f54ce3e7f6d6aab7e34c54ad8eff06650e076fef
    Author:     Noel Power on Tue Jan 22 12:05:50 2013 +0000
        lose uno api for font related xlsx import

Indeed, when testing the other attributes like underline, italics, outline, shadow - these all "stopped working" as well at that change. At that time, only the first char-run was modified in the document I was testing on.

Proposed fix at http://gerrit.libreoffice.org/c/core/+/134254
Comment 9 Commit Notification 2022-05-15 13:45:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f413eb0b43fa36edf69909f3821dfe6a54e3edf7

tdf#124820 sc: overwrite more character level font attributes

It will be available in 7.4.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.
Comment 10 Commit Notification 2022-05-16 19:28:26 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/ace3a90f5cc383e30fd85f80a8ea4755159876cb

tdf#124820 sc: overwrite more character level font attributes

It will be available in 7.3.4.

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.
Comment 11 Commit Notification 2022-05-19 14:10:35 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5447cbd11a4aba6a0de3f379107655d3f94b838e

tdf#124820: sc_uicalc: Add unittest

It will be available in 7.4.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.