You've already forked lazarus-ccr
fpspreadsheet: Greatly reduce hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3632 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -23,7 +23,6 @@ const
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
MyWorksheet: TsWorksheet;
|
||||
MyRPNFormula: TsRPNFormula;
|
||||
MyDir: string;
|
||||
number: Double;
|
||||
lCell: PCell;
|
||||
|
@ -63,7 +63,7 @@ object Form1: TForm1
|
||||
TabOrder = 1
|
||||
TitleStyle = tsNative
|
||||
ColWidths = (
|
||||
42
|
||||
56
|
||||
64
|
||||
64
|
||||
64
|
||||
@ -104,19 +104,19 @@ object Form1: TForm1
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Height = 15
|
||||
Height = 20
|
||||
Top = 9
|
||||
Width = 37
|
||||
Width = 46
|
||||
Caption = 'Sheets:'
|
||||
ParentColor = False
|
||||
end
|
||||
object SheetsCombo: TComboBox
|
||||
Left = 72
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 4
|
||||
Width = 808
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ItemHeight = 15
|
||||
ItemHeight = 20
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Sheet 1'
|
||||
|
@ -7,7 +7,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, Menus, ExtCtrls, ActnList, Spin, Buttons,
|
||||
ButtonPanel, fpspreadsheetgrid, fpspreadsheet, fpsallformats;
|
||||
ButtonPanel, fpspreadsheetgrid, fpspreadsheet, {%H-}fpsallformats;
|
||||
|
||||
type
|
||||
|
||||
|
@ -51,13 +51,10 @@
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LazUtils"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
|
@ -7,7 +7,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
ComCtrls, StdCtrls, Grids,
|
||||
fpSpreadsheet, fpspreadsheetgrid, fpsallformats;
|
||||
fpSpreadsheet, fpspreadsheetgrid, {%H-}fpsallformats;
|
||||
|
||||
type
|
||||
|
||||
|
@ -88,7 +88,7 @@ object Form1: TForm1
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 66
|
||||
ClientHeight = 63
|
||||
ClientWidth = 156
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
@ -113,7 +113,7 @@ object Form1: TForm1
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 115
|
||||
ClientHeight = 112
|
||||
ClientWidth = 156
|
||||
Items.Strings = (
|
||||
'ods'
|
||||
@ -142,7 +142,7 @@ object Form1: TForm1
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 155
|
||||
ClientHeight = 152
|
||||
ClientWidth = 156
|
||||
Items.Strings = (
|
||||
'10k'
|
||||
|
@ -60,7 +60,7 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
LclIntf, StrUtils;
|
||||
LclIntf, StrUtils, fpsUtils;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
@ -92,6 +92,7 @@ const
|
||||
procedure TForm1.ReadCellDataHandler(Sender: TObject; ARow, ACol: Cardinal;
|
||||
const ADataCell: PCell);
|
||||
begin
|
||||
Unused(ACol, ADataCell);
|
||||
// nothing to do here. Just do a progress display
|
||||
if ARow mod 1000 = 0 then
|
||||
StatusMsg(Format('Virtual mode reading %s: Row %d...', [GetFileFormatName(FCurFormat), ARow]));
|
||||
@ -102,6 +103,7 @@ procedure TForm1.WriteCellStringHandler(Sender: TObject; ARow, ACol: cardinal;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
Unused(AStyleCell);
|
||||
S := 'Xy' + IntToStr(ARow) + 'x' + IntToStr(ACol);
|
||||
AValue := S;
|
||||
if ARow mod 1000 = 0 then
|
||||
@ -111,6 +113,7 @@ end;
|
||||
procedure TForm1.WriteCellNumberHandler(Sender: TObject; ARow, ACol: cardinal;
|
||||
var AValue: variant; var AStyleCell: PCell);
|
||||
begin
|
||||
UnUsed(AStyleCell);
|
||||
AValue := ARow * 1E5 + ACol;
|
||||
if ARow mod 1000 = 0 then
|
||||
StatusMsg(Format('Virtual mode writing %s: Row %d...', [GetFileFormatName(FCurFormat), ARow]));
|
||||
@ -129,13 +132,14 @@ procedure TForm1.RunReadTest(Idx: Integer; Log: String;
|
||||
Options: TsWorkbookOptions);
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
MyWorksheet: TsWorksheet;
|
||||
Tm: DWord;
|
||||
fName, s: String;
|
||||
i, j: Integer;
|
||||
F: File;
|
||||
ok: Boolean;
|
||||
begin
|
||||
Unused(idx);
|
||||
|
||||
s := Trim(Log);
|
||||
Log := Log + ' ';
|
||||
try
|
||||
@ -324,10 +328,9 @@ end;
|
||||
|
||||
procedure TForm1.BtnReadClick(Sender: TObject);
|
||||
var
|
||||
i, j, k, len: Integer;
|
||||
s, fname: String;
|
||||
i, len: Integer;
|
||||
s: String;
|
||||
rows: Integer;
|
||||
ext: String;
|
||||
begin
|
||||
WriteToIni;
|
||||
|
||||
|
@ -35,16 +35,11 @@
|
||||
<PackageName Value="LazUtils"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="ooxmlread.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="..\..\fpsxmlcommon.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="fpsxmlcommon"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -10,7 +10,7 @@ program ooxmlread;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsxooxml, fpsxmlcommon; //fpsallformats;
|
||||
Classes, SysUtils, fpspreadsheet, xlsxooxml; //fpsallformats;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -17,7 +17,6 @@ var
|
||||
MyWorksheet: TsWorksheet;
|
||||
MyDir: string;
|
||||
i: Integer;
|
||||
a: TStringList;
|
||||
MyCell: PCell;
|
||||
|
||||
begin
|
||||
|
@ -4,7 +4,7 @@ object MainFrm: TMainFrm
|
||||
Top = 258
|
||||
Width = 884
|
||||
Caption = 'spready'
|
||||
ClientHeight = 619
|
||||
ClientHeight = 614
|
||||
ClientWidth = 884
|
||||
Menu = MainMenu
|
||||
OnActivate = FormActivate
|
||||
@ -14,7 +14,7 @@ object MainFrm: TMainFrm
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 82
|
||||
Top = 537
|
||||
Top = 532
|
||||
Width = 884
|
||||
Align = alBottom
|
||||
BevelOuter = bvNone
|
||||
@ -23,7 +23,7 @@ object MainFrm: TMainFrm
|
||||
TabOrder = 6
|
||||
object EdFrozenCols: TSpinEdit
|
||||
Left = 429
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 52
|
||||
OnChange = EdFrozenColsChange
|
||||
@ -31,7 +31,7 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object EdFrozenRows: TSpinEdit
|
||||
Left = 429
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 39
|
||||
Width = 52
|
||||
OnChange = EdFrozenRowsChange
|
||||
@ -39,37 +39,37 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 344
|
||||
Height = 15
|
||||
Height = 20
|
||||
Top = 13
|
||||
Width = 62
|
||||
Width = 77
|
||||
Caption = 'Frozen cols:'
|
||||
FocusControl = EdFrozenCols
|
||||
ParentColor = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 344
|
||||
Height = 15
|
||||
Height = 20
|
||||
Top = 40
|
||||
Width = 66
|
||||
Width = 82
|
||||
Caption = 'Frozen rows:'
|
||||
FocusControl = EdFrozenRows
|
||||
ParentColor = False
|
||||
end
|
||||
object CbReadFormulas: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Height = 24
|
||||
Top = 8
|
||||
Width = 96
|
||||
Width = 120
|
||||
Caption = 'Read formulas'
|
||||
OnChange = CbReadFormulasChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object CbHeaderStyle: TComboBox
|
||||
Left = 200
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 116
|
||||
ItemHeight = 15
|
||||
ItemHeight = 20
|
||||
ItemIndex = 2
|
||||
Items.Strings = (
|
||||
'Lazarus'
|
||||
@ -83,18 +83,18 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object CbAutoCalcFormulas: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Height = 24
|
||||
Top = 32
|
||||
Width = 128
|
||||
Width = 158
|
||||
Caption = 'Calculate on change'
|
||||
OnChange = CbAutoCalcFormulasChange
|
||||
TabOrder = 1
|
||||
end
|
||||
object CbTextOverflow: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Height = 24
|
||||
Top = 56
|
||||
Width = 91
|
||||
Width = 114
|
||||
Caption = 'Text overflow'
|
||||
Checked = True
|
||||
OnChange = CbTextOverflowChange
|
||||
@ -206,19 +206,19 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object FontComboBox: TComboBox
|
||||
Left = 52
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 2
|
||||
Width = 127
|
||||
ItemHeight = 15
|
||||
ItemHeight = 20
|
||||
OnSelect = FontComboBoxSelect
|
||||
TabOrder = 0
|
||||
end
|
||||
object FontSizeComboBox: TComboBox
|
||||
Left = 179
|
||||
Height = 23
|
||||
Height = 28
|
||||
Top = 2
|
||||
Width = 48
|
||||
ItemHeight = 15
|
||||
ItemHeight = 20
|
||||
Items.Strings = (
|
||||
'8'
|
||||
'9'
|
||||
@ -392,7 +392,7 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object InspectorSplitter: TSplitter
|
||||
Left = 648
|
||||
Height = 458
|
||||
Height = 453
|
||||
Top = 79
|
||||
Width = 5
|
||||
Align = alRight
|
||||
@ -400,7 +400,7 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object InspectorPageControl: TPageControl
|
||||
Left = 653
|
||||
Height = 458
|
||||
Height = 453
|
||||
Top = 79
|
||||
Width = 231
|
||||
ActivePage = PgCellValue
|
||||
@ -410,11 +410,11 @@ object MainFrm: TMainFrm
|
||||
OnChange = InspectorPageControlChange
|
||||
object PgCellValue: TTabSheet
|
||||
Caption = 'Cell value'
|
||||
ClientHeight = 430
|
||||
ClientHeight = 420
|
||||
ClientWidth = 223
|
||||
object CellInspector: TValueListEditor
|
||||
Left = 0
|
||||
Height = 430
|
||||
Height = 420
|
||||
Top = 0
|
||||
Width = 223
|
||||
Align = alClient
|
||||
@ -458,7 +458,7 @@ object MainFrm: TMainFrm
|
||||
end
|
||||
object TabControl: TTabControl
|
||||
Left = 0
|
||||
Height = 458
|
||||
Height = 453
|
||||
Top = 79
|
||||
Width = 648
|
||||
OnChange = TabControlChange
|
||||
@ -466,7 +466,7 @@ object MainFrm: TMainFrm
|
||||
TabOrder = 3
|
||||
object WorksheetGrid: TsWorksheetGrid
|
||||
Left = 2
|
||||
Height = 453
|
||||
Height = 448
|
||||
Top = 3
|
||||
Width = 644
|
||||
FrozenCols = 0
|
||||
@ -484,7 +484,7 @@ object MainFrm: TMainFrm
|
||||
OnHeaderClick = WorksheetGridHeaderClick
|
||||
OnSelection = WorksheetGridSelection
|
||||
ColWidths = (
|
||||
42
|
||||
56
|
||||
64
|
||||
64
|
||||
64
|
||||
|
@ -8,7 +8,7 @@ uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, Menus, ExtCtrls, ComCtrls, ActnList, Spin, Grids,
|
||||
ColorBox, ValEdit,
|
||||
fpspreadsheetgrid, fpspreadsheet, fpsallformats;
|
||||
fpspreadsheetgrid, fpspreadsheet, {%H-}fpsallformats;
|
||||
|
||||
type
|
||||
|
||||
@ -330,8 +330,8 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
StrUtils, TypInfo, LCLIntf, LCLType,
|
||||
fpcanvas, fpsutils, fpsnumformatparser;
|
||||
TypInfo, LCLIntf, LCLType,
|
||||
fpcanvas, fpsutils;
|
||||
|
||||
const
|
||||
DROPDOWN_COUNT = 24;
|
||||
@ -888,8 +888,6 @@ end;
|
||||
procedure TMainFrm.LoadFile(const AFileName: String);
|
||||
// Loads first worksheet from file into grid
|
||||
var
|
||||
pages: TStrings;
|
||||
i: Integer;
|
||||
err: String;
|
||||
begin
|
||||
// Load file
|
||||
@ -951,6 +949,8 @@ end;
|
||||
procedure TMainFrm.WorksheetGridHeaderClick(Sender: TObject; IsColumn: Boolean;
|
||||
Index: Integer);
|
||||
begin
|
||||
Unused(Sender);
|
||||
Unused(IsColumn, Index);
|
||||
//ShowMessage('Header click');
|
||||
end;
|
||||
|
||||
@ -982,7 +982,6 @@ end;
|
||||
|
||||
procedure TMainFrm.UpdateCellInfo(ACell: PCell);
|
||||
var
|
||||
i: Integer;
|
||||
s: String;
|
||||
cb: TsCellBorder;
|
||||
r1,r2,c1,c2: Cardinal;
|
||||
|
@ -9,7 +9,7 @@ uses
|
||||
StdCtrls, Menus, ExtCtrls, ComCtrls, ActnList, Grids, ColorBox,
|
||||
SynEdit, SynEditHighlighter,
|
||||
SynHighlighterHTML, SynHighlighterMulti, SynHighlighterCss,
|
||||
fpspreadsheetgrid, fpspreadsheet, fpsallformats;
|
||||
fpspreadsheetgrid, fpspreadsheet, {%H-}fpsallformats;
|
||||
|
||||
type
|
||||
|
||||
@ -661,8 +661,6 @@ end;
|
||||
procedure TMainFrm.LoadFile(const AFileName: String);
|
||||
// Loads first worksheet from file into grid
|
||||
var
|
||||
pages: TStrings;
|
||||
i: Integer;
|
||||
err: String;
|
||||
begin
|
||||
// Load file
|
||||
|
@ -1254,7 +1254,7 @@ procedure fpsCELL(var Result: TsExpressionResult; const Args: TsExprParameterArr
|
||||
}
|
||||
var
|
||||
stype: String;
|
||||
r1,r2, c1,c2: Cardinal;
|
||||
r1, c1: Cardinal;
|
||||
cell: PCell;
|
||||
begin
|
||||
if Length(Args)=1 then
|
||||
@ -1273,15 +1273,11 @@ begin
|
||||
cell := ArgToCell(Args[1]);
|
||||
r1 := Args[1].ResRow;
|
||||
c1 := Args[1].ResCol;
|
||||
r2 := r1;
|
||||
c2 := c1;
|
||||
end;
|
||||
rtCellRange:
|
||||
begin
|
||||
r1 := Args[1].ResCellRange.Row1;
|
||||
r2 := Args[1].ResCellRange.Row2;
|
||||
c1 := Args[1].ResCellRange.Col1;
|
||||
c2 := Args[1].ResCellRange.Col2;
|
||||
cell := Args[1].Worksheet.FindCell(r1, c1);
|
||||
end;
|
||||
else
|
||||
|
@ -1777,7 +1777,7 @@ var
|
||||
formula: TsRPNFormula;
|
||||
i: Integer;
|
||||
begin
|
||||
col := LongInt(PtrInt(arg));
|
||||
col := LongInt({%H-}PtrInt(arg));
|
||||
cell := PCell(data);
|
||||
if cell = nil then // This should not happen. Just to make sure...
|
||||
exit;
|
||||
@ -1832,7 +1832,7 @@ var
|
||||
formula: TsRPNFormula;
|
||||
i: Integer;
|
||||
begin
|
||||
row := LongInt(PtrInt(arg));
|
||||
row := LongInt({%H-}PtrInt(arg));
|
||||
cell := PCell(data);
|
||||
if cell = nil then // This should not happen. Just to make sure...
|
||||
exit;
|
||||
@ -5070,7 +5070,7 @@ begin
|
||||
// Update column index of cell records
|
||||
cellnode := FCells.FindLowest;
|
||||
while Assigned(cellnode) do begin
|
||||
DeleteColCallback(cellnode.Data, pointer(PtrInt(ACol)));
|
||||
DeleteColCallback(cellnode.Data, {%H-}pointer(PtrInt(ACol)));
|
||||
cellnode := FCells.FindSuccessor(cellnode);
|
||||
end;
|
||||
|
||||
@ -5159,7 +5159,7 @@ begin
|
||||
// Update row index of cell reocrds
|
||||
cellnode := FCells.FindLowest;
|
||||
while Assigned(cellnode) do begin
|
||||
DeleteRowCallback(cellnode.Data, pointer(PtrInt(ARow)));
|
||||
DeleteRowCallback(cellnode.Data, {%H-}pointer(PtrInt(ARow)));
|
||||
cellnode := FCells.FindSuccessor(cellnode);
|
||||
end;
|
||||
|
||||
@ -5208,7 +5208,7 @@ begin
|
||||
// Update column index of cell records
|
||||
cellnode := FCells.FindLowest;
|
||||
while Assigned(cellnode) do begin
|
||||
InsertColCallback(cellnode.Data, pointer(PtrInt(ACol)));
|
||||
InsertColCallback(cellnode.Data, {%H-}pointer(PtrInt(ACol)));
|
||||
cellnode := FCells.FindSuccessor(cellnode);
|
||||
end;
|
||||
|
||||
@ -5260,7 +5260,7 @@ var
|
||||
formula: TsRPNFormula;
|
||||
i: Integer;
|
||||
begin
|
||||
col := LongInt(PtrInt(arg));
|
||||
col := LongInt({%H-}PtrInt(arg));
|
||||
cell := PCell(data);
|
||||
if cell = nil then // This should not happen. Just to make sure...
|
||||
exit;
|
||||
@ -5319,7 +5319,7 @@ begin
|
||||
// Update row index of cell records
|
||||
cellnode := FCells.FindLowest;
|
||||
while Assigned(cellnode) do begin
|
||||
InsertRowCallback(cellnode.Data, pointer(PtrInt(ARow)));
|
||||
InsertRowCallback(cellnode.Data, {%H-}pointer(PtrInt(ARow)));
|
||||
cellnode := FCells.FindSuccessor(cellnode);
|
||||
end;
|
||||
|
||||
@ -5369,7 +5369,7 @@ var
|
||||
i: Integer;
|
||||
formula: TsRPNFormula;
|
||||
begin
|
||||
row := LongInt(PtrInt(arg));
|
||||
row := LongInt({%H-}PtrInt(arg));
|
||||
cell := PCell(data);
|
||||
|
||||
// Update row index of moved cells
|
||||
|
@ -152,24 +152,24 @@ begin
|
||||
// First calculate the cell position
|
||||
if XSelectionDirection = fpsVerticalSelection then
|
||||
begin
|
||||
XRow := FXFirstCellRow + AIndex;
|
||||
XRow := Integer(FXFirstCellRow) + AIndex;
|
||||
XCol := FXFirstCellCol;
|
||||
end
|
||||
else
|
||||
begin
|
||||
XRow := FXFirstCellRow;
|
||||
XCol := FXFirstCellCol + AIndex;
|
||||
XCol := Integer(FXFirstCellCol) + AIndex;
|
||||
end;
|
||||
|
||||
if YSelectionDirection = fpsVerticalSelection then
|
||||
begin
|
||||
YRow := FYFirstCellRow + AIndex;
|
||||
YRow := Integer(FYFirstCellRow) + AIndex;
|
||||
YCol := FYFirstCellCol;
|
||||
end
|
||||
else
|
||||
begin
|
||||
YRow := FYFirstCellRow;
|
||||
YCol := FYFirstCellCol + AIndex;
|
||||
YCol := Integer(FYFirstCellCol) + AIndex;
|
||||
end;
|
||||
|
||||
// Check the corresponding cell, if it is empty, use zero
|
||||
|
@ -184,10 +184,10 @@ type
|
||||
procedure EditingDone; override;
|
||||
procedure EndUpdate;
|
||||
procedure GetSheets(const ASheets: TStrings);
|
||||
function GetGridCol(ASheetCol: Cardinal): Integer;
|
||||
function GetGridRow(ASheetRow: Cardinal): Integer;
|
||||
function GetWorksheetCol(AGridCol: Integer): Cardinal;
|
||||
function GetWorksheetRow(AGridRow: Integer): Cardinal;
|
||||
function GetGridCol(ASheetCol: Cardinal): Integer; inline;
|
||||
function GetGridRow(ASheetRow: Cardinal): Integer; inline;
|
||||
function GetWorksheetCol(AGridCol: Integer): Cardinal; inline;
|
||||
function GetWorksheetRow(AGridRow: Integer): Cardinal; inline;
|
||||
procedure InsertCol(AGridCol: Integer);
|
||||
procedure InsertRow(AGridRow: Integer);
|
||||
procedure LoadFromSpreadsheetFile(AFileName: string;
|
||||
@ -619,7 +619,7 @@ end;
|
||||
function WrapText(ACanvas: TCanvas; const AText: string; AMaxWidth: integer): string;
|
||||
var
|
||||
DC: HDC;
|
||||
textExtent: TSize;
|
||||
textExtent: TSize = (cx:0; cy:0);
|
||||
S, P, E: PChar;
|
||||
line: string;
|
||||
isFirstLine: boolean;
|
||||
@ -1007,6 +1007,7 @@ procedure TsCustomWorksheetGrid.ChangedFontHandler(ASender: TObject;
|
||||
ARow, ACol: Cardinal);
|
||||
var
|
||||
lRow: PRow;
|
||||
gr: Integer; // row index in grid units
|
||||
begin
|
||||
Unused(ASender, ACol);
|
||||
if (FWorksheet <> nil) then begin
|
||||
@ -1014,8 +1015,8 @@ begin
|
||||
if lRow = nil then begin
|
||||
// There is no row record --> row height changes according to font height
|
||||
// Otherwise the row height would be fixed according to the value in the row record.
|
||||
ARow := ARow + FHeaderCount; // convert row index to grid units
|
||||
RowHeights[ARow] := CalcAutoRowHeight(ARow);
|
||||
gr := GetGridRow(ARow); // convert row index to grid units
|
||||
RowHeights[gr] := CalcAutoRowHeight(gr);
|
||||
end;
|
||||
Invalidate;
|
||||
end;
|
||||
@ -1337,8 +1338,8 @@ begin
|
||||
begin
|
||||
if (uffBorder in cell^.UsedFormattingFields) then
|
||||
begin
|
||||
c := cell^.Col + FHeaderCount;
|
||||
r := cell^.Row + FHeaderCount;
|
||||
c := GetGridCol(cell^.Col);
|
||||
r := GetGridRow(cell^.Row);
|
||||
rect := CellRect(c, r);
|
||||
DrawCellBorders(c, r, rect);
|
||||
end;
|
||||
@ -1560,7 +1561,7 @@ var
|
||||
rct, saved_rct, temp_rct: TRect;
|
||||
clipArea: Trect;
|
||||
cell: PCell;
|
||||
tmp: Integer;
|
||||
tmp: Integer = 0;
|
||||
|
||||
function IsPushCellActive: boolean;
|
||||
begin
|
||||
@ -1734,7 +1735,7 @@ begin
|
||||
FWorksheet.FindMergedRange(FDrawingCell, sr1, sc1, sr2, sc2);
|
||||
gr := GetGridRow(sr1);
|
||||
ColRowToOffSet(False, True, gr, rct.Top, tmp);
|
||||
ColRowToOffSet(False, True, gr + sr2 - sr1, tmp, rct.Bottom);
|
||||
ColRowToOffSet(False, True, gr + integer(sr2) - integer(sr1), tmp, rct.Bottom);
|
||||
gc := GetGridCol(sc1);
|
||||
gcNext := gc + (sc2 - sc1) + 1;
|
||||
end;
|
||||
@ -2656,7 +2657,7 @@ begin
|
||||
if AGridCol < FHeaderCount then
|
||||
exit;
|
||||
|
||||
if FWorksheet.GetLastColIndex + 1 + FHeaderCount >= FInitColCount then
|
||||
if LongInt(FWorksheet.GetLastColIndex) + 1 + FHeaderCount >= FInitColCount then
|
||||
ColCount := ColCount + 1;
|
||||
c := AGridCol - FHeaderCount;
|
||||
FWorksheet.InsertCol(c);
|
||||
@ -2674,7 +2675,7 @@ begin
|
||||
if AGridRow < FHeaderCount then
|
||||
exit;
|
||||
|
||||
if FWorksheet.GetlastRowIndex+1 + FHeaderCount >= FInitRowCount then
|
||||
if LongInt(FWorksheet.GetlastRowIndex) + 1 + FHeaderCount >= FInitRowCount then
|
||||
RowCount := RowCount + 1;
|
||||
r := AGridRow - FHeaderCount;
|
||||
FWorksheet.InsertRow(r);
|
||||
@ -2720,7 +2721,8 @@ var
|
||||
i: Integer;
|
||||
L: TStrings;
|
||||
wrapped: Boolean;
|
||||
pLeft, pRight: Integer;
|
||||
pLeft: Integer = 0;
|
||||
pRight: Integer = 0;
|
||||
begin
|
||||
wrapped := ATextWrap or (ATextRot = rtStacked);
|
||||
if AMeasureText = '' then txt := AText else txt := AMeasureText;
|
||||
@ -2794,7 +2796,7 @@ begin
|
||||
begin
|
||||
// Special treatment for overflowing cells: they must be centered
|
||||
// at their original column, not in the total enclosing rectangle.
|
||||
ColRowToOffset(true, true, FDrawingCell^.Col + FHeaderCount, pLeft, pRight);
|
||||
ColRowToOffset(true, true, integer(FDrawingCell^.Col) + FHeaderCount, pLeft, pRight);
|
||||
P.X := (pLeft + pRight - w) div 2;
|
||||
P.y := ARect.Top;
|
||||
ts.Alignment := taLeftJustify;
|
||||
@ -3148,8 +3150,8 @@ begin
|
||||
end else
|
||||
if FWorksheet <> nil then begin
|
||||
Convert_sFont_to_Font(FWorkbook.GetDefaultFont, Font);
|
||||
ColCount := Max(FWorksheet.GetLastColIndex + 1 + FHeaderCount, FInitColCount);
|
||||
RowCount := Max(FWorksheet.GetLastRowIndex + 1 + FHeaderCount, FInitRowCount);
|
||||
ColCount := Max(integer(FWorksheet.GetLastColIndex) + 1 + FHeaderCount, FInitColCount);
|
||||
RowCount := Max(integer(FWorksheet.GetLastRowIndex) + 1 + FHeaderCount, FInitRowCount);
|
||||
FixedCols := FFrozenCols + FHeaderCount;
|
||||
FixedRows := FFrozenRows + FHeaderCount;
|
||||
if ShowHeaders then begin
|
||||
|
@ -148,6 +148,7 @@ procedure AppendToStream(AStream: TStream; const AString1, AString2, AString3: S
|
||||
|
||||
function PosInMemory(AMagic: QWord; ABuffer: PByteArray; ABufSize: Integer): Integer;
|
||||
|
||||
{ For silencing the compiler... }
|
||||
procedure Unused(const A1);
|
||||
procedure Unused(const A1, A2);
|
||||
procedure Unused(const A1, A2, A3);
|
||||
@ -2166,11 +2167,11 @@ begin
|
||||
// set up magic numbers
|
||||
if L < 128
|
||||
then begin
|
||||
n2 := L + Integer(L * S) div 255;
|
||||
n2 := Integer(L) + Integer(L) * S div 255;
|
||||
n1 := 2 * L - n2;
|
||||
end
|
||||
else begin
|
||||
n2 := S + L - Integer(L * S) div 255;
|
||||
n2 := Integer(S) + L - Integer(L) * S div 255;
|
||||
n1 := 2 * L - n2 - 1;
|
||||
end;
|
||||
|
||||
|
@ -336,7 +336,8 @@ Type
|
||||
Protected
|
||||
Procedure CloseInput(Item : TZipFileEntry);
|
||||
Procedure StartZipFile(Item : TZipFileEntry);
|
||||
Function UpdateZipHeader(Item : TZipFileEntry; FZip : TStream; ACRC : LongWord;AMethod : Word) : Boolean;
|
||||
Function UpdateZipHeader(Item : TZipFileEntry; FZip : TStream;
|
||||
ACRC : LongWord;AMethod : Word) : Boolean;
|
||||
Procedure BuildZipDirectory;
|
||||
Procedure DoEndOfFile;
|
||||
Procedure ZipOneFile(Item : TZipFileEntry); virtual;
|
||||
@ -344,7 +345,8 @@ Type
|
||||
Procedure GetFileInfo;
|
||||
Procedure SetBufSize(Value : LongWord);
|
||||
Procedure SetFileName(Value : String);
|
||||
Function CreateCompressor(Item : TZipFileEntry; AinFile,AZipStream : TStream) : TCompressor; virtual;
|
||||
Function CreateCompressor({%H-}Item : TZipFileEntry;
|
||||
AinFile,AZipStream : TStream) : TCompressor; virtual;
|
||||
Public
|
||||
Constructor Create;
|
||||
Destructor Destroy;override;
|
||||
@ -430,7 +432,7 @@ Type
|
||||
Procedure SetBufSize(Value : LongWord);
|
||||
Procedure SetFileName(Value : String);
|
||||
Procedure SetOutputPath(Value:String);
|
||||
Function CreateDeCompressor(Item : TZipFileEntry; AMethod : Word;AZipFile,AOutFile : TStream) : TDeCompressor; virtual;
|
||||
Function CreateDeCompressor({%H-}Item : TZipFileEntry; AMethod : Word;AZipFile,AOutFile : TStream) : TDeCompressor; virtual;
|
||||
Public
|
||||
Constructor Create;
|
||||
Destructor Destroy;override;
|
||||
@ -649,7 +651,8 @@ end;
|
||||
Procedure TDeCompressor.UpdC32(Octet: Byte);
|
||||
|
||||
Begin
|
||||
FCrc32Val := Crc_32_Tab[Byte(FCrc32Val XOR LongInt(Octet))] XOR ((FCrc32Val SHR 8) AND $00FFFFFF);
|
||||
FCrc32Val := Crc_32_Tab[Byte(FCrc32Val XOR LongWord(Octet))] XOR
|
||||
((FCrc32Val SHR 8) AND $00FFFFFF);
|
||||
end;
|
||||
|
||||
constructor TDeCompressor.Create(AInFile, AOutFile: TStream; ABufSize: LongWord);
|
||||
@ -669,7 +672,8 @@ end;
|
||||
Procedure TCompressor.UpdC32(Octet: Byte);
|
||||
|
||||
Begin
|
||||
FCrc32Val := Crc_32_Tab[Byte(FCrc32Val XOR LongInt(Octet))] XOR ((FCrc32Val SHR 8) AND $00FFFFFF);
|
||||
FCrc32Val := Crc_32_Tab[Byte(FCrc32Val XOR LongWord(Octet))] XOR
|
||||
((FCrc32Val SHR 8) AND $00FFFFFF);
|
||||
end;
|
||||
|
||||
constructor TCompressor.Create(AInFile, AOutFile: TStream; ABufSize: LongWord);
|
||||
@ -1728,7 +1732,7 @@ Begin
|
||||
NewNode.Attributes := External_Attributes;
|
||||
ZipDateTimeToDateTime(Last_Mod_Date,Last_Mod_Time,D);
|
||||
NewNode.DateTime:=D;
|
||||
FZipStream.Seek(Extra_Field_Length+File_Comment_Length, soCurrent);
|
||||
FZipStream.Seek(Int64(Extra_Field_Length)+File_Comment_Length, soCurrent);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1746,7 +1750,7 @@ end;
|
||||
Procedure TUnZipper.UnZipOneFile(Item : TFullZipFileEntry);
|
||||
|
||||
Var
|
||||
Count, Attrs: Longint;
|
||||
{%H-}Count, Attrs: Longint;
|
||||
ZMethod : Word;
|
||||
//LinkTargetStream: TStringStream;
|
||||
OutputFileName: string;
|
||||
|
@ -74,7 +74,7 @@ protected
|
||||
public
|
||||
procedure AddInheritedPath(const APath: UTF8String);
|
||||
function Extract(index: integer): TVirtualLayer_Item;
|
||||
procedure Sort(const Ascending: Boolean=true;const FoldersFirst: Boolean=true);
|
||||
procedure Sort(const {%H-}Ascending: Boolean=true;const {%H-}FoldersFirst: Boolean=true);
|
||||
procedure Delete(const Index: integer);
|
||||
property Path: UTF8String read FPath;
|
||||
property Items[index: integer]:TVirtualLayer_Item read GetItems write SetItems; default;
|
||||
|
@ -571,6 +571,7 @@ begin
|
||||
ReadRowColXF(AStream, ARow, ACol, XF);
|
||||
|
||||
{ Result of the formula result in IEEE 754 floating-point value }
|
||||
Data[0] := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(Data, Sizeof(Data));
|
||||
|
||||
{ Recalculation byte - currently not used }
|
||||
@ -644,6 +645,7 @@ var
|
||||
cell: PCell;
|
||||
begin
|
||||
{ Read entire record, starting at Row, except for string data }
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF2LabelRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
ACol := WordLEToN(rec.Col);
|
||||
@ -694,6 +696,7 @@ var
|
||||
cell: PCell;
|
||||
begin
|
||||
{ Read entire record, starting at Row }
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF2NumberRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
ACol := WordLEToN(rec.Col);
|
||||
@ -729,6 +732,8 @@ var
|
||||
cell: PCell;
|
||||
rec: TBIFF2IntegerRecord;
|
||||
begin
|
||||
{ Read record into buffer }
|
||||
rec.Row := 0; // to silence the comiler...
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF2NumberRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
ACol := WordLEToN(rec.Col);
|
||||
@ -781,6 +786,7 @@ var
|
||||
lRow: PRow;
|
||||
h: word;
|
||||
begin
|
||||
rowRec.RowIndex := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(rowrec, SizeOf(TRowRecord));
|
||||
h := WordLEToN(rowrec.Height);
|
||||
if h and $8000 = 0 then begin // if this bit were set, rowheight would be default
|
||||
@ -921,6 +927,8 @@ var
|
||||
xf: TXFRecord;
|
||||
b: Byte;
|
||||
begin
|
||||
// Read entire xf record into buffer
|
||||
xf.FontIndex := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(xf, SizeOf(xf));
|
||||
|
||||
lData := TXFListData.Create;
|
||||
|
@ -1250,6 +1250,7 @@ begin
|
||||
|
||||
{ Sheet name: Byte string, 8-bit length }
|
||||
Len := AStream.ReadByte();
|
||||
Str[0] := #0; // to silence the compiler...
|
||||
AStream.ReadBuffer(Str, Len);
|
||||
Str[Len] := #0;
|
||||
|
||||
@ -1376,6 +1377,9 @@ var
|
||||
dw: DWord;
|
||||
fill: Word;
|
||||
begin
|
||||
xf.FontIndex := 0; // to silence the compiler...
|
||||
|
||||
// Read the complete xf record into a buffer
|
||||
AStream.ReadBuffer(xf, SizeOf(xf));
|
||||
|
||||
lData := TXFListData.Create;
|
||||
@ -1499,7 +1503,7 @@ end;
|
||||
|
||||
procedure TsSpreadBIFF5Reader.ReadFont(const AStream: TStream);
|
||||
var
|
||||
lCodePage: Word;
|
||||
{%H-}lCodePage: Word;
|
||||
lHeight: Word;
|
||||
lOptions: Word;
|
||||
lColor: Word;
|
||||
@ -1593,6 +1597,8 @@ var
|
||||
cell: PCell;
|
||||
AValue: ansistring;
|
||||
begin
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
|
||||
{ Read entire record, starting at Row, except for string data }
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF5LabelRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
|
@ -1001,10 +1001,10 @@ begin
|
||||
|
||||
// Loop writing the merged cell ranges
|
||||
while (n > 0) and (i < Length(rngList)) do begin
|
||||
AStream.WriteWord(WordToLE(Lo(rngList[i].Row1)));
|
||||
AStream.WriteWord(WordToLE(Lo(rngList[i].Row2)));
|
||||
AStream.WriteWord(WordToLE(Lo(rngList[i].Col1)));
|
||||
AStream.WriteWord(WordToLE(Lo(rngList[i].Col2)));
|
||||
AStream.WriteWord(WordToLE({%H-}Lo(rngList[i].Row1)));
|
||||
AStream.WriteWord(WordToLE({%H-}Lo(rngList[i].Row2)));
|
||||
AStream.WriteWord(WordToLE({%H-}Lo(rngList[i].Col1)));
|
||||
AStream.WriteWord(WordToLE({%H-}Lo(rngList[i].Col2)));
|
||||
inc(i);
|
||||
dec(n);
|
||||
end;
|
||||
@ -1617,6 +1617,8 @@ var
|
||||
rng: packed record Row1, Row2, Col1, Col2: Word; end;
|
||||
i, n: word;
|
||||
begin
|
||||
rng.Row1 := 0; // to silence the compiler...
|
||||
|
||||
// Count of merged ranges
|
||||
n := WordLEToN(AStream.ReadWord);
|
||||
|
||||
@ -1848,6 +1850,8 @@ var
|
||||
rec: TBIFF8LabelSSTRecord;
|
||||
cell: PCell;
|
||||
begin
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
|
||||
{ Read entire record, starting at Row }
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF8LabelSSTRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
@ -1930,6 +1934,9 @@ var
|
||||
dw: DWord;
|
||||
fill: Integer;
|
||||
begin
|
||||
xf.FontIndex := 0; // to silence the compiler...
|
||||
|
||||
// Read entire xf record into a buffer
|
||||
AStream.ReadBuffer(xf, SizeOf(xf));
|
||||
|
||||
lData := TXFListData.Create;
|
||||
@ -2025,7 +2032,7 @@ end;
|
||||
|
||||
procedure TsSpreadBIFF8Reader.ReadFont(const AStream: TStream);
|
||||
var
|
||||
lCodePage: Word;
|
||||
{%H-}lCodePage: Word;
|
||||
lHeight: Word;
|
||||
lOptions: Word;
|
||||
lColor: Word;
|
||||
|
@ -808,6 +808,9 @@ var
|
||||
rec: TBIFF58BlankRecord;
|
||||
cell: PCell;
|
||||
begin
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
|
||||
// Read entire record into a buffer
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF58BlankRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
ACol := WordLEToN(rec.Col);
|
||||
@ -980,6 +983,7 @@ begin
|
||||
ReadRowColXF(AStream, ARow, ACol, XF);
|
||||
|
||||
{ Result of the formula result in IEEE 754 floating-point value }
|
||||
Data[0] := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(Data, Sizeof(Data));
|
||||
|
||||
{ Options flags }
|
||||
@ -1145,6 +1149,7 @@ var
|
||||
cell: PCell;
|
||||
begin
|
||||
{ Read entire record, starting at Row }
|
||||
rec.Row := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(rec.Row, SizeOf(TBIFF58NumberRecord) - 2*SizeOf(Word));
|
||||
ARow := WordLEToN(rec.Row);
|
||||
ACol := WordLEToN(rec.Col);
|
||||
@ -1287,6 +1292,7 @@ var
|
||||
lRow: PRow;
|
||||
h: word;
|
||||
begin
|
||||
rowrec.RowIndex := 0; // to silence the compiler...
|
||||
AStream.ReadBuffer(rowrec, SizeOf(TRowRecord));
|
||||
|
||||
// if bit 6 is set in the flags row height does not match the font size.
|
||||
@ -1618,7 +1624,7 @@ end;
|
||||
stored only in the top/left cell of the range. }
|
||||
procedure TsSpreadBIFFReader.ReadSharedFormula(AStream: TStream);
|
||||
var
|
||||
r1, r2, c1, c2: Cardinal;
|
||||
r1, {%H-}r2, c1, {%H-}c2: Cardinal;
|
||||
cell: PCell;
|
||||
begin
|
||||
// Cell range in which the formula is valid
|
||||
@ -2358,6 +2364,8 @@ var
|
||||
Data: array[0..3] of word;
|
||||
FormulaResult: double;
|
||||
begin
|
||||
Data[0] := 0; // to silence the compiler...
|
||||
|
||||
{ Determine encoded result bytes }
|
||||
case ACell^.ContentType of
|
||||
cctNumber:
|
||||
@ -2811,10 +2819,10 @@ begin
|
||||
// Index to last row
|
||||
AStream.WriteWord(WordToLE(ALastRow));
|
||||
// Index to first column
|
||||
c := Lo(AFirstCol);
|
||||
c := {%H-}Lo(AFirstCol);
|
||||
AStream.WriteByte(Lo(c));
|
||||
// Index to last rcolumn
|
||||
c := Lo(ALastCol);
|
||||
c := {%H-}Lo(ALastCol);
|
||||
AStream.WriteByte(Lo(c));
|
||||
end;
|
||||
|
||||
|
@ -666,7 +666,7 @@ begin
|
||||
begin
|
||||
s := GetAttrValue(datanode, 'si');
|
||||
if s <> '' then
|
||||
FSharedFormulas.AddObject(addr, Pointer(PtrInt(StrToInt(s))));
|
||||
FSharedFormulas.AddObject(addr, {%H-}Pointer(PtrInt(StrToInt(s))));
|
||||
FWorksheet.WriteFormula(cell, formulaStr);
|
||||
cell^.SharedFormulaBase := cell;
|
||||
//AWorksheet.WriteSharedFormula(s, formulaStr);
|
||||
@ -675,7 +675,7 @@ begin
|
||||
s := GetAttrValue(datanode, 'si');
|
||||
if s <> '' then
|
||||
begin
|
||||
s := FSharedFormulas[FSharedFormulas.IndexOfObject(Pointer(PtrInt(StrToInt(s))))];
|
||||
s := FSharedFormulas[FSharedFormulas.IndexOfObject({%H-}Pointer(PtrInt(StrToInt(s))))];
|
||||
cell^.SharedFormulaBase := FWorksheet.FindCell(s);
|
||||
end;
|
||||
end;
|
||||
@ -2705,7 +2705,7 @@ begin
|
||||
'</c>', [
|
||||
CellPosText, lStyleIndex, t,
|
||||
GetCellRangeString(ACell^.Row, ACell^.Col, r2, c2),
|
||||
PtrInt(ACell), // Use the cell pointer as ID of the shared formula
|
||||
{%H-}PtrInt(ACell), // Use the cell pointer as ID of the shared formula
|
||||
PrepareFormula(ACell^.FormulaValue),
|
||||
v
|
||||
]));
|
||||
@ -2717,7 +2717,7 @@ begin
|
||||
'%s' +
|
||||
'</c>', [
|
||||
CellPosText, lStyleIndex, t,
|
||||
PtrInt(ACell^.SharedFormulaBase), // ID of the shared formula
|
||||
{%H-}PtrInt(ACell^.SharedFormulaBase), // ID of the shared formula
|
||||
v
|
||||
]));
|
||||
end else begin
|
||||
|
Reference in New Issue
Block a user