[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users-jp 01302] Re: mgp segfault if a14/k14 not found.



From: Yoshifumi Nishida <nishida@csl.sony.co.jp>
Subject: [mgp-users-jp 01299] Re: mgp segfault if a14/k14 not found.
Date: Sun, 18 May 2003 01:31:47 -0700 (PDT)
Message-ID: <>

 >  > plfs自体は他でも参照しているようなので、PAGELIST_FONTが
 >  > とれなかった(plfs==NULL)時は、その旨を表示して終了したほうが
 >  > いいのではないでしょうか?
 > 
 > 終了してしまうのはちょっと不親切な気がするので、ちょっと考えてみます。
 > 明日パッチを出します。

こんな感じに修正してみました。
--
Yoshifumi Nishida
nishida@csl.sony.co.jp



*** plist.c	1999/06/17 07:38:13	1.22
--- plist.c	2003/05/19 06:11:17
***************
*** 53,59 ****
  	int i, ny, pl_x;
  	u_int pl_nx, pl_ny, pl_y;
  
! 	if (pl_titlewin)
  		return;
  
  	/* number of pages in x-axis */
--- 53,59 ----
  	int i, ny, pl_x;
  	u_int pl_nx, pl_ny, pl_y;
  
! 	if (pl_titlewin || !plfs)
  		return;
  
  	/* number of pages in x-axis */
***************
*** 227,233 ****
  	u_int page;
  	int showlast;
  
! 	if (!pg_mode || !pg_win)
  		return;
  
  	page = state->page;
--- 227,233 ----
  	u_int page;
  	int showlast;
  
! 	if (!pg_mode || !pg_win || !plfs)
  		return;
  
  	page = state->page;
*** x11.c	2001/02/03 18:46:50	1.28
--- x11.c	2003/05/19 06:11:18
***************
*** 287,295 ****
  		XSetFont(display, gc_pl, plfs->fid);
  		XSetFont(display, gc_plrev, plfs->fid);
  		XSetFont(display, gc_pta, plfs->fid);
! 	}
  	if (plkfs)
  		XSetFont(display, gc_ptk, plkfs->fid);
  	XSetFunction(display, gc_pl, GXcopy);
  	XSetFunction(display, gc_plrev, GXcopy);
  	XSetFunction(display, gc_pta, GXcopy);
--- 287,302 ----
  		XSetFont(display, gc_pl, plfs->fid);
  		XSetFont(display, gc_plrev, plfs->fid);
  		XSetFont(display, gc_pta, plfs->fid);
! 	} else 
! 		fprintf(stderr, 
! 		"cannot find %s font. please modify PAGELIST_FONT to display page guide.\n", 
! 				PAGELIST_FONT); 
! 
  	if (plkfs)
  		XSetFont(display, gc_ptk, plkfs->fid);
+ 	else 
+ 		fprintf(stderr, "cannot find %s font.\n", PAGELIST_KFONT); 
+ 
  	XSetFunction(display, gc_pl, GXcopy);
  	XSetFunction(display, gc_plrev, GXcopy);
  	XSetFunction(display, gc_pta, GXcopy);
***************
*** 298,305 ****
  	XSetBackground(display, gc_pl, WhitePixel(display, screen));
  	XSetForeground(display, gc_plrev, WhitePixel(display, screen));
  	XSetBackground(display, gc_plrev, BlackPixel(display, screen));
! 	pl_fh = (plfs->max_bounds.ascent + plfs->max_bounds.descent) * 1.2;
! 	pl_fw = plfs->max_bounds.rbearing + plfs->max_bounds.lbearing;
  }
  
  void
--- 305,315 ----
  	XSetBackground(display, gc_pl, WhitePixel(display, screen));
  	XSetForeground(display, gc_plrev, WhitePixel(display, screen));
  	XSetBackground(display, gc_plrev, BlackPixel(display, screen));
! 	if (plfs) {
! 		pl_fh = (plfs->max_bounds.ascent + plfs->max_bounds.descent) * 1.2;
! 		pl_fw = plfs->max_bounds.rbearing + plfs->max_bounds.lbearing;
! 		if (!plkfs) plkfs = plfs;
! 	}
  }
  
  void