Download it now!
Bug 99497 - an 'arc' saved in .docx becomes a filled closed shape
Summary: an 'arc' saved in .docx becomes a filled closed shape
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.2.2 release
Hardware: x86 (IA32) All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: interoperability target:6.4.0
Keywords: filter:docx
Depends on:
Blocks: OOXML-Object-Fill OOXML-Shapes
  Show dependency treegraph
 
Reported: 2016-04-25 14:12 UTC by sdc.blanco
Modified: 2019-09-01 18:20 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
test file for reproducing (and illustrating) problem (11.63 KB, application/vnd.oasis.opendocument.text)
2016-04-25 14:12 UTC, sdc.blanco
Details
bug doc exported to .docx w/ Word 2013 (18.62 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-12-08 16:31 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2016-04-25 14:12:51 UTC
Created attachment 124627 [details]
test file for reproducing (and illustrating) problem

LO 5.1.2.2  Windows 7

To reproduce the problem:

1.  Draw an 'arc'
2.  Save in .docx format
3.  The arc will be converted to a filled shape, with the "arc" being lost.

Expected behavior:

1. Saved as an arc, without fill.

Attached document gives a test figure in .odt, and also shows what happens when saved as .docx
Comment 1 raal 2016-04-25 18:38:02 UTC
I can confirm with Version: 5.2.0.0.alpha0+
Build ID: 170a473597534cf59887b1d817538322e7039862
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-04-19_00:41:06
Comment 2 Luke 2016-07-03 21:07:39 UTC
The arc will be a filled circle in both Word and Writer, so most likely an export issue. Adding Andras who's fixed many of these DrawingML issues recently. 

.doc format works as expect.
Comment 3 Luke 2016-11-26 23:20:18 UTC
Mark,
Is this another case like Bug 96052 where it needs to be put on a whitelist?
Comment 4 Telesto 2016-11-28 17:22:00 UTC
Confirming with:
Version: 5.4.0.0.alpha0+ (x64)
Build ID: 7aa2b5a041df8e71a435cccbc79ee13799ec9138
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2016-11-24_11:40:27
Locale: nl-NL (nl_NL); Calc: CL
Comment 5 QA Administrators 2017-12-08 08:08:38 UTC Comment hidden (obsolete)
Comment 6 Luke 2017-12-08 16:31:44 UTC
Created attachment 138314 [details]
bug doc exported to .docx w/ Word 2013

Still repo on Version: 6.1.0.0.alpha0+ (x64)
Build ID: eff70347190a6642fd62a9e0b20e4366c39fbc7a

Word can correctly import and export arcs. See attachment
Comment 7 QA Administrators 2018-12-09 03:40:55 UTC Comment hidden (obsolete)
Comment 8 sdc.blanco 2018-12-10 02:23:35 UTC
Confirming that the initial bug report is still valid -- both for Word 2007-2019 and Office Open XML Text (.docx).

No problems saving to .odt, .doc, or .pdf

Version: 6.1.3.2 (x64)
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU threads: 4; OS: Windows 10.0; UI render: GL;
Comment 9 Regina Henschel 2019-07-18 15:06:04 UTC
The "arc" and the "circleCut" are not custom-shapes, but legacy shapes from the toolbar "ovals" or single commands. In ODF they are not draw:custom-shape elements but draw:circle or draw:ellipse elements. The OOXML format has nothing, which corresponds to this kind of shapes. Therefore export of them to OOXML will always only be a workaround.

We have several options:

(A) Export "arc" as prstGeom with preset type "arc". The import of such shape works.
That approach has some downsides.
* Saving such OOXML shape in ODF uses the command G, which is not yet in the standard and requires a private namespace. The ODF 1.2 conform path does not result in an "arc" geometry.
* The current formulas in ODF use 'logwidth' and 'logheight', which MS does not interpret.
* The legacy "arc" is stored as draw:circle or draw:ellipse in ODF, not as draw:custom-shape. But OOXML preset shapes are always imported as custom-shapes.
* The export of OOXML reset shape type "arc" to doc does not work in current LibreOffice.
* Another difference is, that the legacy "arc" does not allow filling, but the OOXML preset shape "arc" allows filling, resulting in a sector.

(B) Export "arc" as custGeom in OOXML format including adjustment handles. The geometry needs to be defined. The geometry can be defined so, that it is never filled. Problem are roundtrips, because there exists no generic export from ODF formula syntax to OOXML formulas, because ODF formulas a more complex. It would be needed to find a way, to write application information so, that they are not removed by MS Office, to be able to detect, that this shape comes from an "arc".

(C) Export "arc" as custGeom in OOXML format without adjustment handles, with command "arcTo". MS Office uses this, if it opens an ODF file with draw:circle or draw:ellipse shape. That results in command G, if the file is resaved to ODF by LO. Same roundtrip problems as in (B).

(D) Export "arc" as custGeom in OOXML format without adjustment handles with Bézier-curves. Those exist in OOXML and ODF. Same roundtrip problems as in (B).

Export in VML format is no option. VML is outdated. Current MS Office supports it only partly and only in compatibility mode. And roundtrip will not work, because export of VML inside OOXML is buggy in LibreOffice.

I think, that it was no good idea, to have legacy shapes inside the custom-shape floaters at all. They behave too different.

We might consider to add a shape, that is equal to that shape we use on import of preset shape type "arc" from OOXML. Only that I would use an ODF 1.2 conform enhanced-path in addition to the path with command G. The command G will be in ODF 1.4 (I estimate in five years), not in ODF 1.3. An additional problem is the export to doc, which currently does not work for an imported OOXML preset shape of type "arc". For our own shape, we might use a similar export to doc format as for the legacy shapes. All together a large task.
Comment 10 Regina Henschel 2019-08-18 23:33:30 UTC
I'm testing a solution, where the arc is exported as prstGeom 'arc'. That will be imported as 'ooxml-arc' on round-trip, same as an arc, that is original drawn in Word.
Comment 11 Commit Notification 2019-08-23 21:40:13 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/72b50be0197159c5afc5da4daf01ba303519b14a%5E%21

tdf#99497 CircleKind ARC, CUT, SECTION to OOXML arc, chord, pie

It will be available in 6.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 12 Regina Henschel 2019-09-01 18:20:17 UTC
I see the fix in Version: 6.4.0.0.alpha0+ (x64)
Build ID: 01837a85004a6f891a09c0a63ed7eff75d634827
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-01_00:07:05
Locale: en-US (en_US); UI-Language: en-US
Calc: CL