On Mon, 27 Aug 2007 10:54:34 +0200 Abdelrazak Younes <[EMAIL PROTECTED]> wrote:
> Martin Vermeer wrote: > > On Mon, 27 Aug 2007 09:43:19 +0200 > >> There is a way: you just need the Color::color enum AFAIS so the > >> solution is to extract this enum from the Color class and give it its > >> own header. This will enable us to get rid of the Color_color > >> pseudoclass too. > > > > Not really true, I need the lcolor object and getFromLyXName(). > > OK. But my point on the Color::color remains valid IMO. > > > > >> In any case please commit your quick fix ASAP as compilation is broken > >> right now. > > > > OK > > Thanks. While you are at it, there's a problem with float inset > backgrounds, they are black: > > LyX internal error: Missing color entry in Color.cpp for -842150451 > Using black. > > > Abdel. Yes, I see that too. The reason is that there is no layout entry for Float, and no fallback for the case of a completely missing entry (TextClass contains a fallback for an entry missing a BgColor line). Fix attached. Changing the place of the backgroundColor() call is not necessary, but I think better as the method is defined in that class. - Martin
Index: InsetCollapsable.cpp =================================================================== --- InsetCollapsable.cpp (revision 19807) +++ InsetCollapsable.cpp (working copy) @@ -84,6 +84,8 @@ setDrawFrame(true); setFrameColor(Color::collapsableframe); setButtonLabel(); + // Fallback for lacking inset layout item + layout_.bgcolor = Color::background; } @@ -247,7 +249,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const { autoOpen_ = pi.base.bv->cursor().isInside(this); - + text_.background_color_ = backgroundColor(); const int xx = x + TEXT_TO_INSET_OFFSET; // Draw button first -- top, left or only Index: InsetText.cpp =================================================================== --- InsetText.cpp (revision 19807) +++ InsetText.cpp (working copy) @@ -194,7 +194,6 @@ TextMetrics & tm = pi.base.bv->textMetrics(&text_); - text_.background_color_ = backgroundColor(); text_.draw(pi, x + border_, y); if (drawFrame_) {