You've already forked lazarus-ccr
fpspreadsheet: Overload methods FindCell and GetCell to TsWorksheet to accept an Excel "A1" address string. Update chm help file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3269 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Binary file not shown.
@ -603,8 +603,10 @@ type
|
||||
procedure CopyCell(AFromRow, AFromCol, AToRow, AToCol: Cardinal; AFromWorksheet: TsWorksheet);
|
||||
procedure CopyFormat(AFormat: PCell; AToRow, AToCol: Cardinal); overload;
|
||||
procedure CopyFormat(AFromCell, AToCell: PCell); overload;
|
||||
function FindCell(ARow, ACol: Cardinal): PCell;
|
||||
function GetCell(ARow, ACol: Cardinal): PCell;
|
||||
function FindCell(ARow, ACol: Cardinal): PCell; overload;
|
||||
function FindCell(AddressStr: String): PCell; overload;
|
||||
function GetCell(ARow, ACol: Cardinal): PCell; overload;
|
||||
function GetCell(AddressStr: String): PCell; overload;
|
||||
function GetCellCount: Cardinal;
|
||||
function GetFirstCell(): PCell;
|
||||
function GetNextCell(): PCell;
|
||||
@ -1615,8 +1617,7 @@ begin
|
||||
end;
|
||||
|
||||
{@@
|
||||
Tries to locate a Cell in the list of already
|
||||
written Cells
|
||||
Tries to locate a Cell in the list of already written Cells
|
||||
|
||||
@param ARow The row of the cell
|
||||
@param ACol The column of the cell
|
||||
@ -1637,20 +1638,35 @@ begin
|
||||
result := PCell(AVLNode.Data);
|
||||
end;
|
||||
|
||||
{@@
|
||||
Tries to locate a Cell in the list of already written Cells
|
||||
|
||||
@param AddressStr Address of the cell in Excel A1 notation
|
||||
@return Pointer to the cell if found, or nil if not found
|
||||
@see TCell
|
||||
}
|
||||
function TsWorksheet.FindCell(AddressStr: String): PCell;
|
||||
var
|
||||
r, c: Cardinal;
|
||||
begin
|
||||
if ParseCellString(AddressStr, r, c) then
|
||||
Result := FindCell(r, c)
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
{@@
|
||||
Obtains an allocated cell at the desired location.
|
||||
|
||||
If the Cell already exists, a pointer to it will
|
||||
be returned.
|
||||
If the Cell already exists, a pointer to it will be returned.
|
||||
|
||||
If not, then new memory for the cell will be allocated,
|
||||
a pointer to it will be returned and it will be added
|
||||
to the list of cells.
|
||||
If not, then new memory for the cell will be allocated, a pointer to it
|
||||
will be returned and it will be added to the list of cells.
|
||||
|
||||
@param ARow Row index of the cell
|
||||
@param ACol Column index of the cell
|
||||
|
||||
@return A pointer to the Cell on the desired location.
|
||||
@return A pointer to the cell at the desired location.
|
||||
|
||||
@see TCell
|
||||
}
|
||||
@ -1672,6 +1688,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@
|
||||
Obtains an allocated cell at the desired location.
|
||||
|
||||
If the Cell already exists, a pointer to it will be returned.
|
||||
|
||||
If not, then new memory for the cell will be allocated, a pointer to it
|
||||
will be returned and it will be added to the list of cells.
|
||||
|
||||
@param AddressStr Address of the cell in Excel A1 notation (an exception is
|
||||
raised in case on an invalid cell address).
|
||||
@return A pointer to the cell at the desired location.
|
||||
|
||||
@see TCell
|
||||
}
|
||||
function TsWorksheet.GetCell(AddressStr: String): PCell;
|
||||
var
|
||||
r, c: Cardinal;
|
||||
begin
|
||||
if ParseCellString(AddressStr, r, c) then
|
||||
Result := GetCell(r, c)
|
||||
else
|
||||
raise Exception.CreateFmt(lpNoValidCellAddress, [AddressStr]);
|
||||
end;
|
||||
|
||||
{@@
|
||||
Returns the number of cells in the worksheet with contents.
|
||||
|
||||
|
@ -2034,13 +2034,8 @@ procedure TsSpreadBIFFWriter.WriteRPNFormula(AStream: TStream;
|
||||
const ARow, ACol: Cardinal; const AFormula: TsRPNFormula; ACell: PCell);
|
||||
var
|
||||
i: Integer;
|
||||
len: Integer;
|
||||
RPNLength: Word;
|
||||
RecordSizePos, FinalPos: Int64;
|
||||
// TokenID: Word;
|
||||
// lSecondaryID: Word;
|
||||
// c: Cardinal;
|
||||
wideStr: WideString;
|
||||
begin
|
||||
{ BIFF Record header }
|
||||
AStream.WriteWord(WordToLE(INT_EXCEL_ID_FORMULA));
|
||||
|
Reference in New Issue
Block a user