To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=81718





------- Additional comments from [EMAIL PROTECTED] Wed Sep 19 02:20:44 +0000 
2007 -------
I wonder if instead it might have something to do with the default attributes
associated with a paragraph, along with when and how those attributes are
established and updated.  Consider the following:

1. In a new document, turn bold on with Control+B
2. Type "hello"
3. Turn bold off with Control+B
4. Type " world"
5. Move to the "w" and then backspace to get rid of "hello "

At this point the text at caret offset 0 is the "w" and it's not bold.  Nothing
in the document is bold.  However if you call text.getDefaultAttributeSet() or
text.getDefaultAttributes() for that paragraph, one of the values that's
returned is: 'weight:600'.  If you examine the text attributes of any of the
characters in "world" with text.getAttributes(), you'll see that 'weight:400' is
returned (and thus explicitly defined).  The weight hasn't been defined at the
caret position just past the "d", therefore if you query its attributes, you get
'weight:600' (i.e. another instance of Rich's bug).

Now modify the above steps so that you get rid of all bold characters prior to
typing non-bold ones, i.e.:

1. In a new document, turn bold on with Control+B
2. Type "hello"
3. Turn bold off with Control+B
4. Backspace until "hello" is gone.
5. Type "world"

The end result on screen looks the same as the result of the first example, yet
the problem goes away:  The "default" weight is 400 (along with the weight
associated with the character just past "world") rather than 600.

Modify the steps yet again:

1. In a new document, type "hello world"
2. Select "hello" and make it bold.

Now the character at offset 0 is bold, yet the default weight (along with the
weight associated with the character just past "world") is still 400.

It would seem that the default text attributes for a paragraph in Writer are
defined as "whatever formatting is associated at the beginning of a paragraph
when the paragraph has a length of 0."  And it seems that this is what gets
returned when you query the text attributes for the offset just beyond the final
character in the paragraph.  Is the assumption that the about-to-be typed
character will inherit the default attributes?  If so, what Rich proposes is, I
think, a more accurate assumption to make.  HOWEVER, consider:

1. In a new document, type "hello world"
2. With the caret just past the "d" in world, and without having typed anything
else, press Control+B to turn bold on.

We know that the next character is going to be bold.  We can look at the
formatting toolbar and verify that bold's been toggled on.  And once we type
that character, text.getAttributes(11) will return 'weight:600' as expected. 
But UNTIL we type that character, text.getAttributes(11) will return nothing (of
any use anyway).  Therefore, an AT deriving the formatting of a character by
looking at the default attributes and factoring in the character attributes,
would conclude that the to-be-typed character at offset 11 is not going to be
bold -- and it would report that incorrect fact to the user.  

I'm not sure how best to expose attributes for characters that don't yet exist,
but are about to. :-)  But it would be handy if there is a clever way to
accomplish that because, in this instance, the attributes associated with the
last existing character are not applicable.

As long as we're on the subject of attributes.... ;-) I wonder if the
implementation of default attributes is OOo is consistent with how it's defined
in the AT-SPI.  There
(http://www.gnome.org/~billh/at-spi-idl/html/interfaceAccessibility_1_1Text.html)
 "default
attributes" are:

> the text attributes which apply to all text in the object by 
> virtue of the default settings of the document, view, or user 
> agent; e.g. those attributes which are implied rather than explicitly
> applied to the text object. For instance, an object whose entire text
> content has been explicitly marked as 'bold' will report the 'bold' 
> attribute via getAttributeRun(), whereas an object whose text weight 
> is inspecified may report the default or implied text weight in the 
> default AttributeSet.

Based on that definition, what *I* would expect to find exposed as the default
attributes are only those attributes associated with the entire paragraph style
(e.g. the default style, the heading 1 style, the text body style) as defined
for the document/template.

---------------------------------------------------------------------
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