Added more strictness to the use of read_styles

This commit is contained in:
Joel Holdsworth 2009-01-02 00:44:10 +00:00
parent 85d6a19dd4
commit 8285daec39

View file

@ -311,6 +311,7 @@ void
TimelineHeaderContainer::layout_headers()
{
REQUIRE(timelineWidget != NULL);
REQUIRE(margin >= 0); // read_styles must have been called before now
// We can't layout before the widget has been set up
if(!gdkWindow)
@ -568,7 +569,10 @@ void
TimelineHeaderContainer::read_styles()
{
if(margin <= 0)
get_style_property("heading_margin", margin);
{
get_style_property("heading_margin", margin);
margin = max(margin, 0);
}
else
WARN(gui, "TimelineHeaderContainer::read_styles()"
" should only be called once");