Apache OpenOffice (AOO) Bugzilla – Issue 89751
Setting selected text to style's default upsets font in rets of paragraph
Last modified: 2017-05-20 10:30:28 UTC
In FontChng.odt, I entered ’On donne’ --in Arial, because of the preceding character. I want the default font instead (Times new Roman), so I highlight ’On donne’ and hit Ctrl_Shift_Blank: ’On donne’ is now in Times new Roman --good--, but the rest of the parag is Arial --is this normal, or crazy?
Created attachment 53827 [details] Arial to change to default
MRU->AMA: in the attached document, slect "On donne", Format.Default formatting -> selected text correctly reverts to styles default "Times New Roman", but rest of the paragraph is now formatted in "Arial"... A relict of the automaticstyles CWS? This worked correct last in OO 2.2.1.
ama->mru: Yes and no ;-) It's a relict of automatic styles because an old bug becomes more visible. Even in OOo1.x you will see a bug: New document Type e.g. 10 characters Select all Set 'bold' attribute select the last 4 characters reset 'bold' Select first 6 characters Set formatting to default => the last 4 characters are bold again.
Analysis: If we have the text: "word1word2" with Arial applied as a hard formatting on the whole paragraph and Times applied to word2. Then a "format reset" on word2 will first remove the Arial attribute from the paragraph and apply it to the characters inside the paragraph. During the portion building process, the new text attribute Arial will be split into two pieces, one covering word1 and one covering word2. The second piece of the Arial attribute will be merged with any existing attributes on word2, therefore the Times attribute will be deleted. Possible fix: When moving hard attributes from the paragraph to the text (hintsarray) in SwDoc::RstAttrs() we could pass the DONTREPLACE flag and act accordingly in the BuildPortions() function.
please take over
@ mru: could you please try out if this is still broken in DEV300? i vaguely remember a similar problem...
MRU->MST: the problem still occurs as described in m100.
Comment on attachment 53827 [details] Arial to change to default fix attachment mimetype
this is similar to issue 108345 if SwDoc::ResetAttrs had used the FmtToTxtAttr function to convert para attrs to hints instead of doing the conversion itself (twice!) it would have already been fixed :) fixed in CWS sw34bf04 http://hg.services.openoffice.org/hg/cws/sw34bf04/rev/7a64be995a68
oops, forgot target
Verified in CWS sw34bf04.