Bug 45534 - ODF export: invalid "draw:fit-to-size" values in ODF 1.1/1.2 mode
Summary: ODF export: invalid "draw:fit-to-size" values in ODF 1.1/1.2 mode
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.4.6 target:3.5.1 target:3.6....
Keywords: regression
: 49618 49916 (view as bug list)
Depends on:
Blocks: ODF-export-invalid
  Show dependency treegraph
 
Reported: 2012-02-02 03:42 UTC by Michael Stahl (allotropia)
Modified: 2017-10-13 00:42 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
bugdoc with a bunch of text boxes (13.14 KB, application/vnd.oasis.opendocument.presentation)
2012-02-02 03:42 UTC, Michael Stahl (allotropia)
Details
ODP file which contains "shrink-to-fit" value in attribute "fit-to-size" (3.31 MB, application/vnd.oasis.opendocument.presentation)
2017-05-28 11:02 UTC, Franklin Weng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2012-02-02 03:42:08 UTC
Created attachment 56509 [details]
bugdoc with a bunch of text boxes

shapes.odp/styles.xml[132,129]: Error: attribute "draw:fit-to-size" has a bad 
value. Possible values are: false,true

but here we have:
  draw:fit-to-size="shrink-to-fit"

in ODF 1.1 and 1.2 this attribute is of type boolean.

This is a regression introduced with e479f47f7d48dbd0d701bf347b6a2d5121ba3d34.
Comment 1 Thorsten Behrens (allotropia) 2012-02-02 05:41:31 UTC
Heh - seems this is missing from http://wiki.documentfoundation.org/Development/ODF_Implementer_Notes - then again, extensions to style properties are permitted under ODF1.0/1.1 conformance rules, which validator in particular is complaining?
Comment 2 Michael Stahl (allotropia) 2012-02-02 09:51:53 UTC
perhaps adding new attributes may be allowed (probably not in ODF namespaces),
but i'll believe that it is allowed to write values that are not specified
into attributes that are specified when you cite the sentence in the
spec that allows it :)

fixed on master:
 6c15b856242127ddca766da700002489ba287e21
Comment 3 Michael Stahl (allotropia) 2012-02-02 10:05:07 UTC
have added something to the wiki page, please review...
Comment 4 Thorsten Behrens (allotropia) 2012-02-02 12:36:25 UTC
(In reply to comment #2)
> perhaps adding new attributes may be allowed (probably not in ODF namespaces),
> but i'll believe that it is allowed to write values that are not specified
> into attributes that are specified when you cite the sentence in the
> spec that allows it :)
> 
Here we go: http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-v1.1-html/OpenDocument-v1.1.html#1.5.Document%20Processing%20and%20Conformance|outline

 "The various <style:*-properties> elements (see section 15) may have arbitrary attributes attached and may have arbitrary element content. All attributes attached to these elements and elements contained within these elements should be preserved (see section 15.1.3);"

Also, there is this:

 "There are no rules regarding the elements and attributes that actually have to be supported by conforming applications, except that applications should not use foreign elements and attributes for features defined in the OpenDocument schema."

Thanks for the fix though! :)
Comment 5 Thorsten Behrens (allotropia) 2012-02-02 12:47:40 UTC
Sadly, 1.2 is eerily different (both stricter & more relaxed at the same time) - for unknown attribute values, though, there's this processing recommendation:

http://docs.oasis-open.org/office/v1.2/part1/cd04/OpenDocument-v1.2-part1-cd04.html#a_21_1_Foreign_Elements_and_Attributes

  "OpenDocument consumers should be able to parse and interpret documents that contain attribute values not defined by the OpenDocument schema. If an attribute which has such a non defined value has a default value, then a conforming consumer should assume that the attribute has this value. Otherwise, a conforming consumer should ignore the attribute."

So while for ODF1.2, the behaviour would fall under conformant extended, ODF1.1 has no such notion, writing that would simply be conformant.
Comment 7 Michael Stahl (allotropia) 2012-09-13 14:12:01 UTC
*** Bug 49618 has been marked as a duplicate of this bug. ***
Comment 8 Michael Stahl (allotropia) 2012-09-13 14:20:04 UTC
*** Bug 49916 has been marked as a duplicate of this bug. ***
Comment 9 sasha.libreoffice 2012-09-13 15:28:53 UTC
Thanks for fixing this bug
Comment 10 Franklin Weng 2017-05-28 11:00:57 UTC
In an ODP file generated by LibreOffice 5.1 still failed to pass the https://odf-validator.rhcloud.com/ validator with the same problem:

csunplugged.odp/styles.xml[2,43906]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true
csunplugged.odp/styles.xml[2,62084]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true
csunplugged.odp/styles.xml[2,81512]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true
csunplugged.odp/styles.xml[2,100421]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true
csunplugged.odp/styles.xml[2,166765]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true
csunplugged.odp/styles.xml[2,185713]: Error: attribute "draw:fit-to-size" has a bad value. Possible values are: false,true

This may happen when copying slides from other (odp) files which would cause a dialog asking if it should fit the size of the current file.

The file will be attached soon.
Comment 11 Franklin Weng 2017-05-28 11:02:13 UTC
Created attachment 133667 [details]
ODP file which contains "shrink-to-fit" value in attribute "fit-to-size"
Comment 12 Xisco Faulí 2017-07-13 12:19:22 UTC
Setting Assignee back to default. Please assign it back to yourself if you're
still working on this issue
Comment 13 Michael Stahl (allotropia) 2017-10-10 10:01:02 UTC
this bug was about the invalid value being exported
to ODF 1.1 and ODF 1.2 documents - which was fixed
by exporting "true" instead of "shrink-to-fit".

the case that is still buggy is the export
to ODF 1.2 extended, for which a different attribute should
be used for the "shrink-to-fit" value - but for this
there already is bug 97630.