Bug 105641 - svg export of single objects should produce SVG without javascript
Summary: svg export of single objects should produce SVG without javascript
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: x86 (IA32) Windows (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0
Keywords: filter:svg
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2017-01-31 13:54 UTC by Regina Henschel
Modified: 2023-01-04 10:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
example objects on slide 2 to export to SVG (16.88 KB, application/vnd.oasis.opendocument.presentation)
2021-06-08 13:57 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-01-31 13:54:45 UTC
Take a presentation and select some objects on the slide. Export them to SVG. Make sure, that "Selection" is checked.

The exported file contains a large script element, multiple times larger than the pure svg. This javascript is needed for playing animations. But it is useless in case of an image, that contains only isolated objects from a slide.

Such export is mostly used, to insert the SVG image into text documents or other presentations or in a Gallery theme.

Current workaround is to copy&paste the selected objects into a dummy Draw document and export them from there.

Expected behavior: If "Selection" is checked and the selection contains only objects from one slide, then do not add the Javascript but export it same way as from a Draw page.
Comment 1 Commit Notification 2017-03-27 20:58:11 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f900888ba51803d924bb5129978aa891879ecc59

tdf#105641: no javascript in svg export for selection of objects

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Xisco Faulí 2017-07-14 13:19:02 UTC Comment hidden (obsolete)
Comment 3 Xisco Faulí 2017-11-05 21:30:33 UTC
A polite ping to Chr. Rossmanith: is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Thanks
Comment 4 Regina Henschel 2017-11-05 21:43:16 UTC
No, it is not fixed. There is no JavaScript, but the pages still exist and because they are hidden for to work with the JavaScript, no object is shown, if the file e.g. is opened in browser.

I have tested it in Version: 6.0.0.0.alpha1+
Build ID: d30522e46ca884e9bc74af21711d9537e8118859
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-10-29_23:13:14
Locale: de-DE (de_DE); Calc: group
Comment 5 Stéphane Guillou (stragu) 2021-06-08 13:57:30 UTC
Created attachment 172706 [details]
example objects on slide 2 to export to SVG

(In reply to Regina Henschel from comment #4)
> No, it is not fixed. There is no JavaScript, but the pages still exist and
> because they are hidden for to work with the JavaScript, no object is shown,
> if the file e.g. is opened in browser.

Regina, I can't reproduce the issue "no object is shown".

I am attaching a file for testing purposes. Steps:

1. Open presentation in Impress
2. Select several objects on slide 2
3. File > Export..., tick "Selection", export as SVG
4. Open in a web browser

Opening the SVG in Firefox 89.0 or Chromium 91.0.4472.77 showed me all the objects as expected.

I do get this in the source code:

<g ooo:name="page2" class="Page">

But it doesn't seem to affect visibility.

Version:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 399a6472f666ae6c3e20b6f8367f9fd089c15605
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-05_17:38:40
Calc: threaded