diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index 241307b34..584e9193c 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -4339,6 +4339,11 @@ begin if (ACell1 = nil) and (ACell2 = nil) then Result := 0 else + if (ACell1 <> nil) and (ACell1^.ContentType = cctEmpty) and + (ACell2 <> nil) and (ACell2^.ContentType = cctEmpty) + then + Result := 0 + else if (ACell1 = nil) or (ACell1^.ContentType = cctEmpty) then begin Result := +1; // Empty cells go to the end @@ -4349,9 +4354,11 @@ begin Result := -1; // Empty cells go to the end exit; // Avoid SortOrder to bring the empty cell to the top! end else + { if (ACell1^.ContentType = cctEmpty) and (ACell2^.ContentType = cctEmpty) then Result := 0 else + } if (ACell1^.ContentType = cctUTF8String) and (ACell2^.ContentType = cctUTF8String) then begin if ssoCaseInsensitive in ASortOptions then diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas index ff66110ab..24a129a3a 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas @@ -324,7 +324,6 @@ type function SelectCell(ACol, ARow: Integer): Boolean; override; procedure SetEditText(ACol, ARow: Longint; const AValue: string); override; procedure Setup; - procedure Sort(AColSorting: Boolean; AIndex, AIndxFrom, AIndxTo:Integer); override; function ToPixels(AValue: Double): Integer; procedure TopLeftChanged; override; function TrimToCell(ACell: PCell): String; @@ -435,6 +434,8 @@ type const ALeftOuterStyle, ATopOuterStyle, ARightOuterStyle, ABottomOuterStyle, AHorInnerStyle, AVertInnerStyle: TsCellBorderStyle); + procedure Sort(AColSorting: Boolean; AIndex, AIndxFrom, AIndxTo:Integer); override; + { Row height / col width calculation } procedure UpdateColWidth(ACol: Integer); procedure UpdateColWidths(AStartIndex: Integer = 0); @@ -5569,6 +5570,7 @@ begin ); end; + {@@ ---------------------------------------------------------------------------- Converts a coordinate given in workbook units to pixels using the current screen resolution