To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=87513
                 Issue #|87513
                 Summary|Parent style not inherited if style is not automatic
               Component|Word processor
                 Version|OOo 2.3
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|open-import
             Assigned to|mru
             Reported by|mbardac





------- Additional comments from [EMAIL PROTECTED] Thu Mar 27 16:00:07 +0000 
2008 -------
I am using Odfpy 0.7 from http://opendocumentfellowship.com/projects/odfpy to
build an .odt to be later edited using OpenOffice.

I found that a created style which inherits another style is not properly
rendered in OpenOffice 2.3.0. More specifically, the inheritance is ignored. If
I create an automatic style though, the inheritance is respected and the result
shows combined styles properly.

I've created a sample application to generate a document which triggers this
behaviour:

-- START --
#!/usr/bin/env python

from odf.opendocument import OpenDocumentText
from odf.style import Style, TextProperties, ParagraphProperties
from odf.text import P

textdoc = OpenDocumentText()

style_base = Style(name="MyStyle", family="paragraph")
style_base.addElement(ParagraphProperties(textalign="center"))
textdoc.styles.addElement(style_base)

style_new = Style(name="MyStyleDerived", parentstylename=style_base,
family="paragraph")
style_new.addElement(TextProperties(fontweight="bold"))
textdoc.styles.addElement(style_new)

txt=P(stylename=style_new, text="My Text")
textdoc.text.addElement(txt)

textdoc.save("sample-styles.odt")

-- END --

If I change this line:
> textdoc.styles.addElement(style_new)
to:
> textdoc.automaticstyles.addElement(style_new)
the generated document is rendered correctly.

The expected rendering would be the text "My Text" centered and bold.

Please note that KWord 1.6.3 renders this correctly.


---

Also, a document in which I manually change the parent style using the Organizer
tab > Linked with dropdown is properly rendered any time it is opened. I do not
know what OpenOffice saves besides the style which makes it behave properly
later. The XML style definition generated with Odfpy is the same with the one 
OpenOffice generates, but I do not know what else OpenOffice uses which triggers
the correct rendering.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to