Skip to content

Commit e9b6835

Browse files
committed
fix: crash in data grid when switching to an empty table on ArchLinux
May be reverted once the forms get DesignTimePPI = 96 Refs #2344
1 parent c8e8bed commit e9b6835

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/apphelpers.pas

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,13 @@ procedure FixVT(VT: TVirtualStringTree; IsResultGrid: Boolean=False);
14671467
MultiLineCount := AppSettings.ReadInt(asGridRowLineCount)
14681468
else
14691469
MultiLineCount := 1;
1470-
// Issue #2344: TBaseVirtualTree.UpdateVerticalRange crashes with ERangeError, due to FRangeY/Cardinal
1471-
// getting a negative value
1472-
// Happening when DefaultNodeHeight is set after clearing nodes and then with 0 nodes
1470+
// Issue #2344: TBaseVirtualTree.UpdateVerticalRange crashes with ERangeError on ArchLinux
1471+
// due to FRangeY/Cardinal getting a negative value.
1472+
// Happening when DefaultNodeHeight is set and then with 0 nodes in data grid
1473+
// Once the form files are back at 96 PPI this should no longer crash.
1474+
{$IFNDEF LINUX}
14731475
VT.DefaultNodeHeight := SingleLineHeight * MultiLineCount;
1476+
{$ENDIF}
14741477
if MultiLineCount > 1 then begin
14751478
VT.BeginUpdate;
14761479
Node := VT.GetFirstInitialized;

0 commit comments

Comments
 (0)