[haiku-development] Re: BTextView::StyleBuffer
- From: Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Fri, 01 May 2009 16:08:00 +0200
On 2009-05-01 at 15:11:29 [+0200], Oliver Tappe <zooey@xxxxxxxxxxxxxxx> wrote:
> Answering myself here (why is it that one usually gets new ideas only *after*
> having send off a mail?)
>
[ ... ]
> Is it correct that fNullStyle is meant to always hold the style at the cursor
> position?
> Upon an invocation of SetFontAndColor() without offsets, the given style must
> be stored somewhere if there is no selection, as that new style should then
> be used whenever the user types something. At least StyledEdit expects this
> to be the case.
>
> So would it be ok to maintain fNullStyle as the style at the current caret
> position at all times?
Ah, never mind - I think I've got it now:
fNullStyle is the cached style at the caret position, it is being
updated/changed either whenever the current style is being used by the
textview, or when the font/color is set directly at the caret position (without
a range).
So it is not being maintained at all times, only when necessary.
Anyway, at least StyledEdit, Mail and DeskCalc now seem to work as intended.
cheers,
Oliver
Other related posts: