Bug 44774 - Drawing styles lose parent-child relationship on FILESAVE FILEOPEN
Summary: Drawing styles lose parent-child relationship on FILESAVE FILEOPEN
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium major
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.1.0 target:5.4.7 target:6.0....
Keywords: dataLoss
: 115000 115714 (view as bug list)
Depends on:
Blocks: ImpressDraw-Styles
  Show dependency treegraph
 
Reported: 2012-01-14 02:47 UTC by Bernd Gloss
Modified: 2018-06-23 11:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple drawing with two lines with formats FormatA and FormatB. FormatB originally was linked with FormatA but is not when opening the document again. (10.64 KB, application/vnd.oasis.opendocument.graphics)
2012-01-14 02:47 UTC, Bernd Gloss
Details
Graphics Style Dialog for FormatB with Organizer of Style (27.90 KB, image/png)
2012-01-14 23:53 UTC, Bernd Gloss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Gloss 2012-01-14 02:47:46 UTC
Created attachment 55567 [details]
Simple drawing with two lines with formats FormatA and FormatB. FormatB originally was linked with FormatA but is not when opening the document again.

Hi,

LibreOffice Draw loses links between graphic styles when saving/re-opening the document.

How to reproduce the error?

- create an empty odg document
- create a FormatA with some properties, e.g., line color, line width
- create a FormatB and link it with FormatA in the organizer of the styles. Now change some of the properties of FormatB, e.g., line end-point.
- draw two lines and assign the styles FormatA to the one and FormatB to the other.
- save the file and close LibO Draw.
- open the file again

Now FormatB is not linked anymore with FormatA. It is rather linked with nothing ("None"), not even with the default style. Even the the line formatted with FormatB looks different now.

Seems that there is a mistake in managing the styles.

This report is based on a LibreOffice 3.4.4 from a Fedora16 distribution. However, I have seen this problem before with OpenOffice but did not report it that time.

Thanks for working on LibreOffice.

Bernd
Comment 1 Bernd Gloss 2012-01-14 05:56:11 UTC
btw... sometimes the linking works fine, sometimes not. That's like tossing a coin. I was wondering whether this effect is either related to the alphabetical order of the format names or to the order they are created.
Comment 2 Bernd Gloss 2012-01-14 23:53:22 UTC
Created attachment 55592 [details]
Graphics Style Dialog for FormatB with Organizer of Style
Comment 3 Bernd Gloss 2012-01-14 23:55:20 UTC
I did some investigations on the odg file looking to the style.xml

There, you can find that the error seems to be when writing the file or before. The link 


<style:style style:name="FormatA" style:family="graphic" style:parent-style-name="standard">
<style:graphic-properties draw:stroke-dash="Dash_20_2" svg:stroke-width="0.07cm" svg:stroke-color="#00ff00" draw:marker-start-width="0.31cm" draw:marker-end="Circle" draw:marker-end-width="0.31cm" draw:fill-gradient-name="Gradient_20_7" draw:fill-hatch-name="Hatching_20_1" draw:fill-image-name="Bitmape_20_1"/></style:style><style:style style:name="FormatB" style:family="graphic"><style:graphic-properties svg:stroke-color="#0000ff" draw:marker-end="Square"/></style:style>
Comment 4 Bernd Gloss 2012-01-14 23:58:44 UTC
<style:style style:name="FormatA" style:family="graphic" style:parent-style-name="standard">
  <style:graphic-properties draw:stroke-dash="Dash_20_2"svg:stroke-width="0.07cm" svg:stroke-color="#00ff00" draw:marker-start-width="0.31cm" draw:marker-end="Circle" draw:marker-end-width="0.31cm" draw:fill-gradient-name="Gradient_20_7" draw:fill-hatch-name="Hatching_20_1" draw:fill-image-name="Bitmape_20_1"/>
</style:style>

<style:style style:name="FormatB" style:family="graphic">
  <style:graphic-properties svg:stroke-color="#0000ff" draw:marker-end="Square"/></style:style>

There, you can see that the element for FormatA has an attribute style:parent-style-name while FormatB doesn't provide this attribute at all.
Comment 5 Regina Henschel 2012-01-18 11:33:40 UTC
I can reproduce it with the description in #1 on Windows7.
Comment 6 Art Covert 2013-09-17 17:59:11 UTC
I have a similar issue on linux, but style links are working correctly on my Mac OS laptop.
Comment 7 QA Administrators 2015-04-01 14:42:53 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2015-04-01 17:19:52 UTC
I have reproduced the bug with Version: 4.5.0.0.alpha0+
Build ID: 16b8fbb2e0c72ce321c9f569284f4ef37339af2c
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-03-10_09:56:13
Locale: de_DE

It is still a problem.
Comment 9 Regina Henschel 2015-11-23 20:04:00 UTC
Workaround: When you have first created the style, save the document, then use File > Reload. Then link the child style again to the parent style. Save again. Now the linking is kept.
Comment 10 QA Administrators 2017-09-01 11:20:55 UTC Comment hidden (obsolete)
Comment 11 Buovjaga 2018-03-07 12:24:54 UTC
*** Bug 115714 has been marked as a duplicate of this bug. ***
Comment 12 Tibor Kovács 2018-03-07 22:16:22 UTC
The bug is present in the LO 6.0.2 too...
Comment 13 Mike Kaganski 2018-03-11 04:07:24 UTC
https://gerrit.libreoffice.org/51069
Comment 14 Commit Notification 2018-03-11 06:03:44 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#44774: Parent style's msApiName could yet be empty; use GetApiName()

It will be available in 6.1.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 15 Commit Notification 2018-03-12 08:20:17 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

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

tdf#44774: Parent style's msApiName could yet be empty; use GetApiName()

It will be available in 5.4.7.

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 2018-03-12 08:20:27 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1dfb747f3c12881f54c2c826eaf0aaa938883a54&h=libreoffice-6-0

tdf#44774: Parent style's msApiName could yet be empty; use GetApiName()

It will be available in 6.0.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 17 Commit Notification 2018-03-12 15:55:16 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-4-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2eac99e7da9754b23e5f2a8a5a9c7af063088fdc&h=libreoffice-5-4-6

tdf#44774: Parent style's msApiName could yet be empty; use GetApiName()

It will be available in 5.4.6.

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 Roman Kuznetsov 2018-03-22 21:29:40 UTC
verified. fixed in 6.0.3.1 on Windows 10
Comment 19 Roman Kuznetsov 2018-06-23 11:07:34 UTC
*** Bug 115000 has been marked as a duplicate of this bug. ***