Page 1 of 1

Division by zero when dragging application

Posted: Wed Oct 08, 2025 1:43 pm
by CGM
Hi

I get Division by zero when I drag a application to a monitor with scale 125% from a monitor with scale 100%.
The error only occurs when TRichViewEdit.WordWrap := False and TAB occurs in text.

RichViewEdit1.WordWrap := False;
RichViewEdit1.InsertText('Kalle '#9'Olle'#$D#$A);

I found some strange code in CRVFData.pas at line 6192:
LineStartX := RV_XToDevice(GetLeftMargin, TmpSad) + LeftIndent + FirstIndent;

If the parameter "sad" to TCustomRVFormattedData.CalculateMinItemsWidthNoWrap is not "nil" the local var "TmpSad" (TRVScreenAndDevice) is not initialied. Se attached application.

Using Using TRichView v23.0.1

Re: Division by zero when dragging application

Posted: Wed Oct 08, 2025 2:29 pm
by Sergey Tkachenko
I confirm the problem (that occurs only in no-wrap paragraphs with tabs).
Of course, it must be

Code: Select all

LineStartX := RV_XToDevice(GetLeftMargin, sad^) + LeftIndent + FirstIndent;

Re: Division by zero when dragging application

Posted: Sat Nov 08, 2025 11:54 am
by Sergey Tkachenko
Fixed in TRichView 24.0.2