Hi Rein,
- if (!str) return 0; + if (!str || count == 0) return 0; if (count == -1) count = strlenW(str); - if (count == 0) return 0; + if (count == 0) { + if( flags & DT_CALCRECT) { + rect->right = rect->left; + rect->bottom = rect->top; + } + return 0; + }
This block will never be reached because of the if (!str || count == 0) test above.
--Juan
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On Wed, 25 Jan 2006 07:49:57 -0800 (PST), you wrote:
Wrong, look again.
It can be coded a little bit more efficiently though. I will make a different patch.
Rein.
Rein.
From: "Rein Klazes" wijn@wanadoo.nl
Wrong, look again.
You must be kidding. Care to explain how 'stmt' can ever be executed in:
... if (A || B) return; if (B) stmt; ...
On Wed, 2006-01-25 at 14:03 -0500, Dimi Paun wrote:
But there's an if in between:
if (count == -1) count = strlenW(str);
Paul.
From: "Paul Vriens" Paul.Vriens@xs4all.nl
But there's an if in between:
if (count == -1) count = strlenW(str);
Yeap, missed that one. Which proves that the code should be improved, since it managed to confuse 2 people already ;)
On January 25, 2006 10:49 am, Rein Klazes wrote:
(Apart from the other discussion) are you sure that you really mean that? "If the length is explicitly stated to be zero then don't do the calcrect but if the length is to be measured and happens to come out as zero then do do the calcrect" If so then I suggest at least a comment that it is deliberate; it sounds counterintuitive to me.
On Fri, 27 Jan 2006 10:28:04 -0800, you wrote:
I thought I did even better by providing tests for each of those cases, which pass here under Win2k and XP.
Other weird observations: the different behavior of the A and W functions; the "return 0" in that code are actually "return 1" on Win2k but not on XP.
Rein.