Download it now!
Bug 56467 - Formula exported to svg result in formula loss
Summary: Formula exported to svg result in formula loss
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: Other All
: medium normal
Assignee: Christina Rossmanith
URL:
Whiteboard: target:5.0.0 target:4.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-27 17:22 UTC by Heinrichmeyer
Modified: 2015-04-17 18:37 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
correctly exported formula with pdf option (workaround) (20.93 KB, application/pdf)
2012-10-27 17:22 UTC, Heinrichmeyer
Details
SVG file with missing formula elements (12.81 KB, image/svg+xml)
2012-10-27 17:23 UTC, Heinrichmeyer
Details
sample file (13.46 KB, application/vnd.oasis.opendocument.graphics)
2013-06-27 20:47 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrichmeyer 2012-10-27 17:22:04 UTC
Created attachment 69158 [details]
correctly exported formula with pdf option (workaround)

i try to insert a formula in a webpage for an epub document. My Idea:

Write formula with writer, copy it to draw, export to svg. It works, but some elements are missing in svg file.

[Workaround]: export to pdf, read with inkscape, store from inkscape, insert inkscape in html file.

Attached is the pdf-file from workaround method, i also will atach the svg file. The workaround has an additional rectangle as my first idea was to avoid the error by providing an additional surrounding box, but it made no difference.
Comment 1 Heinrichmeyer 2012-10-27 17:23:50 UTC
Created attachment 69159 [details]
SVG file with missing formula elements
Comment 2 bfoman (inactive) 2013-03-04 13:48:55 UTC
(In reply to comment #0)
> Write formula with writer, copy it to draw, export to svg. It works, but
> some elements are missing in svg file.

Could you attach original LibreOffice document to allow others to check on different system/build?

BTW: you can create formulas directly in Draw.
Comment 3 Jorendc 2013-06-27 20:47:06 UTC
I can confirm this using Mac OSX 10.8.4 with LibreOffice Version: 4.1.0.1
Build ID: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155

It is even worse, no formula is exported in SVG. No need to copy from writer or so.

What I did:
* Open Draw
* Insert > Object > Formula
* type a formula like: {bla over bla} = {rho over rho} = sqrt(test)
* File > Export > as SVG

Opening file using Safari, Firefox and Chrome result in an empty page.
I'll attach a sample document.

Kind regards,
Joren
Comment 4 Jorendc 2013-06-27 20:47:43 UTC
Created attachment 81585 [details]
sample file
Comment 5 QA Administrators 2015-03-16 23:55:47 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

    Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1 or later)
    https://www.libreoffice.org/download/

    If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
  
  If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

    Update the version field
    Reply via email (please reply directly on the bug tracker)
    Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to "inherited from OOo";
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-03-16
Comment 6 Jean-Baptiste Faure 2015-03-24 05:10:40 UTC
I do not know if it has worked one day. For me it is more a missing feature than a defect. I suggest to set the importance as enhancement.

Best regards. JBF
Comment 7 Commit Notification 2015-03-27 21:16:53 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#56467: improve export of formulas to SVG

It will be available in 4.5.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 8 Matthew Francis 2015-03-30 10:10:17 UTC
@Chr. Rossmanith: Any chance you could backport commit 0a4e9138281bd0a4be59031357c1bf52134d007a to 4.4?

The SVG part of it tangentially fixed bug 88117 as well
Comment 9 V Stuart Foote 2015-03-30 14:46:58 UTC
Reopening...

Unfortunately, just checked recent daily on Windows 7 sp1, 64-bit, en-US
Version: 4.5.0.0.alpha0+
Build ID: 3c6fd5a59b08cec8705a31d17a60204acf6b7173
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-03-29_02:04:01
Locale: en_US

and with the patch included

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0a4e9138281bd0a4be59031357c1bf52134d007a
 
export to SVG (with Selection checked and a selection made) is now completely empty. Suspect something is very off with the bounding viewBox of the selection at this point. Export of the full canvas to SVG looks to be losing details of the OLE formulas. 

But export of selection (or full canvas) to other formats: WMF, EMF, PNG seems to render correctly.
Comment 10 Christina Rossmanith 2015-03-31 06:41:28 UTC
My test object is a formula "a over b". For me it depends on the software you use for viewing the exported svg. 
- Preview in ubuntu file browser is fine for both
- gimp is fine for both
- inkscape only shows the formula for whole page export not for a selection
- emacs is fine for both
- gnome image viewer is fine for both
- inserting as image into LibO Draw (build including patch) is fine
- opening in LibO is fine apart from text not being rendered because of text being wrapped into a <tspan> element
Comment 11 V Stuart Foote 2015-03-31 13:55:49 UTC
(In reply to Christina Rossmanith from comment #10)
> My test object is a formula "a over b". For me it depends on the software
> you use for viewing the exported svg. 
> - Preview in ubuntu file browser is fine for both
> - gimp is fine for both
> - inkscape only shows the formula for whole page export not for a selection
> - emacs is fine for both
> - gnome image viewer is fine for both
> - inserting as image into LibO Draw (build including patch) is fine
> - opening in LibO is fine apart from text not being rendered because of text
> being wrapped into a <tspan> element

Sorry, you are correct. The bounding and extent for export selection to SVG are correct--the rendering is dependent on the viewer.

Working normally on Windows, I will normally just test SVG with FireFox and Inkscape, the two that happen to not show any content. Just, checked with a couple of additional viewers, ImageMagick's IMDisplay and IrfanView and the SVG is bounded and sized appropriately.

However, since the patch--there is an extraneous tspan class "TextPosition" being opened in the Text class, it lacks a closing tspan.  And, if I edit the XML to remove the stanza, the SVG then renders in FireFox and Inkscape.

Also, at least on Windows, there does seem to be a problem with parsing the OLE of embedded formulas--they do not render correctly on export to SVG, the formulas and in the XML show with "!!br0ken!!".
Comment 12 Robinson Tryon (qubit) 2015-03-31 15:24:42 UTC
Does not meet the criteria for Status 'REOPENED'
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/REOPENED#Criteria
Status -> NEW
Comment 13 V Stuart Foote 2015-03-31 16:14:38 UTC
(In reply to Robinson Tryon (qubit) from comment #12)
> Does not meet the criteria for Status 'REOPENED'

LOL, so Christina will you be assigning this issue to yourself? Otherwise NEW, rather than REOPENED, is correct from the rubric.
Comment 14 Commit Notification 2015-04-05 10:27:37 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f6a67357ab8f827ba934eb40f79fcc58391f909a&h=libreoffice-4-4

tdf#56467: improve export of formulas to SVG

It will be available in 4.4.3.

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 15 Commit Notification 2015-04-11 11:21:59 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#56467: copy text of meta actions with valid text length

It will be available in 5.0.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 16 Commit Notification 2015-04-11 11:23:10 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#56467 / tdf#88117: SVG export further improved

It will be available in 5.0.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 17 Commit Notification 2015-04-14 20:32:08 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4542e5bd0a9b3838794c72becd1f7caa41846c07&h=libreoffice-4-4

tdf#56467 / tdf#88117: SVG export further improved

It will be available in 4.4.3.

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 18 Commit Notification 2015-04-16 21:10:58 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#56467 / tdf#88117: SVG export further improved

It will be available in 5.0.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.