diff options
Diffstat (limited to 'src/misc.cc')
-rw-r--r-- | src/misc.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/misc.cc b/src/misc.cc index 37e2580..728c5ae 100644 --- a/src/misc.cc +++ b/src/misc.cc | |||
@@ -366,15 +366,19 @@ void Misc::XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawab | |||
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
369 | //Draw title string | ||
369 | void Misc::DrawString(Display *display, Window w, GC gc, Misc::Font *font, | 370 | void Misc::DrawString(Display *display, Window w, GC gc, Misc::Font *font, |
370 | unsigned int text_w, unsigned int size_w, | 371 | unsigned int text_w, unsigned int size_w, |
371 | unsigned int bevel_w, char *text) { | 372 | unsigned int bevel_w, char *text) { |
372 | //Draw title string | ||
373 | 373 | ||
374 | if (!text || text_w<1 || size_w < 1 || !font || !display) | ||
375 | return; | ||
376 | |||
374 | unsigned int l = text_w; | 377 | unsigned int l = text_w; |
375 | int dlen=strlen(text); | 378 | int dlen=strlen(text); |
376 | int dx=bevel_w*2; | 379 | int dx=bevel_w*2; |
377 | 380 | ||
381 | |||
378 | if (text_w > size_w) { | 382 | if (text_w > size_w) { |
379 | for (; dlen >= 0; dlen--) { | 383 | for (; dlen >= 0; dlen--) { |
380 | if (I18n::instance()->multibyte()) { | 384 | if (I18n::instance()->multibyte()) { |
@@ -426,6 +430,9 @@ void Misc::DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font | |||
426 | unsigned int size_w, unsigned int size_h, | 430 | unsigned int size_w, unsigned int size_h, |
427 | unsigned int bevel_w, char *text) { | 431 | unsigned int bevel_w, char *text) { |
428 | 432 | ||
433 | if (!text || text_w<1 || size_w < 1 || !font || !display) | ||
434 | return; | ||
435 | |||
429 | unsigned int l = text_w; | 436 | unsigned int l = text_w; |
430 | int dlen = strlen(text); | 437 | int dlen = strlen(text); |
431 | int dx = bevel_w * 2; | 438 | int dx = bevel_w * 2; |