Bug 101712 - GsoC table template: suspicious style:parent-style-name value
Summary: GsoC table template: suspicious style:parent-style-name value
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Jakub Trzebiatowski
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks: Table-Styles Writer-Tables-Style
  Show dependency treegraph
 
Reported: 2016-08-24 21:48 UTC by Regina Henschel
Modified: 2017-05-01 23:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document with table template (13.26 KB, application/vnd.oasis.opendocument.text)
2016-08-24 21:48 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2016-08-24 21:48:55 UTC
Created attachment 127012 [details]
Test document with table template

Look into the styles.xml file of the package. It has a table:table-template element with the attribute table:name. This name is needed, for reference by the attribute table:template-name of the table:table element.

Some lines up you find the cell styles defined for the table-template, e.g. in the attached document a style:style element with attribute style:name="myTableTemplate.16". In the same element you see the attribute style:parent-style-name="myTableTemplate".

I think, that this value is not allowed, because "myTableTemplate" is not value of an attribute style:name but of the attribute table:name. The style:style element with attribute style:name="myTableTemplate.16" belongs to the style family "table-cell". Therefore its parent should also be one of the family "table-cell".

Even if you will say, that it is allowed, it is not meaningful. Because the table-template is a set of references to table-cell styles, it would be ambiguous which to use and in worst case, when using "myTableTemplate.16" results in an endless loop.

A correct solution can be to define a style:default-style for the family table-cell, which can be used for those properties, which are common to the cells or reflect the implementation defaults. Such style:default-style element is missing currently anyway. Of cause, especially, when several table templates exists in the document, defining a separate parent style for each table template makes sense too.
Comment 1 Miklos Vajna 2016-09-08 05:47:11 UTC
Jakub plans to simply not write that attribute for now.
Comment 2 Commit Notification 2016-09-08 05:50:53 UTC
Jakub Trzebiatowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101712 Writer Table Style; odf export; remove parent export for cell style

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