Changeset f1fc47f


Ignore:
Timestamp:
Jun 4, 2007, 12:46:55 AM (13 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
f1589b5
Parents:
42947f1
git-author:
Nelson Elhage <nelhage@mit.edu> (06/04/07 00:46:36)
git-committer:
Nelson Elhage <nelhage@mit.edu> (06/04/07 00:46:55)
Message:
Don't corrupt the current style pointer if we redefine the current
style.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r13a3c1db rf1fc47f  
    817817void owl_global_add_style(owl_global *g, owl_style *s)
    818818{
    819   owl_dict_insert_element(&(g->styledict), owl_style_get_name(s),
    820                           s, (void(*)(void*))owl_style_free);
     819  /*
     820   * If we're redefining the current style, make sure to update
     821   * pointers to it.
     822   */
     823  if(g->current_view.style
     824     && !strcmp(owl_style_get_name(g->current_view.style),
     825                owl_style_get_name(s)))
     826    g->current_view.style = s;
     827  owl_dict_insert_element(&(g->styledict), owl_style_get_name(s),
     828                          s, (void(*)(void*))owl_style_free);
    821829}
    822830
Note: See TracChangeset for help on using the changeset viewer.