Bug 90309 - FILEOPEN: Add chart support to RTF importer
Summary: FILEOPEN: Add chart support to RTF importer
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:rtf, implementationError
Depends on:
Blocks: RTF
  Show dependency treegraph
 
Reported: 2015-03-29 00:32 UTC by Luke
Modified: 2021-04-13 17:40 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example RTF chart (1.50 MB, application/rtf)
2015-03-29 00:32 UTC, Luke
Details
DOCX importer correctly imports the chart (editable) (47.45 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-03-29 00:32 UTC, Luke
Details
Comparison MSO 2010 and LibreOffice 7.2 master (170.99 KB, image/png)
2021-04-13 10:29 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2015-03-29 00:32:10 UTC
Created attachment 114429 [details]
Example RTF chart

When the chart colors come from a style and not set manually, the RTF importer sets them incorrectly.

Steps to reproduce.
1. Open ChartColorBug.docx
2. Open ChartColorBug.rtf
3. Compare

The correct colors should be yellow and turquoise as the .docx importer correctly sets. The .rtf file was made by saving the .docx as .rtf in MSO 2013.

Note the incorrect Word Art in the .docx was already reported as Bug 82575.
Comment 1 Luke 2015-03-29 00:32:40 UTC
Created attachment 114430 [details]
DOCX importer correctly imports the chart (editable)
Comment 2 A (Andy) 2015-03-29 10:17:15 UTC Comment hidden (obsolete)
Comment 3 Matthew Francis 2015-04-06 04:19:20 UTC
The earliest I can see the chart importing at all is
source-hash-54aafdb04cf36eb2b2ddbbc2030d298f514a00e9
in the bibisect 43all repository.

Most likely this is not a regression but an implementation error - it hasn't worked since the feature was first introduced
Comment 4 Luke 2015-12-09 22:21:50 UTC
I dug a little deeper and it appears that Word saves both a thumbnail image of charts and the chart itself. Since our rtf filter doesn't decode charts, we use the incorrect thumbnail image. Adding Miklos who works on rtf.
Comment 5 Robinson Tryon (qubit) 2015-12-10 10:22:24 UTC Comment hidden (obsolete)
Comment 6 Robinson Tryon (qubit) 2015-12-13 10:30:14 UTC Comment hidden (obsolete)
Comment 7 Miklos Vajna 2016-06-10 14:30:41 UTC
Yes, the DOCX vs RTF import result is about DOCX importing the chart natively, while RTF just shows the replacement image. What's interesting is that the RTF result is the one that matches the Word colors. So I would say either close this bug as invalid (as the RTF import is correct) or re-title this bug and mark it as an OOXML chart problem that the DOCX import result doesn't match the Word one.

Luke: can you please do one of the above?

Thanks.
Comment 8 Luke 2016-06-16 05:30:10 UTC
Miklos Vajna,
The issue is with the RTF bugdoc. On first load in Word in "Protected View", the colors are Yellow/Red. After you click "Enable Editing", the colors switch to Yellow/Turquoise (Word export bug?).

Since we display the same Yellow/Red colors as Word's "Protected View", I'm going to change this from a Bug to an Enhancement. In Order to display this the same as Word's Normal View we're going to have add Chart support to our RTF importer instead of displaying the incorrect thumbnail. 

I don't think there's anything wrong the OOXML importer here. Writer matches Word.
Comment 9 Luke 2018-04-28 17:43:43 UTC
Image rather than chart is still imported in Version: 6.1.0.0.alpha1+ (x64)
Build ID: a3783c0af4bd21eb9c001aadc60c660c06a47779
Comment 10 Xisco Faulí 2021-04-13 10:29:17 UTC Comment hidden (off-topic)
Comment 11 Luke 2021-04-13 17:39:39 UTC
Still reproducible in 7.2 master. The rtf importer imports the image/thumbnail rather than the chart. You cannot edit the .rtf chart like the .docx one.