Bug 134987 - FILESAVE ODT Chart imported from DOCX cannot be edited if saved as ODT
Summary: FILESAVE ODT Chart imported from DOCX cannot be edited if saved as ODT
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Balázs Varga
URL:
Whiteboard: target:7.1.0
Keywords: implementationError
: 95323 126476 135903 (view as bug list)
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2020-07-20 14:22 UTC by NISZ LibreOffice Team
Modified: 2021-03-31 14:24 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
attachment #163298 saved to odt with current master (15.59 KB, application/vnd.oasis.opendocument.text)
2020-07-20 14:22 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Writer (37.11 KB, image/png)
2020-07-20 14:23 UTC, NISZ LibreOffice Team
Details
formula followed by chart (38.41 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-03 09:59 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-07-20 14:22:57 UTC
Created attachment 163325 [details]
attachment #163298 [details] saved to odt with current master

Saving a DOCX file with a chart as ODT causes the chart to not being editable after reloading the ODT file.

Steps to reproduce:
    1. Open any DOCX with a chart in it, such as attachment #163298 [details]
    2. Save it as ODT and reopen it
    3. Right click on the chart

Actual results:
Contextual menu does not have Edit item, nor does double clicking open it for editing.

Expected results:
Chart should be editable.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 5d546de67b44dec23ecfa5a6378e2968912f8253
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also happens in
Verzió: 6.0.0.3
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: hu-HU (hu_HU)

Verzió: 4.2.0.4
Build az.: 05dceb5d363845f2cf968344d7adab8dcfb2ba71

Before this the chart was not even imported.
Comment 1 NISZ LibreOffice Team 2020-07-20 14:23:13 UTC
Created attachment 163326 [details]
Screenshot of the problem in Writer
Comment 2 Regina Henschel 2020-08-02 15:02:06 UTC
The reason is, that the xlink:href attribute in the draw:object element points to a not existing object. It is xlink:href="./Object 2", whereas the folder in the package is "Object 1", for example.
Comment 3 Regina Henschel 2020-08-03 09:56:53 UTC
After a document is opened, I see already StreamName="Object 2" in the Basic IDE.
The name is generated in EmbeddedObjectContainer::CreateUniqueObjectName() in /comphelper/source/container/embeddedobjectcontainer.cxx
If I set a breakpoint there, I see, that it is called more than once.

Perhaps there happen some confusion because the docx-file has not only "charts" but also "embeddings"? The latter contains the Microsoft_Excel_Worksheet.xlsx file, which holds the data for the chart.

I have not investigated, why the export does not use "StreamName", when writing the folder for the chart.
Comment 4 Regina Henschel 2020-08-03 09:59:33 UTC
Created attachment 163896 [details]
formula followed by chart

And worse, if the document has first a formula and then a chart, the chart is not written at all. Try it with attached document.
Comment 5 Commit Notification 2020-10-13 11:53:47 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

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

tdf#134987 convert DOCX to ODT: fix lost charts

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.
Comment 6 Balázs Varga 2020-10-13 12:04:28 UTC
*** Bug 95323 has been marked as a duplicate of this bug. ***
Comment 7 Timur 2020-10-14 09:43:06 UTC
attachment #163298 [details] is LO created and cannot be open in MSO (bug 134801) so not sure about this bug, what's the real issue, is it saving in LO. 
But looks good in today's master, I set Verified.  
If I can suggest, please see bug 134801 so that we can have the whole circe, save to DOCX-ODT-DOCX and verify in MSO.
Comment 8 NISZ LibreOffice Team 2020-10-16 18:23:55 UTC
*** Bug 126476 has been marked as a duplicate of this bug. ***
Comment 9 NISZ LibreOffice Team 2020-11-11 12:26:00 UTC
Verified in

Version: 7.1.0.0.alpha1+ (x64)
Build ID: a689cf1672e89cb78fbcfa14c505850927e71f58
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Thanks for fixing!
Comment 10 Buovjaga 2021-03-31 14:23:38 UTC
*** Bug 135903 has been marked as a duplicate of this bug. ***