Bug Hunting Session
Bug 76334 - LO4.3 writes svg:viewBox="0 0 0 0" when convert a shape in pptx to odp.
Summary: LO4.3 writes svg:viewBox="0 0 0 0" when convert a shape in pptx to odp.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL: https://bz.apache.org/ooo/show_bug.cg...
Whiteboard:
Keywords: bibisected, filter:pptx, filter:svg
Depends on:
Blocks: OOXML-Shapes PPTX
  Show dependency treegraph
 
Reported: 2014-03-18 19:37 UTC by Regina Henschel
Modified: 2019-10-21 14:41 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
rectangle with text from PP2013 (21.93 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2014-03-18 19:37 UTC, Regina Henschel
Details
Shape with custGeom (16.83 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2018-12-29 13:33 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2014-03-18 19:37:38 UTC
Created attachment 96018 [details]
rectangle with text from PP2013

Open the attached document and save it in .odp format. Inspect the file and notice the attribute svg:viewBox="0 0 0 0" in the enhanced geometry. Width and height in zero are wrong. This error gives wrong rendering by other consumers. https://issues.apache.org/ooo/show_bug.cgi?id=124452
Comment 1 Julien Nabet 2014-03-18 21:14:16 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
Comment 2 Joel Madero 2015-05-02 15:42:14 UTC Comment hidden (obsolete)
Comment 3 Regina Henschel 2015-05-02 18:40:15 UTC
The bug still exists in Version: 5.0.0.0.alpha1
Build ID: 77a35997fa7cff387b5b135ff0c42155f80e9884
Locale: de_DE
Comment 4 Julien Nabet 2015-05-11 20:28:35 UTC
Fixed on AOoo (put the link quoted by Regina on URL)
Comment 5 Jorendc 2015-05-16 14:16:22 UTC
I wrote a patch for this one. Currently under review: https://gerrit.libreoffice.org/#/c/15753/2
Comment 6 QA Administrators 2016-09-20 09:42:30 UTC Comment hidden (obsolete)
Comment 7 Regina Henschel 2016-09-20 20:24:11 UTC
It is fixed now.

The mentioned patch was abandoned, so it is not the reason for the fixed behavior.

I have tested it in Version: 5.3.0.0.alpha0+
Build ID: ba269f7294e2416659011cbb498a2c6b5f9d5199
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-09-12_02:36:16
Locale: de-DE (de_DE); Calc: group
Comment 8 Regina Henschel 2017-01-14 22:24:06 UTC
I was wrong. The problem still exists in Version: 5.4.0.0.alpha0+
Build ID: 5adab0927483d039037b0f93894627e41a2c72f2
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-01-09_23:34:00
Locale: de-DE (de_DE); Calc: group
Comment 9 Regina Henschel 2018-11-06 15:11:24 UTC
The error still exists in Version: 6.2.0.0.alpha1+ (x64)
Build ID: f825e6d4082c0d0beb1c95b881f6a2ee9bfc9161
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-11-05_00:20:26
Locale: de-DE (en_US); Calc: CL
Comment 10 Roman Kuznetsov 2018-12-11 19:04:15 UTC
Regina, how look this bug for user? What is wrong?
I tried to make export to SVG from ODP, just reopen ODP -> rectangle with orange text looks fine in both case.

Version: 6.3.0.0.alpha0+
Build ID: ba17d2e3c1acd571a4faa7e31ef97a2ec71591bd
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-12-10_01:14:49
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 11 Regina Henschel 2018-12-11 20:55:50 UTC
(In reply to Roman Kuznetsov from comment #10)
> Regina, how look this bug for user? What is wrong?

Apache OpenOffice will not render the shape. I have not tested Google Docs or other applications.

SVG is very clear about value zero, "A negative value for <width> or <height> is an error (see Error processing). A value of zero disables rendering of the element." ["https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute] So Apache OpenOffice is right here.

(In reply to Roman Kuznetsov from comment #10)
> I tried to make export to SVG from ODP, just reopen ODP -> rectangle with
> orange text looks fine in both case.

svg-export does not use the svg:viewBox information.


If you remove the invalid attribute sub-view-size (bug 105603), then it is rendered false in LibreOffice too. So LibreOffice produces documents which will become problematic when other bugs are fixed.
Comment 12 Regina Henschel 2018-12-28 17:36:44 UTC
This wrong attribute is written because the fix for bug 72998 forces viewBox to "0 0 0 0".
Comment 13 Aron Budea 2018-12-28 20:11:10 UTC
Apparently this started earlier, here are the results from different LO versions, both for custom shape "Rechteck 1":

In 3.5.0.3:
<draw:enhanced-geometry draw:mirror-horizontal="false" draw:mirror-vertical="false" draw:text-areas="0 0 ?f3 ?f2" svg:viewBox="0 0 0 0" draw:type="ooxml-rect" draw:enhanced-path="M 0 0 L ?f3 0 ?f3 ?f2 0 ?f2 Z N">

In 3.4.0.1:
<draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>

After one of the commits in the following range (bibisected using repo bibisect-43all), svg:viewBox isn't exported anymore:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e5f71ca7c27259360a401d94ed6a53038608b941..73ec894e0d5aea6f8462c2e42d064c317d4a82ec

Then after a commit in this range, zeros are exported:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=1ca547d20882e9b3d3ba9a6c7ee0340a5b7009b0..97453f1eabb473d0691e41153eff2ac92e88a302
Comment 14 Aron Budea 2018-12-28 20:13:28 UTC
Both ranges contain a couple of commits related to custom shapes by Radek Doulik, likely one of them is the cause in each range.
Comment 15 Julien Nabet 2018-12-29 12:30:34 UTC
(In reply to Regina Henschel from comment #12)
> This wrong attribute is written because the fix for bug 72998 forces viewBox
> to "0 0 0 0".

On pc Debian x86-64 with master sources updated today, I added a trace log at this very location and nothing on console so it's not due to https://cgit.freedesktop.org/libreoffice/core/commit/?id=beba4603ee8e603fff2599bee7f157d90872cb99
Comment 16 Regina Henschel 2018-12-29 13:33:48 UTC
Created attachment 147883 [details]
Shape with custGeom

Try it with a shape with custGeom (draw:type="ooxml-non-primitive") and comment out the lines 240, 241 in  CustomShapeProperties::pushToPropSet() in customshapeproperties.cxx, then you get a proper svg:viewBox. With active lines you get svg:viewBox="0 0 0 0". It might be not the only reason, but it is at least related.

To get a custGeom in PowerPoint without editing the file itself, draw two of the preset shapes and combine them, for example. To combine them, select both shapes, then in "Drawing Tools" in section "Insert Shapes" the drop-down "Merge Shapes", item "Combine".