Apache OpenOffice (AOO) Bugzilla – Issue 21966
WW8: Hybrid "Paragraph and character" styles
Last modified: 2013-08-07 14:38:26 UTC
Both headings '3.Laokirja originaali säilitab.' and '4.VORMISTAMINE' were originally (in word doc) marked as headings, after import they are not. Therefore automatically generated index is wrong.
Created attachment 10842 [details] testcase attached
reassigned to mru
I can Reproduce the problem on OpenOffice 1.1 (default Install, US), Win XP Pro Sp1. (And MS Office XP Sp2). It is real problem Number 3 is missing in OOo 1.1 I will attach screenshot in word xp
Created attachment 10863 [details] Screenshot at word xp, number 3 is missing in OOo
MRU->CMC: Default para style (with hard character format) was erroneously assigned to the third Heading by the import.
Not erroneously, correctly!. This is truly weird, that paragraph is certainly in the Default paragraph style, there is a character style applied "Char Char", and the diff from "Default" to "Char Char" is the same as the diff from "Normal" to "Heading 1", with reveal formatting in word in that paragraph "heading 1" does not appear at all, while the style "heading 1" is of style type "paragraph and character" which heading 2/3 etc is (as is usual) is of style "paragraph". Never seen this before. truly odd. I don't know whats going on with this.
Well, it seems the file was created using Word97 and, a couple of years later, opened and saved using Word XP, Estonian edition.
Hmm, 97 and 2000 agree with writer, while XP and 2003 do not...
Hmm, I understand now, and I really don't like it. cmc->ama: We've got a style headache with this one... In XP and above word has allowed users to select a range of text and apply a "paragraph style" to just that range. Under the hood Word creates a character style which shadows the paragraph style by containing a copy of the parts of the paragraph style which apply to character properties, e.g. "Heading 2 Char", and applying that to the selected text. This can be seen from word's menus when the document is loaded in versions <= 2000. In XP and above it hides this information from you. This would be ok if that was the end of the story, but in versions XP and above, when making Table Of Contents (and I guess similiar paragraph style based features) then Word will treat any paragraph which begins with the character style associated with a paragraph style as a paragraph belonging to the paragraph style, but only the selection that is in the associated character style. Thats a little confusing to explain, because its a totally stupid idea IMO :-). See the document that will be attached. Opened in XP and above the menus will tell you that the regions of large text are in "Heading 2" style, and when you update the toc you will see that the portion of the paragraph which starts with this character style is shown in the TOC, while the other one which ends in the associated char style does not. Open in 2000 and lower, here Word tells the truth and shows us in the menus that the regions of large text are just character styles, and that the paragraph style is really normal. When the TOC is updated in such an older version those paragraphs that start with the magic character styles are not included in the TOC. And of course this is the behaviour writer follows :-( Its just unlucky for the user of the original document that at some stage they must have selected less than a full paragraph in XP when applying Heading 1 to VORMISTAMINE and so ended up with such a associated character style :-( This would be very tricky to try and work around in the filter, it *might* be possible, but very hard indeed.
Created attachment 11593 [details] A example of these hybrid character styles
Nice feature :-( I don't want to implement the whole stuff. If we do so we will get issues from users of older Word version :-( Maybe we found a practicable solution. My first idea would be to set the paragraph style to "Heading xy" when all characters have the character style "Heading xy char". This would solve the problems when you make use of this "feature" by accident. Another possibility is to do the same if the first character has this style regardless of the other.
Yeah thats what I thought of as the "hard" solution, if the filter sees a char style at the start of a para that is associated (though I don't know the association rules at the moment) then turn the para into the para style, but then hard code the inverse difference from this style to the original properties onto the remainder of the para. Fairly nasty but plausible. It would fix the first example, but not my test document as the TOC in word XP+ will only include the charstyle portion of the paragraph, while this proposed hack would include the full para :-( I wonder if this is really the intended word behaviour, and not a bug, it breaks backward compatability somewhat needlessly.
Because of a shortage of resources we have to retarget this issue to OOo later.