Jean-Marc Lasgouttes wrote:
"Dov" == Dov Feldstern <dfeldstern-rhxOsnTko2JWk0Htik3J/[EMAIL PROTECTED]> 
writes:

Dov> Hi! Attached find a patch fixing
Dov> http://bugzilla.lyx.org/show_bug.cgi?id=3959 (which I just opened
Dov> tonight).

Dov> Please note that there appears to have been an attempt to
Dov> explicitly do the opposite of what I'm trying to do here, though
Dov> for different reasons, I think: r10808, which fixed bug 2115. I'm
Dov> not sure if what I'm trying to fix here is a necessary
Dov> consequence of that fix, but I certainly consider the current
Dov> behavior which the current patch fixes buggy.

The patch does not look wrong to me.
Dov> Specifically, what I'm doing here is going to override what's
Dov> being done in the InsetText constructor; but I'm not getting rid
Dov> of that, because there still may be times when the constructor is
Dov> called, from elsewhere...

I'd appreciate if you could try to track down the uses of this
constructor and see if this overriding could be avoided. This font
stuff is already intimidating, and we probably do not need another
level of weirdness :)

Dov> My patch still doesn't handle Tables. I think the language of
Dov> tables should be set to the current language, as well. Any help
Dov> is welcome.

Indeed. This is where working at insettext constructor level would
maybe help (of course, at this point one does not know the font, so
doing it as you do seems good).

JMarc



Yeah, thinking about this today I also realized that I should probably be doing something about the constructor... I think that I'll try to create a constructor which accepts a font to be used as the initial font. Does this sound all right? Do I need both real_current_font and current_font, or is one of them enough (which)?

But I also have a bigger question: why should we have a 'current_font' associated with every piece of text at all? I think perhaps there should only be a current_font associated with the cursor: when moving over text, the cursor's current_font would be set to match the font of the text at the current position. The cursor's current_font is also set when an explicit font/language change occurs. Otherwise, the cursor's current_font wouldn't change. Thus, when moving into a new "piece of text" --- an inset, a new paragraph, etc., if there is already text there, then that text's font will be matched; and if it's empty, then the last font that was in use is retained. Because, for example, I'm not sure that it's even correct that if I created a table while in Hebrew, then all the cells should also be in Hebrew... I think it's more natural for the latest font to be retained, unless there's already text there.

(Implementing this later idea may be more complicated; if we decide it's the right thing to do, I may still provide a quick patch along the lines of the first paragraph, until the second one is implemented.)

Any thoughts on this?

Dov

Reply via email to