Changeset 3fa0181 for fmtext.c


Ignore:
Timestamp:
May 1, 2011, 5:30:33 PM (10 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
4fd211f (diff), 7b4f3be (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 7b4f3bea704ed82f2c36ba19fcf354d7442a5bb7 into 4fd211f3a533efcedaf4d0dc7c01e02087ad2e39
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r4479497 r7b4f3be  
    184184}
    185185
    186 static void _owl_fmtext_update_colorpair(short fg, short bg, short *pair)
    187 {
    188   if (owl_global_get_hascolors(&g)) {
    189     *pair = owl_fmtext_get_colorpair(fg, bg);
    190   }
    191 }
    192 
    193186static void _owl_fmtext_wcolor_set(WINDOW *w, short pair)
    194187{
    195   if (owl_global_get_hascolors(&g)) {
     188  if (has_colors()) {
    196189      wcolor_set(w,pair,NULL);
    197190      wbkgdset(w, COLOR_PAIR(pair));
     
    221214  bg = default_bgcolor;
    222215  _owl_fmtext_wattrset(w, attr);
    223   _owl_fmtext_update_colorpair(fg, bg, &pair);
     216  pair = owl_fmtext_get_colorpair(fg, bg);
    224217  _owl_fmtext_wcolor_set(w, pair);
    225218
     
    270263      if (bg == OWL_COLOR_DEFAULT) bg = default_bgcolor;
    271264      _owl_fmtext_wattrset(w, attr);
    272       _owl_fmtext_update_colorpair(fg, bg, &pair);
     265      pair = owl_fmtext_get_colorpair(fg, bg);
    273266      _owl_fmtext_wcolor_set(w, pair);
    274267
     
    662655           continue */
    663656      } else if (!strcasecmp(buff, "@color")
    664                  && owl_global_get_hascolors(&g)
    665657                 && owl_global_is_colorztext(&g)) {
    666658        g_free(buff);
     
    820812    }
    821813  }
    822   if (owl_global_get_hascolors(&g)) {
     814  if (has_colors()) {
    823815    for(i = 0; i < 8; i++) {
    824816      short fg, bg;
     
    835827  owl_colorpair_mgr *cpmgr;
    836828  short pair;
     829
     830  if (!has_colors())
     831    return 0;
    837832
    838833  /* Sanity (Bounds) Check */
     
    852847  if (!(pair != -1 && pair < cpmgr->next)) {
    853848    /* If we didn't find a pair, search for a free one to assign. */
    854     pair = (cpmgr->next < COLOR_PAIRS) ? cpmgr->next : -1;
     849    pair = (cpmgr->next < owl_util_get_colorpairs()) ? cpmgr->next : -1;
    855850    if (pair != -1) {
    856851      /* We found a free pair, initialize it. */
Note: See TracChangeset for help on using the changeset viewer.