diff options
author | corvid <corvid@lavabit.com> | 2011-07-11 21:31:11 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-07-11 21:31:11 +0000 |
commit | 647fe867efdd4de497f0c85b76ee6163d457a1f3 (patch) | |
tree | 235f672e055f2bd37084191bc647ac8dff675a4d /dw | |
parent | ac78463220cedd1d801ed8fd5369b4ec5c370340 (diff) |
rm tooltip string escaping (again)
Diffstat (limited to 'dw')
-rw-r--r-- | dw/fltkplatform.cc | 24 | ||||
-rw-r--r-- | dw/fltkplatform.hh | 1 |
2 files changed, 3 insertions, 22 deletions
diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index d591dad8..414ac67d 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -247,28 +247,10 @@ FltkColor * FltkColor::create (int col) FltkTooltip::FltkTooltip (const char *text) : Tooltip(text) { - if (!text) { - escaped_str = NULL; - } else if (!strchr(text, '@')) { - escaped_str = strdup(text); - } else { - /* FLTK likes to interpret symbols, and so they must be escaped */ - const char *src = text; - char *dest = escaped_str = (char *) malloc(strlen(text) * 2 + 1); - - while (*src) { - if (*src == '@') - *dest++ = *src; - *dest++ = *src++; - } - *dest = '\0'; - } } FltkTooltip::~FltkTooltip () { - if (escaped_str) - free(escaped_str); if (in_tooltip || req_tooltip) cancel(); /* cancel tooltip window */ } @@ -292,7 +274,7 @@ static void tooltip_tcb(void *data) void FltkTooltip::onEnter() { _MSG("FltkTooltip::onEnter\n"); - if (!escaped_str || !*escaped_str) + if (!str || !*str) return; if (req_tooltip == 0) { Fl::remove_timeout(tooltip_tcb); @@ -318,13 +300,13 @@ void FltkTooltip::onEnter() /* prepare tooltip window */ int x, y; Fl_Box *box = (Fl_Box*)tt_window->child(0); - box->label(escaped_str); + box->label(str); Fl::get_mouse(x,y); y += 6; /* calculate window size */ fl_font(box->labelfont(), box->labelsize()); int ww, hh; ww = 800; // max width; - fl_measure(escaped_str,ww,hh,FL_ALIGN_LEFT|FL_ALIGN_WRAP|FL_ALIGN_INSIDE); + fl_measure(str,ww,hh,FL_ALIGN_LEFT|FL_ALIGN_WRAP|FL_ALIGN_INSIDE); ww += 6; hh += 6; tt_window->resize(x,y,ww,hh); tt_window->show(); diff --git a/dw/fltkplatform.hh b/dw/fltkplatform.hh index bd3de4f3..7c8bd366 100644 --- a/dw/fltkplatform.hh +++ b/dw/fltkplatform.hh @@ -62,7 +62,6 @@ class FltkTooltip: public core::style::Tooltip private: FltkTooltip (const char *text); ~FltkTooltip (); - char *escaped_str; public: static FltkTooltip *create(const char *text); static void cancel(); |