The function PixelsToStandardPixels in RVStyle.pas has to be changed in the following manner (the cast to real was added). Otherwise the usage of the Devexpress Editor Wrapper in 32-Bit will lead to an integer overflow if the text of the editor is empty. Reproduction: Add a Devexpress Tree or Grid Control to a form and use the TcxRichViewEdit as Column-Editor. Compile under 32-Bit and start the application.
{-----------------------------------------------------------------------}
{ Converts pixels from PixelsPerInch to UnitsPixelsPerInch }
function TRVStyle.PixelsToStandardPixels(Value: TRVCoord;
PixelsPerInch: TRVPixelsPerInch): TRVPixelLength;
begin
Result := Round(Real(Value) * UnitsPixelsPerInch / PixelsPerInch);
end;
{-----------------------------------------------------------------------}
Integer Overflow in RVStyle.pas
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Integer Overflow in RVStyle.pas
Thank you!
I'll reorder operands to perform division before multiplication, like in most of other similar expressions in RVStyle unit.
I'll reorder operands to perform division before multiplication, like in most of other similar expressions in RVStyle unit.