Issue 24648 - Numbering: layout can be fooled into using formatting for numbering which is not used in a paragraph
Summary: Numbering: layout can be fooled into using formatting for numbering which is ...
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: OOo 1.1
Hardware: Other Windows XP
: P4 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-21 18:48 UTC by nafai
Modified: 2013-08-07 14:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
This is a document that is causing some of the problems. (14.00 KB, application/msword)
2004-01-22 14:26 UTC, nafai
no flags Details
This is a document that is causing some of the problems. (14.00 KB, application/msword)
2004-01-22 14:26 UTC, nafai
no flags Details
Here is the Doc, must open in Open Office, it looks fine in MS Word. (10.00 KB, application/msword)
2004-01-22 15:48 UTC, nafai
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description nafai 2004-01-21 18:48:19 UTC
I imported a word document and all the autoformating of numbers along the left
side, which in my case was 1-255 were fine.  Except that number 3 of them are
listed in a smaller font size and unbolded?  Thanks.
Comment 1 h.ilter 2004-01-22 14:10:03 UTC
Bugdoc to evaluate is missing.
Comment 2 nafai 2004-01-22 14:26:25 UTC
Created attachment 12657 [details]
This is a document that is causing some of the problems.
Comment 3 nafai 2004-01-22 14:26:42 UTC
Created attachment 12658 [details]
This is a document that is causing some of the problems.
Comment 4 nafai 2004-01-22 14:27:29 UTC
I attached the bug document as requested.
Comment 5 h.ilter 2004-01-22 15:07:29 UTC
Reassigned to MRU
Comment 6 michael.ruess 2004-01-22 15:36:59 UTC
Hm, cannot see that in the attached file. Perhaps it happens only in your
original file where you have all the 255 numberings...?
Comment 7 nafai 2004-01-22 15:48:16 UTC
Created attachment 12662 [details]
Here is the Doc, must open in Open Office, it looks fine in MS Word.
Comment 8 nafai 2004-01-22 15:50:39 UTC
I have attached a new copy of the problem.doc  You will notice when you open it
in OO Write that the number 5 is not the same font type as the others. 
Originally 3,5,and 7 all had problems, but each time I copy them into a new
document and save the fonts change.
Comment 9 michael.ruess 2004-01-22 16:25:25 UTC
MRU->CMC: The last attachment has a small glitch. Number 5 (only the number, not
the rest of the para) is formatted TNR instead of Arial. 
Comment 10 caolanm 2004-02-03 16:41:34 UTC
cmc->fme: Bear with me on this one, its not possible to provide a native format
document which can do this, but it is possible from the UI. So, in a version
SRC680m21 at least and probably for a long time before...

Document 1, the expected result
1) New text document
2) type AB
3) select all characters together and format->character->font->e.g. Academy
Engraved LET
4) select all characters together and format->character->font->e.g. Arial
5) format bullets->numbering->numbering type, anything, ok

the result is that (as expected) all characters including numbering characters
share the Arial font formatting.

6) save as .sxw/reload, no change

Document 2, the surprising results
1) New text document
2) type AB
3) select all characters together and format->character->font->e.g. Academy
Engaved LET
4) select 'A' seperately and format->character->font->Arial
5) select 'B' seperately and format->character->font->Arial
6) format bullets->numbering->numbering type, anything, ok

result, AB remain formatted in Arial, numbering takes original "Academy Engraved
LET" font formatting :-(

7) save as .sxw/reload, now formatted like original correct document

Perhaps the numbering takes the font from the nodes pSwpHints ?, so that when
the characters are formatted seperately this is unchanged and the formatting
takes the original shared character formatting, and on a save and reload cycle
the xml export/import strips out the redundancy of shared hints which are unused ?

cmc->ama: Perhaps this is behind at least some of the strange formatting for
numbering we have seen, if so then a save as .sxw and reload cycle should
workaround the problem.

cmc->nafai: Until we have this fixed you could try saving your documents as .sxw
format and reload and see if the formatting of the number gets "fixed"
Comment 11 frank.meies 2004-02-04 07:10:44 UTC
FME->CMC: [...] Perhaps the numbering takes the font from the nodes pSwpHints ?,
so that when the characters are formatted seperately this is unchanged and the
formatting
takes the original shared character formatting, and on a save and reload cycle
the xml export/import strips out the redundancy of shared hints which are unused
? [...]

Yes, this is correct. But I don't have a clue what to do with this issue.
Comment 12 nafai 2004-02-04 15:30:59 UTC
Thanks for working on this.  Unfortunately, I can't use the quick fix because my
co-workers all use MS-Office so I have to keep it in .doc format.  Thanks though.
Comment 13 frank.meies 2004-02-05 07:42:41 UTC
FME->DVO: In InsAttr() in docfmt.cxx, there is some code like 

		if( pStt->nContent.GetIndex() != 0 || aCntEnd.GetIndex() != nLen )

which causes the attribute to be handled like a paragraph attribute. Could you
please have a look?

Comment 14 openoffice 2004-02-05 12:53:05 UTC
dvo: I think FME is correct; what happens is this: If a character attribute that
spans the entire paragraph is inserted, it is automatically turned into a
paragraph attribute. This _only_ happens when the attribute is inserted, _not_
when a suitable character attribute is created through a number of editing
steps. One could count this as an optimization since a paragraph attribute and a
character attribute over the whole paragraph are pretty much the same, except
that the former affects the numbering bullet, while the latter doesn't.

An additional problem is that programmatically there is no way to enforce or
suppress this behaviour, since it is done automatically at InsAttr(..), and
pretty much nowhere else. Thus the import filters have no way of importing this
correctly, even if they can tell the difference between the two. Hence, save +
load (.sxw) may change numbering bullets, since save correctly wrote out para +
char attributes, but during load some char attribute turned into para
attributes. Similar for WW8 import, I suppose.

I can see three ways of solving this:

1) We declare the conversion of char attribute over the complete paragraph to an
paragraph attribute as correct and desirable. Then all code must be changed to
obey this and the problem with load+save would go away. If this differs from
what other programs do, then those documents couldn't be fully represented.

2) We declare said conversion to be a superflous optimization and undesirable,
and remove the conversion from InsAttr(..). Filters would have to be changed to
do the conversion themselves, if their source formats would require it.

3) We declare current behavior to be correct at the UI level, but change the
code so it will not get done automatically (for filters, andAPI?). Filters would
then have to be changed to do the conversion themselves.

dvo->ama: I can't determine what is correct in this case. What needs to be done
(and by whom) depends on this decision.
Please also observe that this might be a problem in our already rather tight
schedule, and adjust target/priority if necessary.
Comment 15 michael.ruess 2004-05-06 12:32:39 UTC
Target OO later now.