Re: user: fix DrawTextExA/W on empty strings.

2006-01-31 Thread Rein Klazes
On Fri, 27 Jan 2006 10:28:04 -0800, you 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" >I

Re: user: fix DrawTextExA/W on empty strings.

2006-01-27 Thread Bill Medland
On January 25, 2006 10:49 am, Rein Klazes wrote: > On Wed, 25 Jan 2006 07:49:57 -0800 (PST), you wrote: > >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) { >

Re: user: fix DrawTextExA/W on empty strings.

2006-01-25 Thread Dimi Paun
From: "Paul Vriens" <[EMAIL PROTECTED]> > 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 ;) -- Dimi Paun <[EMAIL PROTECTED]> Lattica, Inc.

Re: user: fix DrawTextExA/W on empty strings.

2006-01-25 Thread Paul Vriens
On Wed, 2006-01-25 at 14:03 -0500, Dimi Paun wrote: > From: "Rein Klazes" <[EMAIL PROTECTED]> > > Wrong, look again. > > You must be kidding. Care to explain how 'stmt' > can ever be executed in: > > ... >if (A || B) return; >if (B) stmt; > ... > But there's an if in between: if (count

Re: user: fix DrawTextExA/W on empty strings.

2006-01-25 Thread Dimi Paun
From: "Rein Klazes" <[EMAIL PROTECTED]> > Wrong, look again. You must be kidding. Care to explain how 'stmt' can ever be executed in: ... if (A || B) return; if (B) stmt; ... -- Dimi Paun <[EMAIL PROTECTED]> Lattica, Inc.

Re: user: fix DrawTextExA/W on empty strings.

2006-01-25 Thread Rein Klazes
On Wed, 25 Jan 2006 07:49:57 -0800 (PST), you wrote: >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 = r

Re: user: fix DrawTextExA/W on empty strings.

2006-01-25 Thread Juan Lang
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; +} +