fpspreadsheet: Fix interchanged col/row indexes in relation to multiline cell editor.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5852 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-05-13 11:23:08 +00:00
parent d8be456aec
commit 9a2bef119c

View File

@ -1946,7 +1946,7 @@ var
Rct: TRect; Rct: TRect;
delta: Integer; delta: Integer;
begin begin
FOldEditorText := GetCellText(Row, Col); FOldEditorText := GetCellText(Col, Row);
inherited; inherited;
if (Worksheet <> nil) and (Editor is TStringCellEditor) then if (Worksheet <> nil) and (Editor is TStringCellEditor) then
begin begin
@ -3039,13 +3039,16 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TsCustomWorksheetGrid.EditingDone; procedure TsCustomWorksheetGrid.EditingDone;
var var
oldText: String; //oldText: String;
cell: PCell; cell: PCell;
begin begin
if (not EditorShowing) and FEditing then if (not EditorShowing) and FEditing then
begin begin
{
oldText := GetCellText(Col, Row); oldText := GetCellText(Col, Row);
if oldText <> FEditText then if oldText <> FEditText then
}
if FOldEditorText <> FEditText then
begin begin
cell := Worksheet.GetCell(GetWorksheetRow(Row), GetWorksheetCol(Col)); cell := Worksheet.GetCell(GetWorksheetRow(Row), GetWorksheetCol(Col));
if Worksheet.IsMerged(cell) then if Worksheet.IsMerged(cell) then
@ -3055,6 +3058,7 @@ begin
else else
Worksheet.WriteCellValueAsString(cell, FEditText); Worksheet.WriteCellValueAsString(cell, FEditText);
FEditText := ''; FEditText := '';
FOldEditorText := '';
end; end;
inherited EditingDone; inherited EditingDone;
end; end;