You've already forked lazarus-ccr
fpspreadsheet: Fix crash of db_import_export demo in virtual mode.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5993 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -8,7 +8,7 @@ object Form1: TForm1
|
|||||||
ClientWidth = 521
|
ClientWidth = 521
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.9.0.0'
|
||||||
object PageControl: TPageControl
|
object PageControl: TPageControl
|
||||||
Left = 4
|
Left = 4
|
||||||
Height = 302
|
Height = 302
|
||||||
@ -274,7 +274,6 @@ object Form1: TForm1
|
|||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnClick = FileListClick
|
OnClick = FileListClick
|
||||||
Options = [lboDrawFocusRect]
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
|
@ -514,6 +514,7 @@ begin
|
|||||||
|
|
||||||
FWorkbook := TsWorkbook.Create;
|
FWorkbook := TsWorkbook.Create;
|
||||||
try
|
try
|
||||||
|
FWorkbook.FormatSettings.ShortDateFormat := 'dd.mm.yyyy "r."';
|
||||||
worksheet := FWorkbook.AddWorksheet(tableName);
|
worksheet := FWorkbook.AddWorksheet(tableName);
|
||||||
|
|
||||||
// Make header line frozen - but not in Excel2 where frozen panes do not yet work properly
|
// Make header line frozen - but not in Excel2 where frozen panes do not yet work properly
|
||||||
@ -614,7 +615,7 @@ begin
|
|||||||
cctNumber : if IsCurrencyFormat(nfp) then fieldType := ftCurrency
|
cctNumber : if IsCurrencyFormat(nfp) then fieldType := ftCurrency
|
||||||
else fieldType := ftFloat;
|
else fieldType := ftFloat;
|
||||||
cctDateTime : fieldType := ftDateTime;
|
cctDateTime : fieldType := ftDateTime;
|
||||||
cctUTF8String : fieldType := ftString;
|
else fieldType := ftString;
|
||||||
end;
|
end;
|
||||||
FImportDataset.FieldDefs.Add(FImportedFieldNames[i], fieldType);
|
FImportDataset.FieldDefs.Add(FImportedFieldNames[i], fieldType);
|
||||||
end;
|
end;
|
||||||
@ -629,7 +630,7 @@ begin
|
|||||||
case FImportedRowCells[i].ContentType of
|
case FImportedRowCells[i].ContentType of
|
||||||
cctNumber : FImportDataset.Fields[i].AsFloat := FImportedRowCells[i].NumberValue;
|
cctNumber : FImportDataset.Fields[i].AsFloat := FImportedRowCells[i].NumberValue;
|
||||||
cctDateTime : FImportDataset.Fields[i].AsDateTime := FImportedRowCells[i].DateTimeValue;
|
cctDateTime : FImportDataset.Fields[i].AsDateTime := FImportedRowCells[i].DateTimeValue;
|
||||||
cctUTF8String: FImportDataset.Fields[i].AsString := FImportedRowCells[i].UTF8StringValue;
|
else FImportDataset.Fields[i].AsString := FImportedRowCells[i].UTF8StringValue;
|
||||||
end;
|
end;
|
||||||
FImportDataset.Post;
|
FImportDataset.Post;
|
||||||
// Finally we dispose the buffered cells, we don't need them any more
|
// Finally we dispose the buffered cells, we don't need them any more
|
||||||
|
@ -1778,7 +1778,7 @@ begin
|
|||||||
|
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -1798,7 +1798,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -1997,7 +1997,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -2023,7 +2023,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -2311,7 +2311,7 @@ begin
|
|||||||
// Create cell and apply format
|
// Create cell and apply format
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.GetCell(ARow, ACol); // Don't use AddCell here
|
cell := FWorksheet.GetCell(ARow, ACol); // Don't use AddCell here
|
||||||
@ -2643,7 +2643,7 @@ begin
|
|||||||
// Initalize cell
|
// Initalize cell
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -2760,7 +2760,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -3559,7 +3559,7 @@ var
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// No cell in row --> appy format to dummy cell to get its format index
|
// No cell in row --> appy format to dummy cell to get its format index
|
||||||
InitCell(row, 0, cellRecord);
|
InitCell(FWorksheet, row, 0, cellRecord);
|
||||||
ApplyStyleToCell(@cellRecord, styleIndex);
|
ApplyStyleToCell(@cellRecord, styleIndex);
|
||||||
lRow^.FormatIndex := cellRecord.FormatIndex;
|
lRow^.FormatIndex := cellRecord.FormatIndex;
|
||||||
end;
|
end;
|
||||||
@ -3618,7 +3618,7 @@ var
|
|||||||
if cell <> nil then
|
if cell <> nil then
|
||||||
colFmt[col] := cell^.FormatIndex
|
colFmt[col] := cell^.FormatIndex
|
||||||
else begin
|
else begin
|
||||||
InitCell(row, col, cellRecord);
|
InitCell(FWorksheet, row, col, cellRecord);
|
||||||
ApplyStyleToCell(@cellRecord, styleIndex);
|
ApplyStyleToCell(@cellRecord, styleIndex);
|
||||||
colFmt[col] := cellRecord.FormatIndex;
|
colFmt[col] := cellRecord.FormatIndex;
|
||||||
end;
|
end;
|
||||||
@ -7327,7 +7327,7 @@ begin
|
|||||||
colsRepeated := 1;
|
colsRepeated := 1;
|
||||||
|
|
||||||
lCell.Row := r; // to silence a compiler hint...
|
lCell.Row := r; // to silence a compiler hint...
|
||||||
InitCell(r, c, lCell);
|
InitCell(ASheet, r, c, lCell);
|
||||||
value := varNull;
|
value := varNull;
|
||||||
styleCell := nil;
|
styleCell := nil;
|
||||||
|
|
||||||
@ -7339,7 +7339,7 @@ begin
|
|||||||
cc := c + 1;
|
cc := c + 1;
|
||||||
while (cc <= lastCol) do
|
while (cc <= lastCol) do
|
||||||
begin
|
begin
|
||||||
InitCell(r, cc, lCell);
|
InitCell(ASheet, r, cc, lCell);
|
||||||
value := varNull;
|
value := varNull;
|
||||||
styleCell := nil;
|
styleCell := nil;
|
||||||
ASheet.OnWriteCellData(ASheet, r, cc, value, styleCell);
|
ASheet.OnWriteCellData(ASheet, r, cc, value, styleCell);
|
||||||
|
@ -2274,7 +2274,7 @@ begin
|
|||||||
WriteComment(r, c, '');
|
WriteComment(r, c, '');
|
||||||
|
|
||||||
// Erase all cell content
|
// Erase all cell content
|
||||||
InitCell(r, c, ACell^);
|
InitCell(nil, r, c, ACell^);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ procedure SplitHyperlink(AValue: String; out ATarget, ABookmark: String);
|
|||||||
procedure FixHyperlinkPathDelims(var ATarget: String);
|
procedure FixHyperlinkPathDelims(var ATarget: String);
|
||||||
|
|
||||||
procedure InitCell(out ACell: TCell); overload;
|
procedure InitCell(out ACell: TCell); overload;
|
||||||
procedure InitCell(ARow, ACol: Cardinal; out ACell: TCell); overload;
|
procedure InitCell(AWorksheet: Pointer; ARow, ACol: Cardinal; out ACell: TCell); overload;
|
||||||
procedure InitCryptoInfo(out AValue: TsCryptoInfo);
|
procedure InitCryptoInfo(out AValue: TsCryptoInfo);
|
||||||
procedure InitFormatRecord(out AValue: TsCellFormat);
|
procedure InitFormatRecord(out AValue: TsCellFormat);
|
||||||
procedure InitImageRecord(out AValue: TsImage; ARow, ACol: Cardinal;
|
procedure InitImageRecord(out AValue: TsImage; ARow, ACol: Cardinal;
|
||||||
@ -2105,13 +2105,15 @@ end;
|
|||||||
Initalizes a new cell and presets the row and column fields of the cell record
|
Initalizes a new cell and presets the row and column fields of the cell record
|
||||||
to the parameters passed to the procedure.
|
to the parameters passed to the procedure.
|
||||||
|
|
||||||
|
@param AWorksheet Pointer to the worksheet containing the cell
|
||||||
@param ARow Row index of the new cell
|
@param ARow Row index of the new cell
|
||||||
@param ACol Column index of the new cell
|
@param ACol Column index of the new cell
|
||||||
@return New cell record with row and column fields preset to passed values.
|
@return New cell record with row and column fields preset to passed values.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure InitCell(ARow, ACol: Cardinal; out ACell: TCell);
|
procedure InitCell(AWorksheet: Pointer; ARow, ACol: Cardinal; out ACell: TCell);
|
||||||
begin
|
begin
|
||||||
InitCell(ACell);
|
InitCell(ACell);
|
||||||
|
ACell.Worksheet := AWorksheet;
|
||||||
ACell.Row := ARow;
|
ACell.Row := ARow;
|
||||||
ACell.Col := ACol;
|
ACell.Col := ACol;
|
||||||
end;
|
end;
|
||||||
|
@ -492,13 +492,13 @@ begin
|
|||||||
// Column width (to be considered in first row)
|
// Column width (to be considered in first row)
|
||||||
if i = 0 then
|
if i = 0 then
|
||||||
lColWidthStr := Format(' width="%.0fpt"', [
|
lColWidthStr := Format(' width="%.0fpt"', [
|
||||||
FWorkbook.ConvertUnits(FWorksheet.GetColWidth(i), FWorkbook.Units, suPoints)
|
FWorkbook.ConvertUnits(FWorksheet.GetColWidth(i, suChars), FWorkbook.Units, suPoints)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Row height (to be considered in first column)
|
// Row height (to be considered in first column)
|
||||||
if j = 0 then
|
if j = 0 then
|
||||||
lRowHeightStr := Format(' height="%.0fpt"', [
|
lRowHeightStr := Format(' height="%.0fpt"', [
|
||||||
FWorkbook.ConvertUnits(FWorksheet.GetRowHeight(j), FWorkbook.Units, suPoints)
|
FWorkbook.ConvertUnits(FWorksheet.GetRowHeight(j, suLines), FWorkbook.Units, suPoints)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Font
|
// Font
|
||||||
|
@ -328,7 +328,7 @@ var
|
|||||||
begin
|
begin
|
||||||
ReadRowColXF(AStream, ARow, ACol, XF);
|
ReadRowColXF(AStream, ARow, ACol, XF);
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -358,7 +358,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(r, c, FVirtualCell);
|
InitCell(FWorksheet, r, c, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(r, c);
|
cell := FWorksheet.AddCell(r, c);
|
||||||
@ -687,7 +687,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -782,7 +782,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -817,7 +817,7 @@ begin
|
|||||||
|
|
||||||
{Create cell}
|
{Create cell}
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -856,7 +856,7 @@ begin
|
|||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
|
@ -657,7 +657,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -1095,7 +1095,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
|
@ -1051,7 +1051,7 @@ begin
|
|||||||
|
|
||||||
{ Save the data }
|
{ Save the data }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell); // "virtual" cell
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell); // "virtual" cell
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
||||||
@ -1293,7 +1293,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell); // "virtual" cell
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell); // "virtual" cell
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
||||||
@ -1443,7 +1443,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
|
@ -1324,7 +1324,7 @@ begin
|
|||||||
XF := WordLEToN(rec.XFIndex);
|
XF := WordLEToN(rec.XFIndex);
|
||||||
|
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -1359,7 +1359,7 @@ begin
|
|||||||
XF := WordLEToN(rec.XFIndex);
|
XF := WordLEToN(rec.XFIndex);
|
||||||
|
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(r, c, FVirtualCell);
|
InitCell(FWorksheet, r, c, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(r, c);
|
cell := FWorksheet.AddCell(r, c);
|
||||||
@ -1661,7 +1661,7 @@ begin
|
|||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then // "Virtual" cell
|
if FIsVirtualMode then // "Virtual" cell
|
||||||
begin
|
begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.GetCell(ARow, ACol); // "Real" cell
|
cell := FWorksheet.GetCell(ARow, ACol); // "Real" cell
|
||||||
@ -1788,7 +1788,7 @@ begin
|
|||||||
fc := WordLEtoN(AStream.ReadWord);
|
fc := WordLEtoN(AStream.ReadWord);
|
||||||
pending := RecordSize - SizeOf(fc) - SizeOf(ARow);
|
pending := RecordSize - SizeOf(fc) - SizeOf(ARow);
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, 0, FVirtualCell);
|
InitCell(FWorksheet, ARow, 0, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end;
|
end;
|
||||||
while pending > SizeOf(XF) do begin
|
while pending > SizeOf(XF) do begin
|
||||||
@ -1832,7 +1832,7 @@ begin
|
|||||||
fc := WordLEtoN(AStream.ReadWord);
|
fc := WordLEtoN(AStream.ReadWord);
|
||||||
pending := RecordSize - SizeOf(fc) - SizeOf(ARow);
|
pending := RecordSize - SizeOf(fc) - SizeOf(ARow);
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, fc, FVirtualCell);
|
InitCell(FWorksheet, ARow, fc, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end;
|
end;
|
||||||
while pending > SizeOf(XF) + SizeOf(RK) do begin
|
while pending > SizeOf(XF) + SizeOf(RK) do begin
|
||||||
@ -1894,7 +1894,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell }
|
{ Create cell }
|
||||||
if FIsVirtualMode then begin // "virtual" cell
|
if FIsVirtualMode then begin // "virtual" cell
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
cell := FWorksheet.AddCell(ARow, ACol); // "real" cell
|
||||||
@ -2185,7 +2185,7 @@ begin
|
|||||||
|
|
||||||
{Create cell}
|
{Create cell}
|
||||||
if FIsVirtualMode then begin
|
if FIsVirtualMode then begin
|
||||||
InitCell(ARow, ACol, FVirtualCell);
|
InitCell(FWorksheet, ARow, ACol, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.AddCell(ARow, ACol);
|
cell := FWorksheet.AddCell(ARow, ACol);
|
||||||
@ -2855,7 +2855,7 @@ begin
|
|||||||
|
|
||||||
{ Create cell - this is the "base" of the shared formula }
|
{ Create cell - this is the "base" of the shared formula }
|
||||||
if FIsVirtualMode then begin // "Virtual" cell
|
if FIsVirtualMode then begin // "Virtual" cell
|
||||||
InitCell(r1, c1, FVirtualCell);
|
InitCell(FWorksheet, r1, c1, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := FWorksheet.GetCell(r1, c1); // "Real" cell
|
cell := FWorksheet.GetCell(r1, c1); // "Real" cell
|
||||||
@ -4918,6 +4918,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
lCell.Row := r; // to silence a compiler hint...
|
lCell.Row := r; // to silence a compiler hint...
|
||||||
InitCell(lCell);
|
InitCell(lCell);
|
||||||
|
lCell.Worksheet := ASheet;
|
||||||
value := varNull;
|
value := varNull;
|
||||||
styleCell := nil;
|
styleCell := nil;
|
||||||
ASheet.OnWriteCellData(ASheet, r, c, value, styleCell);
|
ASheet.OnWriteCellData(ASheet, r, c, value, styleCell);
|
||||||
|
@ -638,7 +638,7 @@ begin
|
|||||||
// create cell
|
// create cell
|
||||||
if FIsVirtualMode then
|
if FIsVirtualMode then
|
||||||
begin
|
begin
|
||||||
InitCell(rowIndex, colIndex, FVirtualCell);
|
InitCell(FWorksheet, rowIndex, colIndex, FVirtualCell);
|
||||||
cell := @FVirtualCell;
|
cell := @FVirtualCell;
|
||||||
end else
|
end else
|
||||||
cell := AWorksheet.AddCell(rowIndex, colIndex);
|
cell := AWorksheet.AddCell(rowIndex, colIndex);
|
||||||
@ -706,7 +706,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
sharedformulabase := TSharedFormulaData(FSharedFormulaBaseList[StrToInt(s)]);
|
sharedformulabase := TSharedFormulaData(FSharedFormulaBaseList[StrToInt(s)]);
|
||||||
// ... and copy shared formula to destination cell
|
// ... and copy shared formula to destination cell
|
||||||
InitCell(sharedformulabase.Row, sharedformulabase.Col, lCell);
|
InitCell(FWorksheet, sharedformulabase.Row, sharedformulabase.Col, lCell);
|
||||||
lCell.Formulavalue := sharedformulabase.Formula;
|
lCell.Formulavalue := sharedformulabase.Formula;
|
||||||
lCell.Worksheet := sharedformulabase.Worksheet;
|
lCell.Worksheet := sharedformulabase.Worksheet;
|
||||||
FWorksheet.CopyFormula(@lCell, cell);
|
FWorksheet.CopyFormula(@lCell, cell);
|
||||||
|
@ -9,7 +9,7 @@ unit fpsexportreg;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LazarusPackageIntf, lresources, fpdataexporter;
|
Classes, SysUtils, LazarusPackageIntf, lresources;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ var
|
|||||||
cell: PCell;
|
cell: PCell;
|
||||||
begin
|
begin
|
||||||
New(cell);
|
New(cell);
|
||||||
InitCell(ARow, ACol, cell^);
|
InitCell(nil, ARow, ACol, cell^);
|
||||||
Result := inherited Add(cell);
|
Result := inherited Add(cell);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2131,7 +2131,6 @@ end;
|
|||||||
|
|
||||||
procedure TsCustomWorksheetGrid.DragDrop(Source: TObject; X, Y: Integer);
|
procedure TsCustomWorksheetGrid.DragDrop(Source: TObject; X, Y: Integer);
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
|
||||||
sel: TsCellRange;
|
sel: TsCellRange;
|
||||||
srccell, destcell: PCell;
|
srccell, destcell: PCell;
|
||||||
r: LongInt = 0;
|
r: LongInt = 0;
|
||||||
@ -2178,7 +2177,8 @@ procedure TsCustomWorksheetGrid.DragOver(ASource: TObject; X, Y: Integer;
|
|||||||
var
|
var
|
||||||
destcell: PCell;
|
destcell: PCell;
|
||||||
sc, sr: Integer;
|
sc, sr: Integer;
|
||||||
gc, gr: Integer;
|
gc: Integer = 0;
|
||||||
|
gr: Integer = 0;
|
||||||
dc, dr: Integer;
|
dc, dr: Integer;
|
||||||
sel: TsCellRange;
|
sel: TsCellRange;
|
||||||
dragMove: Boolean;
|
dragMove: Boolean;
|
||||||
@ -3014,7 +3014,6 @@ var
|
|||||||
r1,c1,r2,c2: Cardinal;
|
r1,c1,r2,c2: Cardinal;
|
||||||
delta: Integer;
|
delta: Integer;
|
||||||
savedPenMode: TPenMode;
|
savedPenMode: TPenMode;
|
||||||
penwidth: Integer;
|
|
||||||
P: array[0..9] of TPoint;
|
P: array[0..9] of TPoint;
|
||||||
begin
|
begin
|
||||||
if Worksheet = nil then
|
if Worksheet = nil then
|
||||||
|
Reference in New Issue
Block a user