fpspreadsheet: Avoid creating a blank cell if the row/col indexes passed to Worksheet.ReadAsText(row, col) are those of a non-existing cell (see https://forum.lazarus.freepascal.org/index.php/topic,41132.msg284876.html).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6377 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-05-04 07:43:48 +00:00
parent 47138e4412
commit 7416450bf4

View File

@ -2792,13 +2792,18 @@ end;
@return The text representation of the cell
-------------------------------------------------------------------------------}
function TsWorksheet.ReadAsText(ARow, ACol: Cardinal): string;
var
cell: PCell;
begin
Result := ReadAsText(GetCell(ARow, ACol));
cell := FindCell(ARow, ACol);
if cell <> nil then Result := ReadAsText(cell) else Result := '';
{ avoid creating a blenk cell if the cell does not exist
Result := ReadAsText(GetCell(ARow, ACol)); }
end;
function TsWorksheet.ReadAsUTF8Text(ARow, ACol: Cardinal): string;
begin
Result := ReadAsText(GetCell(ARow, ACol));
Result := ReadAsText(ARow, ACol);
end;
{@@ ----------------------------------------------------------------------------