Subject: patch: Re: tooltips crash
From: Mike Nordell (tamlin@algonet.se)
Date: Thu Jan 11 2001 - 16:48:35 CST
Gediminas Paulauskas wrote:
> My friend, using Abi on Windows, has noticed a strange crash -- when
holding
> over some of toolbar buttons for some time, instead of showing a tooltip,
> abi crashes. He noticed, that this is true only on items, whose
szStatusMsg
> is "", i.e. empty. As I understand the comment in ap_TB_LabelSet_lt-LT.h
> file, if this field is blank (""), the default should be shown (from the
> corresponding menu entry). But it just shows nthing in such items.
As the code looks today, it tries to display the status message, but in the
lt-LT l18n it's null, not "" (empty string) and the code apparently didn't
handle this case.
Since my sources are a bit in flux right now (I'm adding bitmap cleanup code
to the win32 toolbar class) could someone please committ the following?
Thanks.
af/ev/win/wv_Win32Toolbar.cpp
20 lines from the end of this file, in function getToolTip, it reads
// here 'tis
strncpy(lpttt->lpszText, szToolTip, 80);
Please replace those two lines with:
if (!szToolTip || !*szToolTip)
{
szToolTip = pLabel->getToolbarLabel();
}
if (szToolTip && *szToolTip)
{
// here 'tis
strncpy(lpttt->lpszText, szToolTip, 80);
}
else
{
lpttt->lpszText[0] = '\0';
}
That takes care of it.
/Mike
This archive was generated by hypermail 2b25 : Thu Jan 11 2001 - 16:48:42 CST