[lazarus] New Bug Entered

andrew johnson acjgenius at earthlink.net
Tue Oct 29 07:27:03 EST 2002


On Tue, 2002-10-29 at 02:53, Jesus Reyes wrote:
> > >> > 3) TGtkObject.SelectClipRgn.
> > >> > The first lines of this routine is:
> > >> >
> > >> > if not isValidDc(DC) then
> > >> >   Result := Error;
> > >> > if Result <> Error then
> > >> >
> > >> > This should be something like:
> > >> >
> > >> > Error := 0
> > >> > if not IsValidDc(DC) then
> > >> >     Result := Error;
> > >> > if Result <> Error then
> > >>
> > >>This is not a bug, ERROR is a Win32 defined const, which is declared
> > >>elsewhere.
> > >
> > >I think Jeroen ment Result=0 instead of Error=0.
> > >
> > >Result is uninitialized.
> > >
> > >Marc
> >
> > whoops. looks like you may be right. So..
> >
> > Fixed.
> >
> > Andrew
> >
> 
> Sorry if this message is repeated.
> ...
> 
> I think this would be a problem anyway because Error was declared as Error =
> 0; in lcltype.pp
> so Result:=0 is the same as Result:=Error.  DC is always treated as Invalid
> and Result <> Error is false.
> 
>  This happen to be a problem in some other routines.... ExtSelectClipRGN,
> ExcludeClipRect, getClipBox, getClipRGN, SelectClipRGN, IntersectClipRect.
> At least I can confirm this with getClipBox
> But I could be wrong....

No, you are correct. I wasn't Paying Attention or I would have realized
this. These Routines should all Initialize the Result to SIMPLEREGION.
They were right to begin with, so I assume I screwed them up somewhere
along the lines. Probably before I even comitted them.. The fact that
the result was uninitialized is the only reason it worked! Ah well I
believe it is fixed now. But you should probably test it out for
yourself, just in case.

Andrew







More information about the Lazarus mailing list