Issue 89751 - Setting selected text to style's default upsets font in rets of paragraph
Summary: Setting selected text to style's default upsets font in rets of paragraph
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: OOo 3.0 Beta
Hardware: All All
: P4 Trivial (vote)
Target Milestone: 3.4.0
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2008-05-21 23:03 UTC by tab
Modified: 2017-05-20 10:30 UTC (History)
2 users (show)

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


Attachments
Arial to change to default (9.33 KB, application/vnd.oasis.opendocument.text)
2008-05-21 23:05 UTC, tab
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tab 2008-05-21 23:03:38 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?
Comment 1 tab 2008-05-21 23:05:04 UTC
Created attachment 53827 [details]
Arial to change to default
Comment 2 michael.ruess 2008-05-22 09:53:14 UTC
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.
Comment 3 andreas.martens 2008-05-23 16:32:04 UTC
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.
Comment 4 frank.meies 2008-06-06 17:09:31 UTC
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.
Comment 5 Mathias_Bauer 2011-02-17 15:36:25 UTC
please take over
Comment 6 mst.ooo 2011-02-17 15:44:16 UTC
@ mru:

could you please try out if this is still broken in DEV300?
i vaguely remember a similar problem...
Comment 7 michael.ruess 2011-02-22 12:20:54 UTC
MRU->MST: the problem still occurs as described in m100.
Comment 8 mst.ooo 2011-03-01 13:17:22 UTC
Comment on attachment 53827 [details]
Arial to change to default

fix attachment mimetype
Comment 9 mst.ooo 2011-03-03 14:27:23 UTC
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
Comment 10 mst.ooo 2011-03-03 14:27:57 UTC
oops, forgot target
Comment 11 michael.ruess 2011-03-16 14:01:50 UTC
Verified in CWS sw34bf04.