diff --git a/components/fpspreadsheet/examples/csvdemo/csvread.lpr b/components/fpspreadsheet/examples/csvdemo/csvread.lpr
index d7b09d1b8..a463339f0 100644
--- a/components/fpspreadsheet/examples/csvdemo/csvread.lpr
+++ b/components/fpspreadsheet/examples/csvdemo/csvread.lpr
@@ -9,7 +9,7 @@ program myexcel2read;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpscsv;
+ Classes, SysUtils, fpstypes, fpspreadsheet, fpscsv;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/csvdemo/csvwrite.lpr b/components/fpspreadsheet/examples/csvdemo/csvwrite.lpr
index fb3cd9eb1..97ee01394 100644
--- a/components/fpspreadsheet/examples/csvdemo/csvwrite.lpr
+++ b/components/fpspreadsheet/examples/csvdemo/csvwrite.lpr
@@ -9,7 +9,7 @@ program csvwrite;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpscsv;
+ Classes, SysUtils, fpstypes, fpspreadsheet, fpscsv;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/db_import_export/main.lfm b/components/fpspreadsheet/examples/db_import_export/main.lfm
index 4daba6db2..a5f4a10dd 100644
--- a/components/fpspreadsheet/examples/db_import_export/main.lfm
+++ b/components/fpspreadsheet/examples/db_import_export/main.lfm
@@ -8,7 +8,7 @@ object Form1: TForm1
ClientWidth = 521
OnCreate = FormCreate
OnDestroy = FormDestroy
- LCLVersion = '1.3'
+ LCLVersion = '1.5'
object PageControl: TPageControl
Left = 4
Height = 302
diff --git a/components/fpspreadsheet/examples/db_import_export/main.pas b/components/fpspreadsheet/examples/db_import_export/main.pas
index 79db4d7ef..d69ca64db 100644
--- a/components/fpspreadsheet/examples/db_import_export/main.pas
+++ b/components/fpspreadsheet/examples/db_import_export/main.pas
@@ -6,7 +6,8 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
- ComCtrls, ExtCtrls, db, dbf, fpspreadsheet, fpsallformats, fpsexport;
+ ComCtrls, ExtCtrls, db, dbf,
+ fpstypes, fpspreadsheet, fpsallformats, fpsexport;
type
diff --git a/components/fpspreadsheet/examples/excel2demo/excel2read.lpr b/components/fpspreadsheet/examples/excel2demo/excel2read.lpr
index f3be0df21..bd0858552 100644
--- a/components/fpspreadsheet/examples/excel2demo/excel2read.lpr
+++ b/components/fpspreadsheet/examples/excel2demo/excel2read.lpr
@@ -10,7 +10,7 @@ program excel2read;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff2;
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff2;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/excel2demo/excel2write.lpr b/components/fpspreadsheet/examples/excel2demo/excel2write.lpr
index 89fbc88fe..7c2787861 100644
--- a/components/fpspreadsheet/examples/excel2demo/excel2write.lpr
+++ b/components/fpspreadsheet/examples/excel2demo/excel2write.lpr
@@ -10,7 +10,7 @@ program excel2write;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff2;
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff2;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/excel5demo/excel5read.lpr b/components/fpspreadsheet/examples/excel5demo/excel5read.lpr
index 43103b1fb..00be9978d 100644
--- a/components/fpspreadsheet/examples/excel5demo/excel5read.lpr
+++ b/components/fpspreadsheet/examples/excel5demo/excel5read.lpr
@@ -10,7 +10,7 @@ program excel5read;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff5;
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff5;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/excel5demo/excel5write.lpr b/components/fpspreadsheet/examples/excel5demo/excel5write.lpr
index 58179cfb3..8fbbc05de 100644
--- a/components/fpspreadsheet/examples/excel5demo/excel5write.lpr
+++ b/components/fpspreadsheet/examples/excel5demo/excel5write.lpr
@@ -10,7 +10,7 @@ program excel5write;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff5;
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff5;
const
Str_First = 'First';
diff --git a/components/fpspreadsheet/examples/excel8demo/excel8read.lpr b/components/fpspreadsheet/examples/excel8demo/excel8read.lpr
index 290bbb0f9..f6bfb198f 100644
--- a/components/fpspreadsheet/examples/excel8demo/excel8read.lpr
+++ b/components/fpspreadsheet/examples/excel8demo/excel8read.lpr
@@ -10,7 +10,7 @@ program excel8read;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff8,
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff8,
fpsutils;
var
diff --git a/components/fpspreadsheet/examples/excel8demo/excel8write.lpi b/components/fpspreadsheet/examples/excel8demo/excel8write.lpi
index 3e604a548..c075bc9da 100644
--- a/components/fpspreadsheet/examples/excel8demo/excel8write.lpi
+++ b/components/fpspreadsheet/examples/excel8demo/excel8write.lpi
@@ -35,11 +35,16 @@
-
+
+
+
+
+
+
@@ -52,11 +57,6 @@
-
-
-
-
-
diff --git a/components/fpspreadsheet/examples/excel8demo/excel8write.lpr b/components/fpspreadsheet/examples/excel8demo/excel8write.lpr
index 375fb329a..df5af9722 100644
--- a/components/fpspreadsheet/examples/excel8demo/excel8write.lpr
+++ b/components/fpspreadsheet/examples/excel8demo/excel8write.lpr
@@ -10,7 +10,7 @@ program excel8write;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpsRPN, xlsbiff8;
+ Classes, SysUtils, fpspreadsheet, fpsRPN, xlsbiff8, fpsTypes;
const
Str_First = 'First';
diff --git a/components/fpspreadsheet/examples/fpschart/workbookchartsource/mainform.pas b/components/fpspreadsheet/examples/fpschart/workbookchartsource/mainform.pas
index 0827540e5..d9904121e 100644
--- a/components/fpspreadsheet/examples/fpschart/workbookchartsource/mainform.pas
+++ b/components/fpspreadsheet/examples/fpschart/workbookchartsource/mainform.pas
@@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls,
Graphics, Dialogs, ExtCtrls, StdCtrls,
- fpspreadsheetctrls, fpspreadsheetgrid, fpspreadsheetchart;
+ fpstypes, fpspreadsheetctrls, fpspreadsheetgrid, fpspreadsheetchart;
type
diff --git a/components/fpspreadsheet/examples/fpsctrls/main.pas b/components/fpspreadsheet/examples/fpsctrls/main.pas
index 1d8b4a881..1c5756984 100644
--- a/components/fpspreadsheet/examples/fpsctrls/main.pas
+++ b/components/fpspreadsheet/examples/fpsctrls/main.pas
@@ -6,8 +6,8 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
- ComCtrls, ActnList, Menus, StdActns, //ColorBox, StdCtrls,
- fpspreadsheet, fpspreadsheetctrls, fpspreadsheetgrid, fpsActions;
+ ComCtrls, ActnList, Menus, StdActns,
+ fpstypes, fpspreadsheet, fpspreadsheetctrls, fpspreadsheetgrid, fpsActions;
type
diff --git a/components/fpspreadsheet/examples/fpsctrls_no_install/main.pas b/components/fpspreadsheet/examples/fpsctrls_no_install/main.pas
index 2f9704205..f442919d6 100644
--- a/components/fpspreadsheet/examples/fpsctrls_no_install/main.pas
+++ b/components/fpspreadsheet/examples/fpsctrls_no_install/main.pas
@@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, Grids, Buttons, Menus, ActnList, StdActns,
- fpspreadsheet, fpspreadsheetctrls, fpSpreadsheetGrid, fpsActions;
+ fpstypes, fpspreadsheet, fpspreadsheetctrls, fpSpreadsheetGrid, fpsActions;
type
diff --git a/components/fpspreadsheet/examples/fpsspeedtest/mainform.lfm b/components/fpspreadsheet/examples/fpsspeedtest/mainform.lfm
index eb815b770..73125ed9f 100644
--- a/components/fpspreadsheet/examples/fpsspeedtest/mainform.lfm
+++ b/components/fpspreadsheet/examples/fpsspeedtest/mainform.lfm
@@ -10,11 +10,11 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnKeyPress = FormKeyPress
- LCLVersion = '1.3'
+ LCLVersion = '1.5'
object StatusBar: TStatusBar
Left = 0
- Height = 28
- Top = 534
+ Height = 23
+ Top = 539
Width = 764
Panels = <>
end
@@ -39,9 +39,9 @@ object Form1: TForm1
end
object LblCancel: TLabel
Left = 208
- Height = 40
+ Height = 30
Top = 6
- Width = 385
+ Width = 309
Caption = 'Press ESC to cancel when current file is completely written.'#13#10'This may take some time...'
ParentColor = False
Visible = False
@@ -58,19 +58,19 @@ object Form1: TForm1
end
object ParameterPanel: TPanel
Left = 0
- Height = 478
+ Height = 483
Top = 56
Width = 182
Align = alLeft
BevelOuter = bvNone
- ClientHeight = 478
+ ClientHeight = 483
ClientWidth = 182
TabOrder = 2
object CbVirtualModeOnly: TCheckBox
Left = 8
- Height = 24
+ Height = 19
Top = 8
- Width = 142
+ Width = 114
Caption = 'Virtual mode only'
TabOrder = 0
end
@@ -88,7 +88,7 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
- ClientHeight = 63
+ ClientHeight = 68
ClientWidth = 156
ItemIndex = 0
Items.Strings = (
@@ -113,7 +113,7 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
- ClientHeight = 112
+ ClientHeight = 117
ClientWidth = 156
Items.Strings = (
'ods'
@@ -142,7 +142,7 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
- ClientHeight = 152
+ ClientHeight = 157
ClientWidth = 156
Items.Strings = (
'10k'
@@ -169,7 +169,7 @@ object Form1: TForm1
end
object Memo: TMemo
Left = 182
- Height = 478
+ Height = 483
Top = 56
Width = 582
Align = alClient
diff --git a/components/fpspreadsheet/examples/fpsspeedtest/mainform.pas b/components/fpspreadsheet/examples/fpsspeedtest/mainform.pas
index ad10c79e8..8e12ff6cf 100644
--- a/components/fpspreadsheet/examples/fpsspeedtest/mainform.pas
+++ b/components/fpspreadsheet/examples/fpsspeedtest/mainform.pas
@@ -6,7 +6,8 @@ interface
uses
Classes, SysUtils, Forms, Controls, Graphics,
- Dialogs, StdCtrls, ComCtrls, ExtCtrls, iniFiles, fpSpreadsheet;
+ Dialogs, StdCtrls, ComCtrls, ExtCtrls, iniFiles,
+ fpstypes, fpSpreadsheet;
type
diff --git a/components/fpspreadsheet/examples/ooxmldemo/ooxmlread.lpr b/components/fpspreadsheet/examples/ooxmldemo/ooxmlread.lpr
index 059e5ca1a..ddd7e2beb 100644
--- a/components/fpspreadsheet/examples/ooxmldemo/ooxmlread.lpr
+++ b/components/fpspreadsheet/examples/ooxmldemo/ooxmlread.lpr
@@ -10,7 +10,7 @@ program ooxmlread;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsxooxml; //fpsallformats;
+ Classes, SysUtils, fpstypes, fpspreadsheet, xlsxooxml; //fpsallformats;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/ooxmldemo/ooxmlwrite.lpr b/components/fpspreadsheet/examples/ooxmldemo/ooxmlwrite.lpr
index f73f274eb..93f6d257c 100644
--- a/components/fpspreadsheet/examples/ooxmldemo/ooxmlwrite.lpr
+++ b/components/fpspreadsheet/examples/ooxmldemo/ooxmlwrite.lpr
@@ -10,7 +10,7 @@ program ooxmlwrite;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpsallformats;
+ Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/opendocdemo/opendocread.lpr b/components/fpspreadsheet/examples/opendocdemo/opendocread.lpr
index 89b673173..1dd185352 100644
--- a/components/fpspreadsheet/examples/opendocdemo/opendocread.lpr
+++ b/components/fpspreadsheet/examples/opendocdemo/opendocread.lpr
@@ -11,7 +11,7 @@ program opendocread;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpsallformats;
+ Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/opendocdemo/opendocwrite.lpr b/components/fpspreadsheet/examples/opendocdemo/opendocwrite.lpr
index 1fa50146e..02e477880 100644
--- a/components/fpspreadsheet/examples/opendocdemo/opendocwrite.lpr
+++ b/components/fpspreadsheet/examples/opendocdemo/opendocwrite.lpr
@@ -10,7 +10,7 @@ program opendocwrite;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, fpsallformats;
+ Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/other/demo_expression_parser.pas b/components/fpspreadsheet/examples/other/demo_expression_parser.pas
index 7c9c9bc81..258f2be3a 100644
--- a/components/fpspreadsheet/examples/other/demo_expression_parser.pas
+++ b/components/fpspreadsheet/examples/other/demo_expression_parser.pas
@@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
SysUtils, Classes
{ you can add units after this },
- TypInfo, fpSpreadsheet, fpsUtils, fpsExprParser;
+ TypInfo, fpsTypes, fpSpreadsheet, fpsUtils, fpsExprParser;
var
workbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/other/demo_formula_func.pas b/components/fpspreadsheet/examples/other/demo_formula_func.pas
index 156be53a2..27b5efeb4 100644
--- a/components/fpspreadsheet/examples/other/demo_formula_func.pas
+++ b/components/fpspreadsheet/examples/other/demo_formula_func.pas
@@ -23,8 +23,8 @@ uses
cthreads,
{$ENDIF}
{$ENDIF}
- Classes, SysUtils,
- math, fpspreadsheet, fpsallformats, fpsexprparser, financemath;
+ Classes, SysUtils, math,
+ fpstypes, fpspreadsheet, fpsallformats, fpsexprparser, financemath;
{ Base data used in this demonstration }
const
diff --git a/components/fpspreadsheet/examples/other/demo_recursive_calc.pas b/components/fpspreadsheet/examples/other/demo_recursive_calc.pas
index f1035306f..9159d9f5e 100644
--- a/components/fpspreadsheet/examples/other/demo_recursive_calc.pas
+++ b/components/fpspreadsheet/examples/other/demo_recursive_calc.pas
@@ -14,8 +14,8 @@ uses
cthreads,
{$ENDIF}
{$ENDIF}
- Classes,
- math, fpspreadsheet, fpsfunc, xlsbiff8;
+ Classes, Math,
+ fpstypes, fpspreadsheet, fpsfunc, xlsbiff8;
var
workbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/other/demo_sorting.pas b/components/fpspreadsheet/examples/other/demo_sorting.pas
index f062c189d..bcfaeabd4 100644
--- a/components/fpspreadsheet/examples/other/demo_sorting.pas
+++ b/components/fpspreadsheet/examples/other/demo_sorting.pas
@@ -6,9 +6,8 @@ uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
- SysUtils, Classes
- { you can add units after this },
- TypInfo, fpSpreadsheet, fpsutils;
+ SysUtils, Classes, TypInfo,
+ fpstypes, fpSpreadsheet, fpsutils;
var
workbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/other/demo_virtualmode_read.lpr b/components/fpspreadsheet/examples/other/demo_virtualmode_read.lpr
index eb6963258..0a14dff38 100644
--- a/components/fpspreadsheet/examples/other/demo_virtualmode_read.lpr
+++ b/components/fpspreadsheet/examples/other/demo_virtualmode_read.lpr
@@ -8,9 +8,8 @@ uses
cthreads,
{$ENDIF}
{$ENDIF}
- Classes, SysUtils,
- lazutf8,
- variants, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, xlsxooxml;
+ Classes, SysUtils, lazutf8, variants,
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, xlsxooxml;
type
TDataAnalyzer = class
diff --git a/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr
index 3608f0606..273ce9b38 100644
--- a/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr
+++ b/components/fpspreadsheet/examples/other/demo_virtualmode_write.lpr
@@ -8,9 +8,8 @@ uses
cthreads,
{$ENDIF}
{$ENDIF}
- Classes, SysUtils,
- lazutf8,
- variants, fpspreadsheet, fpsallformats;
+ Classes, SysUtils, lazutf8, variants,
+ fpstypes, fpspreadsheet, fpsallformats;
type
TDataProvider = class
diff --git a/components/fpspreadsheet/examples/other/demo_write_formatting.pas b/components/fpspreadsheet/examples/other/demo_write_formatting.pas
index 238370685..57d9e8484 100644
--- a/components/fpspreadsheet/examples/other/demo_write_formatting.pas
+++ b/components/fpspreadsheet/examples/other/demo_write_formatting.pas
@@ -12,7 +12,7 @@ program demo_write_formatting;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, xlsbiff8, fpsopendocument;
+ Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff8, fpsopendocument;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/other/demo_write_formula.pas b/components/fpspreadsheet/examples/other/demo_write_formula.pas
index fb28ff83f..6a28ca5ae 100644
--- a/components/fpspreadsheet/examples/other/demo_write_formula.pas
+++ b/components/fpspreadsheet/examples/other/demo_write_formula.pas
@@ -11,7 +11,7 @@ program demo_write_formula;
uses
Classes, SysUtils,
- fpspreadsheet, xlsbiff5, xlsbiff8, fpsopendocument, fpsRPN;
+ fpsTypes, fpspreadsheet, xlsbiff5, xlsbiff8, fpsopendocument, fpsRPN;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/spready/mainform.pas b/components/fpspreadsheet/examples/spready/mainform.pas
index b9211f8e0..d0006bcf4 100644
--- a/components/fpspreadsheet/examples/spready/mainform.pas
+++ b/components/fpspreadsheet/examples/spready/mainform.pas
@@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Menus, ExtCtrls, ComCtrls, ActnList, Spin, Grids,
ColorBox, ValEdit,
- fpspreadsheetgrid, fpspreadsheet, {%H-}fpsallformats;
+ fpstypes, fpspreadsheetgrid, fpspreadsheet, {%H-}fpsallformats;
type
@@ -351,8 +351,8 @@ var
implementation
uses
- TypInfo, LCLIntf, LCLType, LCLVersion,
- fpcanvas, fpsutils, fpscsv,
+ TypInfo, LCLIntf, LCLType, LCLVersion, fpcanvas,
+ fpsutils, fpscsv, fpsNumFormatParser,
sFormatSettingsForm, sCSVParamsForm, sSortParamsForm, sfCurrencyForm;
const
diff --git a/components/fpspreadsheet/examples/spready/ssortparamsform.pas b/components/fpspreadsheet/examples/spready/ssortparamsform.pas
index eb13f35c5..4627cb407 100644
--- a/components/fpspreadsheet/examples/spready/ssortparamsform.pas
+++ b/components/fpspreadsheet/examples/spready/ssortparamsform.pas
@@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
ButtonPanel, Grids, ExtCtrls, Buttons, StdCtrls,
- fpspreadsheet, fpspreadsheetgrid;
+ fpstypes, fpspreadsheet, fpspreadsheetgrid;
type
diff --git a/components/fpspreadsheet/examples/wikitabledemo/wikitableread.lpr b/components/fpspreadsheet/examples/wikitabledemo/wikitableread.lpr
index 69fa13407..405400b0d 100644
--- a/components/fpspreadsheet/examples/wikitabledemo/wikitableread.lpr
+++ b/components/fpspreadsheet/examples/wikitabledemo/wikitableread.lpr
@@ -10,8 +10,8 @@ program wikitableread;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, wikitable,
- fpsutils;
+ Classes, SysUtils,
+ fpstypes, fpspreadsheet, wikitable, fpsutils;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/wikitabledemo/wikitablewrite.lpr b/components/fpspreadsheet/examples/wikitabledemo/wikitablewrite.lpr
index b4cc33cc3..9af2dcd12 100644
--- a/components/fpspreadsheet/examples/wikitabledemo/wikitablewrite.lpr
+++ b/components/fpspreadsheet/examples/wikitabledemo/wikitablewrite.lpr
@@ -10,7 +10,7 @@ program wikitablewrite;
{$mode delphi}{$H+}
uses
- Classes, SysUtils, fpspreadsheet, wikitable;
+ Classes, SysUtils, fpstypes, fpspreadsheet, wikitable;
var
MyWorkbook: TsWorkbook;
diff --git a/components/fpspreadsheet/examples/wikitablemaker/wtmain.pas b/components/fpspreadsheet/examples/wikitablemaker/wtmain.pas
index f3ce58d1d..979464a22 100644
--- a/components/fpspreadsheet/examples/wikitablemaker/wtmain.pas
+++ b/components/fpspreadsheet/examples/wikitablemaker/wtmain.pas
@@ -10,7 +10,7 @@ uses
SynEditHighlighter, SynHighlighterHTML, SynHighlighterMulti,
SynHighlighterCss, SynGutterBase, SynGutterMarks, SynGutterLineNumber,
SynGutterChanges, SynGutter, SynGutterCodeFolding, fpspreadsheetgrid,
- fpspreadsheet, fpsallformats;
+ fpstypes, fpspreadsheet, fpsallformats;
type
diff --git a/components/fpspreadsheet/fpsactions.pas b/components/fpspreadsheet/fpsactions.pas
index 472b502f7..3f3da0a5a 100644
--- a/components/fpspreadsheet/fpsactions.pas
+++ b/components/fpspreadsheet/fpsactions.pas
@@ -15,7 +15,7 @@ interface
uses
SysUtils, Classes, Controls, Graphics, ActnList, StdActns, Dialogs,
- fpspreadsheet, fpspreadsheetctrls;
+ fpstypes, fpspreadsheet, fpspreadsheetctrls;
type
TsSpreadsheetAction = class(TCustomAction)
@@ -451,7 +451,7 @@ procedure Register;
implementation
uses
- fpsutils, fpsVisualUtils;
+ fpsutils, fpsnumformatparser, fpsVisualUtils;
procedure Register;
begin
diff --git a/components/fpspreadsheet/fpscsv.pas b/components/fpspreadsheet/fpscsv.pas
index 99993eb82..d82487343 100644
--- a/components/fpspreadsheet/fpscsv.pas
+++ b/components/fpspreadsheet/fpscsv.pas
@@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils,
- fpspreadsheet, fpsCsvDocument;
+ fpstypes, fpspreadsheet, fpsCsvDocument;
type
TsCSVReader = class(TsCustomSpreadReader)
@@ -95,7 +95,8 @@ implementation
uses
//StrUtils,
- DateUtils, LConvEncoding, Math, fpsutils, fpscurrency;
+ DateUtils, LConvEncoding, Math,
+ fpsutils, fpscurrency;
{ Initializes the FormatSettings of the CSVParams to default values which
can be replaced by the FormatSettings of the workbook's FormatSettings }
diff --git a/components/fpspreadsheet/fpsexport.pas b/components/fpspreadsheet/fpsexport.pas
index b31e67089..64ccb3b79 100644
--- a/components/fpspreadsheet/fpsexport.pas
+++ b/components/fpspreadsheet/fpsexport.pas
@@ -12,7 +12,7 @@ interface
uses
Classes, SysUtils, db,
- {%H-}fpsallformats, fpspreadsheet, fpsstrings, fpdbexport;
+ {%H-}fpsallformats, fpspreadsheet, fpstypes, fpsstrings, fpdbexport;
Type
diff --git a/components/fpspreadsheet/fpsexprparser.pas b/components/fpspreadsheet/fpsexprparser.pas
index 1cbe37144..48cde3e3a 100644
--- a/components/fpspreadsheet/fpsexprparser.pas
+++ b/components/fpspreadsheet/fpsexprparser.pas
@@ -52,7 +52,7 @@ unit fpsExprParser;
interface
uses
- Classes, SysUtils, contnrs, fpspreadsheet, fpsrpn;
+ Classes, SysUtils, contnrs, fpstypes, fpspreadsheet, fpsrpn;
type
{ Tokens }
diff --git a/components/fpspreadsheet/fpsfunc.pas b/components/fpspreadsheet/fpsfunc.pas
index 03f185d40..b6aeeb765 100644
--- a/components/fpspreadsheet/fpsfunc.pas
+++ b/components/fpspreadsheet/fpsfunc.pas
@@ -9,7 +9,7 @@ unit fpsfunc;
interface
uses
- Classes, SysUtils, fpspreadsheet;
+ Classes, SysUtils, fpstypes, fpspreadsheet;
procedure RegisterStdBuiltins(AManager: TComponent);
diff --git a/components/fpspreadsheet/fpsnumformatparser.pas b/components/fpspreadsheet/fpsnumformatparser.pas
index 421d24e8a..38c365eb4 100644
--- a/components/fpspreadsheet/fpsnumformatparser.pas
+++ b/components/fpspreadsheet/fpsnumformatparser.pas
@@ -7,7 +7,7 @@ unit fpsNumFormatParser;
interface
uses
- SysUtils, fpspreadsheet;
+ SysUtils, fpstypes, fpspreadsheet;
const
@@ -25,10 +25,6 @@ const
{ TsNumFormatParser }
type
- TsNumFormatDialect = (nfdDefault, nfdExcel);
- // nfdDefault is the dialect used by fpc,
- // nfdExcel is the dialect used by Excel
-
TsNumFormatToken = (nftText, nftThSep, nftDecSep,
nftYear, nftMonth, nftDay, nftHour, nftMinute, nftSecond, nftMilliseconds,
nftAMPM, nftMonthMinute, nftDateTimeSep,
@@ -154,12 +150,95 @@ type
property Status: Integer read FStatus;
end;
+
+function IsCurrencyFormat(AFormat: TsNumberFormat): Boolean;
+function IsDateTimeFormat(AFormat: TsNumberFormat): Boolean; overload;
+function IsDateTimeFormat(AFormatStr: String): Boolean; overload;
+function IsTimeFormat(AFormat: TsNumberFormat): Boolean; overload;
+function IsTimeFormat(AFormatStr: String): Boolean; overload;
+
+
implementation
uses
TypInfo, StrUtils, LazUTF8, fpsutils, fpsCurrency;
+{@@ ----------------------------------------------------------------------------
+ Checks whether the given number format code is for currency,
+ i.e. requires currency symbol.
+
+ @param AFormat Built-in number format identifier to be checked
+ @return True if AFormat is nfCurrency or nfCurrencyRed, false otherwise.
+-------------------------------------------------------------------------------}
+function IsCurrencyFormat(AFormat: TsNumberFormat): Boolean;
+begin
+ Result := AFormat in [nfCurrency, nfCurrencyRed];
+end;
+
+{@@ ----------------------------------------------------------------------------
+ Checks whether the given number format code is for date/time values.
+
+ @param AFormat Built-in number format identifier to be checked
+ @return True if AFormat is a date/time format (such as nfShortTime),
+ false otherwise
+-------------------------------------------------------------------------------}
+function IsDateTimeFormat(AFormat: TsNumberFormat): Boolean;
+begin
+ Result := AFormat in [{nfFmtDateTime, }nfShortDateTime, nfShortDate, nfLongDate,
+ nfShortTime, nfLongTime, nfShortTimeAM, nfLongTimeAM, nfTimeInterval];
+end;
+
+{@@ ----------------------------------------------------------------------------
+ Checks whether the given string with formatting codes is for date/time values.
+
+ @param AFormatStr String with formatting codes to be checked.
+ @return True if AFormatStr is a date/time format string (such as 'hh:nn'),
+ false otherwise
+-------------------------------------------------------------------------------}
+function IsDateTimeFormat(AFormatStr: string): Boolean;
+var
+ parser: TsNumFormatParser;
+begin
+ parser := TsNumFormatParser.Create(nil, AFormatStr);
+ try
+ Result := parser.IsDateTimeFormat;
+ finally
+ parser.Free;
+ end;
+end;
+
+{@@ ----------------------------------------------------------------------------
+ Checks whether the given built-in number format code is for time values.
+
+ @param AFormat Built-in number format identifier to be checked
+ @return True if AFormat represents to a time-format, false otherwise
+-------------------------------------------------------------------------------}
+function IsTimeFormat(AFormat: TsNumberFormat): boolean;
+begin
+ Result := AFormat in [nfShortTime, nfLongTime, nfShortTimeAM, nfLongTimeAM,
+ nfTimeInterval];
+end;
+
+{@@ ----------------------------------------------------------------------------
+ Checks whether the given string with formatting codes is for time values.
+
+ @param AFormatStr String with formatting codes to be checked
+ @return True if AFormatStr represents a time-format, false otherwise
+-------------------------------------------------------------------------------}
+function IsTimeFormat(AFormatStr: String): Boolean;
+var
+ parser: TsNumFormatParser;
+begin
+ parser := TsNumFormatParser.Create(nil, AFormatStr);
+ try
+ Result := parser.IsTimeFormat;
+ finally
+ parser.Free;
+ end;
+end;
+
+
{ TsNumFormatParser }
{ Creates a number format parser for analyzing a formatstring that has been read
diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas
index cb16c2c4a..555c6b36f 100755
--- a/components/fpspreadsheet/fpsopendocument.pas
+++ b/components/fpspreadsheet/fpsopendocument.pas
@@ -31,14 +31,14 @@ interface
uses
Classes, SysUtils,
- {$IF FPC_FULLVERSION >= 20701}
- zipper,
- {$ELSE}
- fpszipper,
- {$ENDIF}
- fpspreadsheet,
laz2_xmlread, laz2_DOM,
AVL_Tree, math, dateutils,
+ {$IF FPC_FULLVERSION >= 20701}
+ zipper,
+ {$ELSE}
+ fpszipper,
+ {$ENDIF}
+ fpstypes, fpspreadsheet,
fpsutils, fpsNumFormatParser, fpsxmlcommon;
type
@@ -203,7 +203,8 @@ type
implementation
uses
- StrUtils, Variants, fpsPatches, fpsStrings, fpsStreams, fpsExprParser;
+ StrUtils, Variants,
+ fpsPatches, fpsStrings, fpsStreams, fpsExprParser;
const
{ OpenDocument general XML constants }
diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas
index e065e902e..ec8d89418 100755
--- a/components/fpspreadsheet/fpspreadsheet.pas
+++ b/components/fpspreadsheet/fpspreadsheet.pas
@@ -22,389 +22,10 @@ uses
{$ifdef UNIX}{$ifndef DARWIN}{$ifndef FPS_DONT_USE_CLOCALE}
clocale,
{$endif}{$endif}{$endif}
- Classes, SysUtils, fpimage, AVL_Tree, avglvltree, lconvencoding;
+ Classes, SysUtils, fpimage, AVL_Tree, avglvltree, lconvencoding,
+ fpsTypes;
type
- {@@ File formats supported by fpspreadsheet }
- TsSpreadsheetFormat = (sfExcel2, sfExcel5, sfExcel8,
- sfOOXML, sfOpenDocument, sfCSV, sfWikiTable_Pipes, sfWikiTable_WikiMedia);
-
- {@@ Record collection limitations of a particular file format }
- TsSpreadsheetFormatLimitations = record
- MaxRowCount: Cardinal;
- MaxColCount: Cardinal;
- MaxPaletteSize: Integer;
- end;
-
-const
- { Default extensions }
-
- {@@ Default binary Excel file extension}
- STR_EXCEL_EXTENSION = '.xls';
- {@@ Default xml Excel file extension (>= Excel 2007) }
- STR_OOXML_EXCEL_EXTENSION = '.xlsx';
- {@@ Default OpenDocument spreadsheet file extension }
- STR_OPENDOCUMENT_CALC_EXTENSION = '.ods';
- {@@ Default extension of comma-separated-values file }
- STR_COMMA_SEPARATED_EXTENSION = '.csv';
- {@@ Default extension of wikitable files in pipes format}
- STR_WIKITABLE_PIPES = '.wikitable_pipes';
- {@@ Default extension of wikitable files in wikimedia format }
- STR_WIKITABLE_WIKIMEDIA = '.wikitable_wikimedia';
-
- {@@ Maximum count of worksheet columns}
- MAX_COL_COUNT = 65535;
-
- {@@ Name of the default font}
- DEFAULTFONTNAME = 'Arial';
- {@@ Size of the default font}
- DEFAULTFONTSIZE = 10;
-
-type
-
- {@@ Possible encodings for a non-unicode encoded text }
- TsEncoding = (
- seLatin1,
- seLatin2,
- seCyrillic,
- seGreek,
- seTurkish,
- seHebrew,
- seArabic
- );
-
- {@@ Tokens to identify the elements in an expanded formula.
-
- NOTE: When adding or rearranging items
- * make sure that the subtypes TOperandTokens and TBasicOperationTokens
- are complete
- * make sure to keep the table "TokenIDs" in unit xlscommon in sync
- }
- TFEKind = (
- { Basic operands }
- fekCell, fekCellRef, fekCellRange, fekCellOffset, fekNum, fekInteger,
- fekString, fekBool, fekErr, fekMissingArg,
- { Basic operations }
- fekAdd, fekSub, fekMul, fekDiv, fekPercent, fekPower, fekUMinus, fekUPlus,
- fekConcat, // string concatenation
- fekEqual, fekGreater, fekGreaterEqual, fekLess, fekLessEqual, fekNotEqual,
- fekParen, // show parenthesis around expression node
- { Functions - they are identified by their name }
- fekFunc
- );
-
- {@@ These tokens identify operands in RPN formulas. }
- TOperandTokens = fekCell..fekMissingArg;
-
- {@@ These tokens identify basic operations in RPN formulas. }
- TBasicOperationTokens = fekAdd..fekParen;
-
-type
- {@@ Flags to mark the address or a cell or a range of cells to be absolute
- or relative. They are used in the set TsRelFlags. }
- TsRelFlag = (rfRelRow, rfRelCol, rfRelRow2, rfRelCol2);
-
- {@@ Flags to mark the address of a cell or a range of cells to be absolute
- or relative. It is a set consisting of TsRelFlag elements. }
- TsRelFlags = set of TsRelFlag;
-
-const
- {@@ Abbreviation of all-relative cell reference flags }
- rfAllRel = [rfRelRow, rfRelCol, rfRelRow2, rfRelCol2];
-
- {@@ Separator between worksheet name and cell (range) reference in an address }
- SHEETSEPARATOR = '!';
-
-type
- {@@ Elements of an expanded formula.
- Note: If ElementKind is fekCellOffset, "Row" and "Col" have to be cast
- to signed integers! }
- TsFormulaElement = record
- ElementKind: TFEKind;
- Row, Row2: Cardinal; // zero-based
- Col, Col2: Cardinal; // zero-based
- Param1, Param2: Word; // Extra parameters
- DoubleValue: double;
- IntValue: Word;
- StringValue: String;
- RelFlags: TsRelFlags; // store info on relative/absolute addresses
- FuncName: String;
- ParamsNum: Byte;
- end;
-
- {@@ RPN formula. Similar to the expanded formula, but in RPN notation.
- Simplifies the task of format writers which need RPN }
- TsRPNFormula = array of TsFormulaElement;
-
- {@@ Describes the type of content in a cell of a TsWorksheet }
- TCellContentType = (cctEmpty, cctFormula, cctNumber, cctUTF8String,
- cctDateTime, cctBool, cctError);
-
- {@@ Error code values }
- TsErrorValue = (
- errOK, // no error
- errEmptyIntersection, // #NULL!
- errDivideByZero, // #DIV/0!
- errWrongType, // #VALUE!
- errIllegalRef, // #REF!
- errWrongName, // #NAME?
- errOverflow, // #NUM!
- errArgError, // #N/A
- // --- no Excel errors --
- errFormulaNotSupported
- );
-
- {@@ List of possible formatting fields }
- TsUsedFormattingField = (uffTextRotation, uffFont, uffBold, uffBorder,
- uffBackgroundColor, uffNumberFormat, uffWordWrap,
- uffHorAlign, uffVertAlign
- );
-
- {@@ Describes which formatting fields are active }
- TsUsedFormattingFields = set of TsUsedFormattingField;
-
- {@@ Number/cell formatting. Only uses a subset of the default formats,
- enough to be able to read/write date/time values.
- nfCustom allows to apply a format string directly. }
- TsNumberFormat = (
- // general-purpose for all numbers
- nfGeneral,
- // numbers
- nfFixed, nfFixedTh, nfExp, nfPercentage,
- // currency
- nfCurrency, nfCurrencyRed,
- // dates and times
- nfShortDateTime, {nfFmtDateTime, }nfShortDate, nfLongDate, nfShortTime, nfLongTime,
- nfShortTimeAM, nfLongTimeAM, nfTimeInterval,
- // other (format string goes directly into the file)
- nfCustom);
-
-const
- { @@ Codes for curreny format according to FormatSettings.CurrencyFormat:
- "C" = currency symbol, "V" = currency value, "S" = space character
- For the negative value formats, we use also:
- "B" = bracket, "M" = Minus
-
- The order of these characters represents the order of these items.
-
- Example: 1000 dollars --> "$1000" for pCV, or "1000 $" for pVsC
- -1000 dollars --> "($1000)" for nbCVb, or "-$ 1000" for nMCSV
-
- Assignment taken from "sysstr.inc" }
- pcfDefault = -1; // use value from Worksheet.FormatSettings.CurrencyFormat
- pcfCV = 0; // $1000
- pcfVC = 1; // 1000$
- pcfCSV = 2; // $ 1000
- pcfVSC = 3; // 1000 $
-
- ncfDefault = -1; // use value from Worksheet.FormatSettings.NegCurrFormat
- ncfBCVB = 0; // ($1000)
- ncfMCV = 1; // -$1000
- ncfCMV = 2; // $-1000
- ncfCVM = 3; // $1000-
- ncfBVCB = 4; // (1000$)
- ncfMVC = 5; // -1000$
- ncfVMC = 6; // 1000-$
- ncfVCM = 7; // 1000$-
- ncfMVSC = 8; // -1000 $
- ncfMCSV = 9; // -$ 1000
- ncfVSCM = 10; // 1000 $-
- ncfCSVM = 11; // $ 1000-
- ncfCSMV = 12; // $ -1000
- ncfVMSC = 13; // 1000- $
- ncfBCSVB = 14; // ($ 1000)
- ncfBVSCB = 15; // (1000 $)
-
-type
- {@@ Text rotation formatting. The text is rotated relative to the standard
- orientation, which is from left to right horizontal:
-
- --->
- ABC
-
- So 90 degrees clockwise means that the text will be:
-
- | A
- | B
- v C
-
- And 90 degree counter clockwise will be:
-
- ^ C
- | B
- | A
-
- Due to limitations of the text mode the characters are not rotated here.
- There is, however, also a "stacked" variant which looks exactly like
- the former case.
- }
- TsTextRotation = (trHorizontal, rt90DegreeClockwiseRotation,
- rt90DegreeCounterClockwiseRotation, rtStacked);
-
- {@@ Indicates horizontal text alignment in cells }
- TsHorAlignment = (haDefault, haLeft, haCenter, haRight);
-
- {@@ Indicates vertical text alignment in cells }
- TsVertAlignment = (vaDefault, vaTop, vaCenter, vaBottom);
-
- {@@
- Colors in fpspreadsheet are given as indices into a palette.
- Use the workbook's GetPaletteColor to determine the color rgb value as
- little-endian (with "r" being the low-value byte, in agreement with TColor).
- The data type for rgb values is TsColorValue. }
- TsColor = Word;
-
-{@@
- These are some constants for color indices into the default palette.
- Note, however, that if a different palette is used there may be more colors,
- and the names of the color constants may no longer be correct.
-}
-const
- {@@ Index of black color in the standard color palettes }
- scBlack = $00;
- {@@ Index of white color in the standard color palettes }
- scWhite = $01;
- {@@ Index of red color in the standard color palettes }
- scRed = $02;
- {@@ Index of green color in the standard color palettes }
- scGreen = $03;
- {@@ Index of blue color in the standard color palettes }
- scBlue = $04;
- {@@ Index of yellow color in the standard color palettes }
- scYellow = $05;
- {@@ Index of magenta color in the standard color palettes }
- scMagenta = $06;
- {@@ Index of cyan color in the standard color palettes }
- scCyan = $07;
- {@@ Index of dark red color in the standard color palettes }
- scDarkRed = $08;
- {@@ Index of dark green color in the standard color palettes }
- scDarkGreen = $09;
- {@@ Index of dark blue color in the standard color palettes }
- scDarkBlue = $0A;
- {@@ Index of "navy" color (dark blue) in the standard color palettes }
- scNavy = $0A;
- {@@ Index of olive color in the standard color palettes }
- scOlive = $0B;
- {@@ Index of purple color in the standard color palettes }
- scPurple = $0C;
- {@@ Index of teal color in the standard color palettes }
- scTeal = $0D;
- {@@ Index of silver color in the standard color palettes }
- scSilver = $0E;
- {@@ Index of grey color in the standard color palettes }
- scGrey = $0F;
- {@@ Index of gray color in the standard color palettes }
- scGray = $0F; // redefine to allow different spelling
- {@@ Index of a 10% grey color in the standard color palettes }
- scGrey10pct = $10;
- {@@ Index of a 10% gray color in the standard color palettes }
- scGray10pct = $10;
- {@@ Index of a 20% grey color in the standard color palettes }
- scGrey20pct = $11;
- {@@ Index of a 20% gray color in the standard color palettes }
- scGray20pct = $11;
- {@@ Index of orange color in the standard color palettes }
- scOrange = $12;
- {@@ Index of dark brown color in the standard color palettes }
- scDarkbrown = $13;
- {@@ Index of brown color in the standard color palettes }
- scBrown = $14;
- {@@ Index of beige color in the standard color palettes }
- scBeige = $15;
- {@@ Index of "wheat" color (yellow-orange) in the standard color palettes }
- scWheat = $16;
-
- // not sure - but I think the mechanism with scRGBColor is not working...
- // Will be removed sooner or later...
- scRGBColor = $FFFF;
-
- {@@ Identifier for transparent color }
- scTransparent = $FFFE;
- {@@ Identifier for not-defined color }
- scNotDefined = $FFFF;
-
-type
- {@@ Data type for rgb color values }
- TsColorValue = DWord;
-
- {@@ Palette of color values. A "color value" is a DWord value containing
- rgb colors. }
- TsPalette = array[0..0] of TsColorValue;
- PsPalette = ^TsPalette;
-
- {@@ Font style (redefined to avoid usage of "Graphics" }
- TsFontStyle = (fssBold, fssItalic, fssStrikeOut, fssUnderline);
-
- {@@ Set of font styles }
- TsFontStyles = set of TsFontStyle;
-
- {@@ Font record used in fpspreadsheet. Contains the font name, the font size
- (in points), the font style, and the font color. }
- TsFont = class
- {@@ Name of the font face, such as 'Arial' or 'Times New Roman' }
- FontName: String;
- {@@ Size of the font in points }
- Size: Single; // in "points"
- {@@ Font style, such as bold, italics etc. - see TsFontStyle}
- Style: TsFontStyles;
- {@@ Text color given by the index into the workbook's color palette }
- Color: TsColor;
- end;
-
- {@@ Indicates the border for a cell. If included in the CellBorders set the
- corresponding border is drawn in the style defined by the CellBorderStyle. }
- TsCellBorder = (cbNorth, cbWest, cbEast, cbSouth, cbDiagUp, cbDiagDown);
-
- {@@ Indicates the border for a cell }
- TsCellBorders = set of TsCellBorder;
-
- {@@ Line style (for cell borders) }
- TsLineStyle = (lsThin, lsMedium, lsDashed, lsDotted, lsThick, lsDouble, lsHair);
-
- {@@ The Cell border style reocrd contains the linestyle and color of a cell
- border. There is a CellBorderStyle for each border. }
- TsCellBorderStyle = record
- LineStyle: TsLineStyle;
- Color: TsColor;
- end;
-
- {@@ The cell border styles of each cell border are collected in this array. }
- TsCellBorderStyles = array[TsCellBorder] of TsCellBorderStyle;
-
- {@@ Border styles for each cell border used by default: a thin, black, solid line }
-const
- DEFAULT_BORDERSTYLES: TsCellBorderStyles = (
- (LineStyle: lsThin; Color: scBlack),
- (LineStyle: lsThin; Color: scBlack),
- (LineStyle: lsThin; Color: scBlack),
- (LineStyle: lsThin; Color: scBlack),
- (LineStyle: lsThin; Color: scBlack),
- (LineStyle: lsThin; Color: scBlack)
- );
-
-type
- {@@ Identifier for a compare operation }
- TsCompareOperation = (coNotUsed,
- coEqual, coNotEqual, coLess, coGreater, coLessEqual, coGreaterEqual
- );
-
- {@@ State flags while calculating formulas }
- TsCalcState = (csNotCalculated, csCalculating, csCalculated);
-
- {@@ Record combining a cell's row and column indexes }
- TsCellCoord = record
- Row, Col: Cardinal;
- end;
-
- {@@ Record combining row and column cornder indexes of a range of cells }
- TsCellRange = record
- Row1, Col1, Row2, Col2: Cardinal;
- end;
-
- {@@ Array with cell ranges }
- TsCellRangeArray = array of TsCellRange;
-
{@@ Pointer to a TCell record }
PCell = ^TCell;
@@ -449,12 +70,6 @@ type
CalcState: TsCalcState;
end;
-const
- // Takes account of effect of cell margins on row height by adding this
- // value to the nominal row height. Note that this is an empirical value and may be wrong.
- ROW_HEIGHT_CORRECTION = 0.2;
-
-type
{@@ The record TRow contains information about a spreadsheet row:
@param Row The index of the row (beginning with 0)
@param Height The height of the row (expressed as lines count of the default font)
@@ -480,34 +95,6 @@ type
{@@ Pointer to a TCol record }
PCol = ^TCol;
- {@@ Options for sorting }
- TsSortOption = (ssoDescending, ssoCaseInsensitive);
- {@@ Set of options for sorting }
- TsSortOptions = set of TsSortOption;
-
- {@@ Sort priority }
- TsSortPriority = (spNumAlpha, spAlphaNum); // spNumAlpha: Number < Text
-
- {@@ Sort key: sorted column or row index and sort direction }
- TsSortKey = record
- ColRowIndex: Integer;
- Options: TsSortOptions;
-// Order: TsSortOrder;
- end;
-
- {@@ Array of sort keys for multiple sorting criteria }
- TsSortKeys = array of TsSortKey;
-
- {@@ Complete set of sorting parameters
- @param SortByCols If true sorting is top-down, otherwise left-right
- @param Priority Determines whether numbers are before or after text.
- @param SortKeys Array of sorting indexes and sorting directions }
- TsSortParams = record
- SortByCols: Boolean;
- Priority: TsSortPriority;
- Keys: TsSortKeys;
- end;
-
{@@ Worksheet user interface options:
@param soShowGridLines Show or hide the grid lines in the spreadsheet
@param soShowHeaders Show or hide the column or row headers of the spreadsheet
@@ -520,8 +107,6 @@ type
@ see TsSheetOption }
TsSheetOptions = set of TsSheetOption;
-type
-
TsCustomSpreadReader = class;
TsCustomSpreadWriter = class;
TsWorkbook = class;
@@ -1356,6 +941,9 @@ procedure InitCell(ARow, ACol: Cardinal; out ACell: TCell); overload;
function HasFormula(ACell: PCell): Boolean;
+{ For debugging purposes }
+procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String);
+
implementation
@@ -1658,6 +1246,41 @@ begin
end;
+{@@ ----------------------------------------------------------------------------
+ Write the fonts stored for a given workbook to a file.
+ FOR DEBUGGING ONLY.
+-------------------------------------------------------------------------------}
+procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String);
+var
+ L: TStringList;
+ i: Integer;
+ fnt: TsFont;
+begin
+ L := TStringList.Create;
+ try
+ for i:=0 to AWorkbook.GetFontCount-1 do begin
+ fnt := AWorkbook.GetFont(i);
+ if fnt = nil then
+ L.Add(Format('#%.3d: ---------------', [i]))
+ else
+ L.Add(Format('#%.3d: %-15s %4.1f %s%s%s%s %s', [
+ i,
+ fnt.FontName,
+ fnt.Size,
+ IfThen(fssBold in fnt.Style, 'b', '.'),
+ IfThen(fssItalic in fnt.Style, 'i', '.'),
+ IfThen(fssUnderline in fnt.Style, 'u', '.'),
+ IfThen(fssStrikeOut in fnt.Style, 's', '.'),
+ AWorkbook.GetPaletteColorAsHTMLStr(fnt.Color)
+ ]));
+ end;
+ L.SaveToFile(AFileName);
+ finally
+ L.Free;
+ end;
+end;
+
+
{*******************************************************************************
* TsWorksheet *
*******************************************************************************}
diff --git a/components/fpspreadsheet/fpspreadsheetchart.pas b/components/fpspreadsheet/fpspreadsheetchart.pas
index 5449d4f82..d803c02b2 100644
--- a/components/fpspreadsheet/fpspreadsheetchart.pas
+++ b/components/fpspreadsheet/fpspreadsheetchart.pas
@@ -21,7 +21,7 @@ uses
// TChart
TACustomSource,
// FPSpreadsheet
- fpspreadsheet, fpsutils,
+ fpstypes, fpspreadsheet, fpsutils,
// FPSpreadsheet Visual
fpspreadsheetctrls, fpspreadsheetgrid;
diff --git a/components/fpspreadsheet/fpspreadsheetctrls.pas b/components/fpspreadsheet/fpspreadsheetctrls.pas
index e6c6e7b28..7b7ac84ae 100644
--- a/components/fpspreadsheet/fpspreadsheetctrls.pas
+++ b/components/fpspreadsheet/fpspreadsheetctrls.pas
@@ -28,7 +28,7 @@ interface
uses
Classes, Graphics, SysUtils, Controls, StdCtrls, ComCtrls, ValEdit, ActnList,
LResources,
- fpspreadsheet, {%H-}fpsAllFormats;
+ fpstypes, fpspreadsheet, {%H-}fpsAllFormats;
type
{@@ Event handler procedure for displaying a message if an error or
diff --git a/components/fpspreadsheet/fpspreadsheetgrid.pas b/components/fpspreadsheet/fpspreadsheetgrid.pas
index 7a6c65574..ee05304f7 100644
--- a/components/fpspreadsheet/fpspreadsheetgrid.pas
+++ b/components/fpspreadsheet/fpspreadsheetgrid.pas
@@ -25,7 +25,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Grids,
LCLVersion,
- fpspreadsheet, fpspreadsheetctrls;
+ fpstypes, fpspreadsheet, fpspreadsheetctrls;
const
{$IF (lcl_fullversion >= 1030000)}
diff --git a/components/fpspreadsheet/fpsrpn.pas b/components/fpspreadsheet/fpsrpn.pas
index a32e9b2af..d133a8ceb 100644
--- a/components/fpspreadsheet/fpsrpn.pas
+++ b/components/fpspreadsheet/fpsrpn.pas
@@ -16,7 +16,7 @@ unit fpsRPN;
interface
uses
- SysUtils, fpspreadsheet;
+ SysUtils, fpstypes, fpspreadsheet;
type
{@@ Pointer to a TPRNItem record
diff --git a/components/fpspreadsheet/fpstypes.pas b/components/fpspreadsheet/fpstypes.pas
new file mode 100644
index 000000000..54c7dbbfe
--- /dev/null
+++ b/components/fpspreadsheet/fpstypes.pas
@@ -0,0 +1,446 @@
+unit fpsTypes;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils, fpimage;
+
+type
+ {@@ File formats supported by fpspreadsheet }
+ TsSpreadsheetFormat = (sfExcel2, sfExcel5, sfExcel8,
+ sfOOXML, sfOpenDocument, sfCSV, sfWikiTable_Pipes, sfWikiTable_WikiMedia);
+
+ {@@ Record collection limitations of a particular file format }
+ TsSpreadsheetFormatLimitations = record
+ MaxRowCount: Cardinal;
+ MaxColCount: Cardinal;
+ MaxPaletteSize: Integer;
+ end;
+
+const
+ {@@ Default binary Excel file extension}
+ STR_EXCEL_EXTENSION = '.xls';
+ {@@ Default xml Excel file extension (>= Excel 2007) }
+ STR_OOXML_EXCEL_EXTENSION = '.xlsx';
+ {@@ Default OpenDocument spreadsheet file extension }
+ STR_OPENDOCUMENT_CALC_EXTENSION = '.ods';
+ {@@ Default extension of comma-separated-values file }
+ STR_COMMA_SEPARATED_EXTENSION = '.csv';
+ {@@ Default extension of wikitable files in pipes format}
+ STR_WIKITABLE_PIPES = '.wikitable_pipes';
+ {@@ Default extension of wikitable files in wikimedia format }
+ STR_WIKITABLE_WIKIMEDIA = '.wikitable_wikimedia';
+
+ {@@ Maximum count of worksheet columns}
+ MAX_COL_COUNT = 65535;
+
+ {@@ Name of the default font}
+ DEFAULTFONTNAME = 'Arial';
+ {@@ Size of the default font}
+ DEFAULTFONTSIZE = 10;
+
+ {@@ Takes account of effect of cell margins on row height by adding this
+ value to the nominal row height. Note that this is an empirical value
+ and may be wrong. }
+ ROW_HEIGHT_CORRECTION = 0.2;
+
+
+type
+
+ {@@ Possible encodings for a non-unicode encoded text }
+ TsEncoding = (
+ seLatin1,
+ seLatin2,
+ seCyrillic,
+ seGreek,
+ seTurkish,
+ seHebrew,
+ seArabic
+ );
+
+ {@@ Tokens to identify the elements in an expanded formula.
+
+ NOTE: When adding or rearranging items
+ * make sure that the subtypes TOperandTokens and TBasicOperationTokens
+ are complete
+ * make sure to keep the table "TokenIDs" in unit xlscommon in sync
+ }
+ TFEKind = (
+ { Basic operands }
+ fekCell, fekCellRef, fekCellRange, fekCellOffset, fekNum, fekInteger,
+ fekString, fekBool, fekErr, fekMissingArg,
+ { Basic operations }
+ fekAdd, fekSub, fekMul, fekDiv, fekPercent, fekPower, fekUMinus, fekUPlus,
+ fekConcat, // string concatenation
+ fekEqual, fekGreater, fekGreaterEqual, fekLess, fekLessEqual, fekNotEqual,
+ fekParen, // show parenthesis around expression node
+ { Functions - they are identified by their name }
+ fekFunc
+ );
+
+ {@@ These tokens identify operands in RPN formulas. }
+ TOperandTokens = fekCell..fekMissingArg;
+
+ {@@ These tokens identify basic operations in RPN formulas. }
+ TBasicOperationTokens = fekAdd..fekParen;
+
+type
+ {@@ Flags to mark the address or a cell or a range of cells to be absolute
+ or relative. They are used in the set TsRelFlags. }
+ TsRelFlag = (rfRelRow, rfRelCol, rfRelRow2, rfRelCol2);
+
+ {@@ Flags to mark the address of a cell or a range of cells to be absolute
+ or relative. It is a set consisting of TsRelFlag elements. }
+ TsRelFlags = set of TsRelFlag;
+
+const
+ {@@ Abbreviation of all-relative cell reference flags }
+ rfAllRel = [rfRelRow, rfRelCol, rfRelRow2, rfRelCol2];
+
+ {@@ Separator between worksheet name and cell (range) reference in an address }
+ SHEETSEPARATOR = '!';
+
+type
+ {@@ Elements of an expanded formula.
+ Note: If ElementKind is fekCellOffset, "Row" and "Col" have to be cast
+ to signed integers! }
+ TsFormulaElement = record
+ ElementKind: TFEKind;
+ Row, Row2: Cardinal; // zero-based
+ Col, Col2: Cardinal; // zero-based
+ Param1, Param2: Word; // Extra parameters
+ DoubleValue: double;
+ IntValue: Word;
+ StringValue: String;
+ RelFlags: TsRelFlags; // store info on relative/absolute addresses
+ FuncName: String;
+ ParamsNum: Byte;
+ end;
+
+ {@@ RPN formula. Similar to the expanded formula, but in RPN notation.
+ Simplifies the task of format writers which need RPN }
+ TsRPNFormula = array of TsFormulaElement;
+
+ {@@ Describes the type of content in a cell of a TsWorksheet }
+ TCellContentType = (cctEmpty, cctFormula, cctNumber, cctUTF8String,
+ cctDateTime, cctBool, cctError);
+
+ {@@ Error code values }
+ TsErrorValue = (
+ errOK, // no error
+ errEmptyIntersection, // #NULL!
+ errDivideByZero, // #DIV/0!
+ errWrongType, // #VALUE!
+ errIllegalRef, // #REF!
+ errWrongName, // #NAME?
+ errOverflow, // #NUM!
+ errArgError, // #N/A
+ // --- no Excel errors --
+ errFormulaNotSupported
+ );
+
+ {@@ List of possible formatting fields }
+ TsUsedFormattingField = (uffTextRotation, uffFont, uffBold, uffBorder,
+ uffBackgroundColor, uffNumberFormat, uffWordWrap,
+ uffHorAlign, uffVertAlign
+ );
+
+ {@@ Describes which formatting fields are active }
+ TsUsedFormattingFields = set of TsUsedFormattingField;
+
+ {@@ Number/cell formatting. Only uses a subset of the default formats,
+ enough to be able to read/write date/time values.
+ nfCustom allows to apply a format string directly. }
+ TsNumberFormat = (
+ // general-purpose for all numbers
+ nfGeneral,
+ // numbers
+ nfFixed, nfFixedTh, nfExp, nfPercentage,
+ // currency
+ nfCurrency, nfCurrencyRed,
+ // dates and times
+ nfShortDateTime, {nfFmtDateTime, }nfShortDate, nfLongDate, nfShortTime, nfLongTime,
+ nfShortTimeAM, nfLongTimeAM, nfTimeInterval,
+ // other (format string goes directly into the file)
+ nfCustom);
+
+ {@@ Identifies which "dialect" is used in the format strings:
+ nfdDefault is the dialect used by fpc
+ fndExcel is the dialect used by Excel }
+ TsNumFormatDialect = (nfdDefault, nfdExcel);
+
+const
+ { @@ Codes for curreny format according to FormatSettings.CurrencyFormat:
+ "C" = currency symbol, "V" = currency value, "S" = space character
+ For the negative value formats, we use also:
+ "B" = bracket, "M" = Minus
+
+ The order of these characters represents the order of these items.
+
+ Example: 1000 dollars --> "$1000" for pCV, or "1000 $" for pVsC
+ -1000 dollars --> "($1000)" for nbCVb, or "-$ 1000" for nMCSV
+
+ Assignment taken from "sysstr.inc" }
+ pcfDefault = -1; // use value from Worksheet.FormatSettings.CurrencyFormat
+ pcfCV = 0; // $1000
+ pcfVC = 1; // 1000$
+ pcfCSV = 2; // $ 1000
+ pcfVSC = 3; // 1000 $
+
+ ncfDefault = -1; // use value from Worksheet.FormatSettings.NegCurrFormat
+ ncfBCVB = 0; // ($1000)
+ ncfMCV = 1; // -$1000
+ ncfCMV = 2; // $-1000
+ ncfCVM = 3; // $1000-
+ ncfBVCB = 4; // (1000$)
+ ncfMVC = 5; // -1000$
+ ncfVMC = 6; // 1000-$
+ ncfVCM = 7; // 1000$-
+ ncfMVSC = 8; // -1000 $
+ ncfMCSV = 9; // -$ 1000
+ ncfVSCM = 10; // 1000 $-
+ ncfCSVM = 11; // $ 1000-
+ ncfCSMV = 12; // $ -1000
+ ncfVMSC = 13; // 1000- $
+ ncfBCSVB = 14; // ($ 1000)
+ ncfBVSCB = 15; // (1000 $)
+
+type
+ {@@ Text rotation formatting. The text is rotated relative to the standard
+ orientation, which is from left to right horizontal:
+
+ --->
+ ABC
+
+ So 90 degrees clockwise means that the text will be:
+
+ | A
+ | B
+ v C
+
+ And 90 degree counter clockwise will be:
+
+ ^ C
+ | B
+ | A
+
+ Due to limitations of the text mode the characters are not rotated here.
+ There is, however, also a "stacked" variant which looks exactly like
+ the former case.
+ }
+ TsTextRotation = (trHorizontal, rt90DegreeClockwiseRotation,
+ rt90DegreeCounterClockwiseRotation, rtStacked);
+
+ {@@ Indicates horizontal text alignment in cells }
+ TsHorAlignment = (haDefault, haLeft, haCenter, haRight);
+
+ {@@ Indicates vertical text alignment in cells }
+ TsVertAlignment = (vaDefault, vaTop, vaCenter, vaBottom);
+
+ {@@
+ Colors in fpspreadsheet are given as indices into a palette.
+ Use the workbook's GetPaletteColor to determine the color rgb value as
+ little-endian (with "r" being the low-value byte, in agreement with TColor).
+ The data type for rgb values is TsColorValue. }
+ TsColor = Word;
+
+{@@
+ These are some constants for color indices into the default palette.
+ Note, however, that if a different palette is used there may be more colors,
+ and the names of the color constants may no longer be correct.
+}
+const
+ {@@ Index of black color in the standard color palettes }
+ scBlack = $00;
+ {@@ Index of white color in the standard color palettes }
+ scWhite = $01;
+ {@@ Index of red color in the standard color palettes }
+ scRed = $02;
+ {@@ Index of green color in the standard color palettes }
+ scGreen = $03;
+ {@@ Index of blue color in the standard color palettes }
+ scBlue = $04;
+ {@@ Index of yellow color in the standard color palettes }
+ scYellow = $05;
+ {@@ Index of magenta color in the standard color palettes }
+ scMagenta = $06;
+ {@@ Index of cyan color in the standard color palettes }
+ scCyan = $07;
+ {@@ Index of dark red color in the standard color palettes }
+ scDarkRed = $08;
+ {@@ Index of dark green color in the standard color palettes }
+ scDarkGreen = $09;
+ {@@ Index of dark blue color in the standard color palettes }
+ scDarkBlue = $0A;
+ {@@ Index of "navy" color (dark blue) in the standard color palettes }
+ scNavy = $0A;
+ {@@ Index of olive color in the standard color palettes }
+ scOlive = $0B;
+ {@@ Index of purple color in the standard color palettes }
+ scPurple = $0C;
+ {@@ Index of teal color in the standard color palettes }
+ scTeal = $0D;
+ {@@ Index of silver color in the standard color palettes }
+ scSilver = $0E;
+ {@@ Index of grey color in the standard color palettes }
+ scGrey = $0F;
+ {@@ Index of gray color in the standard color palettes }
+ scGray = $0F; // redefine to allow different spelling
+ {@@ Index of a 10% grey color in the standard color palettes }
+ scGrey10pct = $10;
+ {@@ Index of a 10% gray color in the standard color palettes }
+ scGray10pct = $10;
+ {@@ Index of a 20% grey color in the standard color palettes }
+ scGrey20pct = $11;
+ {@@ Index of a 20% gray color in the standard color palettes }
+ scGray20pct = $11;
+ {@@ Index of orange color in the standard color palettes }
+ scOrange = $12;
+ {@@ Index of dark brown color in the standard color palettes }
+ scDarkbrown = $13;
+ {@@ Index of brown color in the standard color palettes }
+ scBrown = $14;
+ {@@ Index of beige color in the standard color palettes }
+ scBeige = $15;
+ {@@ Index of "wheat" color (yellow-orange) in the standard color palettes }
+ scWheat = $16;
+
+ // not sure - but I think the mechanism with scRGBColor is not working...
+ // Will be removed sooner or later...
+ scRGBColor = $FFFF;
+
+ {@@ Identifier for transparent color }
+ scTransparent = $FFFE;
+ {@@ Identifier for not-defined color }
+ scNotDefined = $FFFF;
+
+type
+ {@@ Data type for rgb color values }
+ TsColorValue = DWord;
+
+ {@@ Palette of color values. A "color value" is a DWord value containing
+ rgb colors. }
+ TsPalette = array[0..0] of TsColorValue;
+ PsPalette = ^TsPalette;
+
+ {@@ Font style (redefined to avoid usage of "Graphics" }
+ TsFontStyle = (fssBold, fssItalic, fssStrikeOut, fssUnderline);
+
+ {@@ Set of font styles }
+ TsFontStyles = set of TsFontStyle;
+
+ {@@ Font record used in fpspreadsheet. Contains the font name, the font size
+ (in points), the font style, and the font color. }
+ TsFont = class
+ {@@ Name of the font face, such as 'Arial' or 'Times New Roman' }
+ FontName: String;
+ {@@ Size of the font in points }
+ Size: Single; // in "points"
+ {@@ Font style, such as bold, italics etc. - see TsFontStyle}
+ Style: TsFontStyles;
+ {@@ Text color given by the index into the workbook's color palette }
+ Color: TsColor;
+ end;
+
+ {@@ Indicates the border for a cell. If included in the CellBorders set the
+ corresponding border is drawn in the style defined by the CellBorderStyle. }
+ TsCellBorder = (cbNorth, cbWest, cbEast, cbSouth, cbDiagUp, cbDiagDown);
+
+ {@@ Indicates the border for a cell }
+ TsCellBorders = set of TsCellBorder;
+
+ {@@ Line style (for cell borders) }
+ TsLineStyle = (lsThin, lsMedium, lsDashed, lsDotted, lsThick, lsDouble, lsHair);
+
+ {@@ The Cell border style reocrd contains the linestyle and color of a cell
+ border. There is a CellBorderStyle for each border. }
+ TsCellBorderStyle = record
+ LineStyle: TsLineStyle;
+ Color: TsColor;
+ end;
+
+ {@@ The cell border styles of each cell border are collected in this array. }
+ TsCellBorderStyles = array[TsCellBorder] of TsCellBorderStyle;
+
+ {@@ Border styles for each cell border used by default: a thin, black, solid line }
+const
+ DEFAULT_BORDERSTYLES: TsCellBorderStyles = (
+ (LineStyle: lsThin; Color: scBlack),
+ (LineStyle: lsThin; Color: scBlack),
+ (LineStyle: lsThin; Color: scBlack),
+ (LineStyle: lsThin; Color: scBlack),
+ (LineStyle: lsThin; Color: scBlack),
+ (LineStyle: lsThin; Color: scBlack)
+ );
+
+type
+ {@@ Identifier for a compare operation }
+ TsCompareOperation = (coNotUsed,
+ coEqual, coNotEqual, coLess, coGreater, coLessEqual, coGreaterEqual
+ );
+
+ {@@ State flags while calculating formulas }
+ TsCalcState = (csNotCalculated, csCalculating, csCalculated);
+
+ {@@ Record combining a cell's row and column indexes }
+ TsCellCoord = record
+ Row, Col: Cardinal;
+ end;
+
+ {@@ Record combining row and column cornder indexes of a range of cells }
+ TsCellRange = record
+ Row1, Col1, Row2, Col2: Cardinal;
+ end;
+
+ {@@ Array with cell ranges }
+ TsCellRangeArray = array of TsCellRange;
+
+ {@@ Options for sorting }
+ TsSortOption = (ssoDescending, ssoCaseInsensitive);
+ {@@ Set of options for sorting }
+ TsSortOptions = set of TsSortOption;
+
+ {@@ Sort priority }
+ TsSortPriority = (spNumAlpha, spAlphaNum); // spNumAlpha: Number < Text
+
+ {@@ Sort key: sorted column or row index and sort direction }
+ TsSortKey = record
+ ColRowIndex: Integer;
+ Options: TsSortOptions;
+ end;
+
+ {@@ Array of sort keys for multiple sorting criteria }
+ TsSortKeys = array of TsSortKey;
+
+ {@@ Complete set of sorting parameters
+ @param SortByCols If true sorting is top-down, otherwise left-right
+ @param Priority Determines whether numbers are before or after text.
+ @param SortKeys Array of sorting indexes and sorting directions }
+ TsSortParams = record
+ SortByCols: Boolean;
+ Priority: TsSortPriority;
+ Keys: TsSortKeys;
+ end;
+
+ {@@ Record containing all details for cell formatting }
+ TsStyle = record
+ UsedFormattingFields: TsUsedFormattingFields;
+ FontIndex: Integer;
+ TextRotation: TsTextRotation;
+ HorAlignment: TsHorAlignment;
+ VertAlignment: TsVertAlignment;
+ Border: TsCellBorders;
+ BorderStyles: TsCelLBorderStyles;
+ BackgroundColor: TsColor;
+ RGBBackgroundColor: TFPColor; // only valid if BackgroundColor=scRGBCOLOR
+ NumberFormat: TsNumberFormat;
+ NumberFormatStr: String;
+ end;
+
+
+implementation
+
+end.
+
diff --git a/components/fpspreadsheet/fpsutils.pas b/components/fpspreadsheet/fpsutils.pas
index 24e1492b6..a6f0021db 100644
--- a/components/fpspreadsheet/fpsutils.pas
+++ b/components/fpspreadsheet/fpsutils.pas
@@ -18,7 +18,7 @@ interface
uses
Classes, SysUtils, StrUtils,
- fpspreadsheet, fpsNumFormatParser;
+ fpstypes;
// Exported types
type
@@ -88,12 +88,6 @@ function GetErrorValueStr(AErrorValue: TsErrorValue): String;
function IfThen(ACondition: Boolean; AValue1,AValue2: TsNumberFormat): TsNumberFormat; overload;
-function IsCurrencyFormat(AFormat: TsNumberFormat): Boolean;
-function IsDateTimeFormat(AFormat: TsNumberFormat): Boolean; overload;
-function IsDateTimeFormat(AFormatStr: String): Boolean; overload;
-function IsTimeFormat(AFormat: TsNumberFormat): Boolean; overload;
-function IsTimeFormat(AFormatStr: String): Boolean; overload;
-
procedure BuildCurrencyFormatList(AList: TStrings;
APositive: Boolean; AValue: Double; const ACurrencySymbol: String);
function BuildCurrencyFormatString(ADialect: TsNumFormatDialect;
@@ -158,9 +152,6 @@ procedure Unused(const A1);
procedure Unused(const A1, A2);
procedure Unused(const A1, A2, A3);
-{ For debugging purposes }
-procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String);
-
var
{@@ Default value for the screen pixel density (pixels per inch). Is needed
for conversion of distances to pixels}
@@ -844,80 +835,6 @@ begin
if ACondition then Result := AValue1 else Result := AValue2;
end;
-{@@ ----------------------------------------------------------------------------
- Checks whether the given number format code is for currency,
- i.e. requires currency symbol.
-
- @param AFormat Built-in number format identifier to be checked
- @return True if AFormat is nfCurrency or nfCurrencyRed, false otherwise.
--------------------------------------------------------------------------------}
-function IsCurrencyFormat(AFormat: TsNumberFormat): Boolean;
-begin
- Result := AFormat in [nfCurrency, nfCurrencyRed];
-end;
-
-{@@ ----------------------------------------------------------------------------
- Checks whether the given number format code is for date/time values.
-
- @param AFormat Built-in number format identifier to be checked
- @return True if AFormat is a date/time format (such as nfShortTime),
- false otherwise
--------------------------------------------------------------------------------}
-function IsDateTimeFormat(AFormat: TsNumberFormat): Boolean;
-begin
- Result := AFormat in [{nfFmtDateTime, }nfShortDateTime, nfShortDate, nfLongDate,
- nfShortTime, nfLongTime, nfShortTimeAM, nfLongTimeAM, nfTimeInterval];
-end;
-
-{@@ ----------------------------------------------------------------------------
- Checks whether the given string with formatting codes is for date/time values.
-
- @param AFormatStr String with formatting codes to be checked.
- @return True if AFormatStr is a date/time format string (such as 'hh:nn'),
- false otherwise
--------------------------------------------------------------------------------}
-function IsDateTimeFormat(AFormatStr: string): Boolean;
-var
- parser: TsNumFormatParser;
-begin
- parser := TsNumFormatParser.Create(nil, AFormatStr);
- try
- Result := parser.IsDateTimeFormat;
- finally
- parser.Free;
- end;
-end;
-
-{@@ ----------------------------------------------------------------------------
- Checks whether the given built-in number format code is for time values.
-
- @param AFormat Built-in number format identifier to be checked
- @return True if AFormat represents to a time-format, false otherwise
--------------------------------------------------------------------------------}
-function IsTimeFormat(AFormat: TsNumberFormat): boolean;
-begin
- Result := AFormat in [nfShortTime, nfLongTime, nfShortTimeAM, nfLongTimeAM,
- nfTimeInterval];
-end;
-
-{@@ ----------------------------------------------------------------------------
- Checks whether the given string with formatting codes is for time values.
-
- @param AFormatStr String with formatting codes to be checked
- @return True if AFormatStr represents a time-format, false otherwise
--------------------------------------------------------------------------------}
-function IsTimeFormat(AFormatStr: String): Boolean;
-var
- parser: TsNumFormatParser;
-begin
- parser := TsNumFormatParser.Create(nil, AFormatStr);
- try
- Result := parser.IsTimeFormat;
- finally
- parser.Free;
- end;
-end;
-
{@@ ----------------------------------------------------------------------------
Builds a date/time format string from the number format code.
@@ -2314,42 +2231,6 @@ begin
end;
-{ For debugging only }
-
-{@@ ----------------------------------------------------------------------------
- Write the fonts stored for a given workbook to a file.
--------------------------------------------------------------------------------}
-procedure DumpFontsToFile(AWorkbook: TsWorkbook; AFileName: String);
-var
- L: TStringList;
- i: Integer;
- fnt: TsFont;
-begin
- L := TStringList.Create;
- try
- for i:=0 to AWorkbook.GetFontCount-1 do begin
- fnt := AWorkbook.GetFont(i);
- if fnt = nil then
- L.Add(Format('#%.3d: ---------------', [i]))
- else
- L.Add(Format('#%.3d: %-15s %4.1f %s%s%s%s %s', [
- i,
- fnt.FontName,
- fnt.Size,
- IfThen(fssBold in fnt.Style, 'b', '.'),
- IfThen(fssItalic in fnt.Style, 'i', '.'),
- IfThen(fssUnderline in fnt.Style, 'u', '.'),
- IfThen(fssStrikeOut in fnt.Style, 's', '.'),
- AWorkbook.GetPaletteColorAsHTMLStr(fnt.Color)
- ]));
- end;
- L.SaveToFile(AFileName);
- finally
- L.Free;
- end;
-end;
-
-
initialization
InitUTF8FormatSettings;
diff --git a/components/fpspreadsheet/fpsvisualutils.pas b/components/fpspreadsheet/fpsvisualutils.pas
index 40a31ea7c..56108ddb1 100644
--- a/components/fpspreadsheet/fpsvisualutils.pas
+++ b/components/fpspreadsheet/fpsvisualutils.pas
@@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, Graphics,
- fpspreadsheet;
+ fpstypes, fpspreadsheet;
procedure Convert_sFont_to_Font(AWorkbook: TsWorkbook; sFont: TsFont; AFont: TFont);
procedure Convert_Font_to_sFont(AWorkbook: TsWorkbook; AFont: TFont; sFont: TsFont);
diff --git a/components/fpspreadsheet/laz_fpspreadsheet.lpk b/components/fpspreadsheet/laz_fpspreadsheet.lpk
index e4a9b21dd..4edcbf912 100644
--- a/components/fpspreadsheet/laz_fpspreadsheet.lpk
+++ b/components/fpspreadsheet/laz_fpspreadsheet.lpk
@@ -28,7 +28,7 @@
This package is all you need if you don't want graphical components (like grids and charts)."/>
-
+
@@ -141,6 +141,11 @@ This package is all you need if you don't want graphical components (like grids
+
+
+
+
+
diff --git a/components/fpspreadsheet/laz_fpspreadsheet.pas b/components/fpspreadsheet/laz_fpspreadsheet.pas
index 265418e94..0aa866831 100644
--- a/components/fpspreadsheet/laz_fpspreadsheet.pas
+++ b/components/fpspreadsheet/laz_fpspreadsheet.pas
@@ -12,7 +12,7 @@ uses
fpsutils, fpszipper, uvirtuallayer_types, uvirtuallayer, uvirtuallayer_ole,
uvirtuallayer_ole_helpers, uvirtuallayer_ole_types, uvirtuallayer_stream,
fpolebasic, wikitable, fpsNumFormatParser, fpsfunc, fpsRPN, fpsStrings,
- fpscsv, fpsCsvDocument, fpspatches;
+ fpscsv, fpsCsvDocument, fpspatches, fpsTypes;
implementation
diff --git a/components/fpspreadsheet/laz_fpspreadsheetexport_visual.pas b/components/fpspreadsheet/laz_fpspreadsheetexport_visual.pas
new file mode 100644
index 000000000..5cf03f7ab
--- /dev/null
+++ b/components/fpspreadsheet/laz_fpspreadsheetexport_visual.pas
@@ -0,0 +1,21 @@
+{ This file was automatically created by Lazarus. Do not edit!
+ This source is only used to compile and install the package.
+ }
+
+unit laz_fpspreadsheetexport_visual;
+
+interface
+
+uses
+ fpsexport, fpsexportreg, LazarusPackageIntf;
+
+implementation
+
+procedure Register;
+begin
+ RegisterUnit('fpsexportreg', @fpsexportreg.Register);
+end;
+
+initialization
+ RegisterPackage('laz_fpspreadsheetexport_visual', @Register);
+end.
diff --git a/components/fpspreadsheet/tests/celltypetests.pas b/components/fpspreadsheet/tests/celltypetests.pas
index cac4994b7..57798efa1 100644
--- a/components/fpspreadsheet/tests/celltypetests.pas
+++ b/components/fpspreadsheet/tests/celltypetests.pas
@@ -12,7 +12,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
type
diff --git a/components/fpspreadsheet/tests/colortests.pas b/components/fpspreadsheet/tests/colortests.pas
index e7f618159..80e463495 100644
--- a/components/fpspreadsheet/tests/colortests.pas
+++ b/components/fpspreadsheet/tests/colortests.pas
@@ -11,7 +11,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
type
diff --git a/components/fpspreadsheet/tests/copytests.pas b/components/fpspreadsheet/tests/copytests.pas
index b77083196..1839da421 100644
--- a/components/fpspreadsheet/tests/copytests.pas
+++ b/components/fpspreadsheet/tests/copytests.pas
@@ -12,7 +12,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
testsutility;
var
diff --git a/components/fpspreadsheet/tests/datetests.pas b/components/fpspreadsheet/tests/datetests.pas
index 7b64f7103..bc3a2ad06 100644
--- a/components/fpspreadsheet/tests/datetests.pas
+++ b/components/fpspreadsheet/tests/datetests.pas
@@ -18,7 +18,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
var
diff --git a/components/fpspreadsheet/tests/dbexporttests.pas b/components/fpspreadsheet/tests/dbexporttests.pas
index d4287ba85..ebff62472 100644
--- a/components/fpspreadsheet/tests/dbexporttests.pas
+++ b/components/fpspreadsheet/tests/dbexporttests.pas
@@ -8,7 +8,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet,
+ fpstypes, fpsallformats, fpspreadsheet,
testsutility, db, bufdataset, fpsexport;
type
diff --git a/components/fpspreadsheet/tests/emptycelltests.pas b/components/fpspreadsheet/tests/emptycelltests.pas
index 0d2030a3b..95fa31509 100644
--- a/components/fpspreadsheet/tests/emptycelltests.pas
+++ b/components/fpspreadsheet/tests/emptycelltests.pas
@@ -11,7 +11,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
testsutility;
var
diff --git a/components/fpspreadsheet/tests/errortests.pas b/components/fpspreadsheet/tests/errortests.pas
index 713c01734..84c512f61 100644
--- a/components/fpspreadsheet/tests/errortests.pas
+++ b/components/fpspreadsheet/tests/errortests.pas
@@ -10,7 +10,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add ".." to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpspreadsheet {and a project requirement for lclbase for utf8 handling},
fpsutils, testsutility;
type
diff --git a/components/fpspreadsheet/tests/fonttests.pas b/components/fpspreadsheet/tests/fonttests.pas
index 40f786c8d..47f30486d 100644
--- a/components/fpspreadsheet/tests/fonttests.pas
+++ b/components/fpspreadsheet/tests/fonttests.pas
@@ -11,7 +11,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
var
@@ -243,8 +243,8 @@ begin
font := MyWorkbook.GetFont(MyCell^.FontIndex);
CheckEquals(SollSizes[row], font.Size,
'Test unsaved font size, cell ' + CellNotation(MyWorksheet,0,0));
- currValue := GetEnumName(TypeInfo(TsFontStyles), byte(font.Style));
- expectedValue := GetEnumName(TypeInfo(TsFontStyles), byte(SollStyles[col]));
+ currValue := GetEnumName(TypeInfo(TsFontStyles), integer(font.Style));
+ expectedValue := GetEnumName(TypeInfo(TsFontStyles), integer(SollStyles[col]));
CheckEquals(currValue, expectedValue,
'Test unsaved font style, cell ' + CellNotation(MyWorksheet,0,0));
end;
@@ -278,8 +278,8 @@ begin
if abs(SollSizes[row] - font.Size) > 1e-6 then // safe-guard against rounding errors
CheckEquals(SollSizes[row], font.Size,
'Test saved font size, cell '+CellNotation(MyWorksheet,Row,Col));
- currValue := GetEnumName(TypeInfo(TsFontStyles), byte(font.Style));
- expectedValue := GetEnumName(TypeInfo(TsFontStyles), byte(SollStyles[col]));
+ currValue := GetEnumName(TypeInfo(TsFontStyles), integer(font.Style));
+ expectedValue := GetEnumName(TypeInfo(TsFontStyles), integer(SollStyles[col]));
CheckEquals(currValue, expectedValue,
'Test unsaved font style, cell ' + CellNotation(MyWorksheet,0,0));
inc(counter);
diff --git a/components/fpspreadsheet/tests/formattests.pas b/components/fpspreadsheet/tests/formattests.pas
index 030924679..6c57769bf 100644
--- a/components/fpspreadsheet/tests/formattests.pas
+++ b/components/fpspreadsheet/tests/formattests.pas
@@ -17,7 +17,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
var
@@ -146,7 +146,7 @@ type
implementation
uses
- TypInfo, fpsPatches, fpsutils, fpscsv;
+ TypInfo, fpsPatches, fpsutils, fpsnumformatparser, fpscsv;
const
FmtNumbersSheet = 'NumbersFormat'; //let's distinguish it from the regular numbers sheet
diff --git a/components/fpspreadsheet/tests/formulatests.pas b/components/fpspreadsheet/tests/formulatests.pas
index 5a9a08702..c34096957 100644
--- a/components/fpspreadsheet/tests/formulatests.pas
+++ b/components/fpspreadsheet/tests/formulatests.pas
@@ -17,7 +17,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, fpsexprparser,
+ fpstypes, fpsallformats, fpspreadsheet, fpsexprparser,
xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
diff --git a/components/fpspreadsheet/tests/insertdeletetests.pas b/components/fpspreadsheet/tests/insertdeletetests.pas
index a8e37c4d8..5afb89a17 100644
--- a/components/fpspreadsheet/tests/insertdeletetests.pas
+++ b/components/fpspreadsheet/tests/insertdeletetests.pas
@@ -12,7 +12,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff8, {and a project requirement for lclbase for utf8 handling}
+ fpstypes, fpspreadsheet, xlsbiff8, {and a project requirement for lclbase for utf8 handling}
testsutility;
type
diff --git a/components/fpspreadsheet/tests/internaltests.pas b/components/fpspreadsheet/tests/internaltests.pas
index 0648f0bac..ab8ffc22f 100644
--- a/components/fpspreadsheet/tests/internaltests.pas
+++ b/components/fpspreadsheet/tests/internaltests.pas
@@ -16,7 +16,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
fpsutils, fpsstreams, testsutility, md5;
type
@@ -147,7 +147,7 @@ begin
MyWorkSheet:=MyWorkBook.AddWorksheet(InternalSheet);
MyWorkSheet.WriteUTF8Text(0,0,FirstFileCellText);
TempFile:=NewTempFile;
- MyWorkBook.WriteToFile(TempFile,sfExcel8,false);
+ MyWorkBook.WriteToFile(TempFile, sfExcel8, false);
finally
MyWorkbook.Free;
end;
diff --git a/components/fpspreadsheet/tests/manualtests.pas b/components/fpspreadsheet/tests/manualtests.pas
index 730737ba7..28e4b5980 100644
--- a/components/fpspreadsheet/tests/manualtests.pas
+++ b/components/fpspreadsheet/tests/manualtests.pas
@@ -68,7 +68,7 @@ type
implementation
uses
- fpsUtils, rpnFormulaUnit;
+ fpstypes, fpsUtils, rpnFormulaUnit;
const
COLORSHEETNAME='color_sheet'; //for background color tests
diff --git a/components/fpspreadsheet/tests/numberstests.pas b/components/fpspreadsheet/tests/numberstests.pas
index b8f5d967e..8b2d14003 100644
--- a/components/fpspreadsheet/tests/numberstests.pas
+++ b/components/fpspreadsheet/tests/numberstests.pas
@@ -17,7 +17,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
var
diff --git a/components/fpspreadsheet/tests/numformatparsertests.pas b/components/fpspreadsheet/tests/numformatparsertests.pas
index aed776962..cb8988ee5 100644
--- a/components/fpspreadsheet/tests/numformatparsertests.pas
+++ b/components/fpspreadsheet/tests/numformatparsertests.pas
@@ -8,7 +8,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, fpsnumformatparser, xlsbiff8
+ fpstypes, fpsallformats, fpspreadsheet, fpsnumformatparser, xlsbiff8
{and a project requirement for lclbase for utf8 handling},
testsutility;
diff --git a/components/fpspreadsheet/tests/optiontests.pas b/components/fpspreadsheet/tests/optiontests.pas
index f9ebbd483..588711091 100644
--- a/components/fpspreadsheet/tests/optiontests.pas
+++ b/components/fpspreadsheet/tests/optiontests.pas
@@ -11,7 +11,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
type
diff --git a/components/fpspreadsheet/tests/rpnformulaunit.pas b/components/fpspreadsheet/tests/rpnformulaunit.pas
index 1f4b06515..deed401c7 100644
--- a/components/fpspreadsheet/tests/rpnformulaunit.pas
+++ b/components/fpspreadsheet/tests/rpnformulaunit.pas
@@ -6,7 +6,7 @@ uses
{$IFDEF Unix}
clocale, //required for formatsettings
{$ENDIF}
- SysUtils, fpspreadsheet,fpsutils;
+ SysUtils, fpstypes, fpspreadsheet,fpsutils;
procedure WriteRPNFormulaSamples(Worksheet: TsWorksheet;
AFormat: TsSpreadsheetFormat; IncludeErrors: Boolean);
diff --git a/components/fpspreadsheet/tests/sortingtests.pas b/components/fpspreadsheet/tests/sortingtests.pas
index e960ad31c..b1cae49b5 100644
--- a/components/fpspreadsheet/tests/sortingtests.pas
+++ b/components/fpspreadsheet/tests/sortingtests.pas
@@ -10,7 +10,7 @@ uses
// Not using Lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testregistry,
- fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
+ fpstypes, fpspreadsheet, xlsbiff2, xlsbiff5, xlsbiff8, fpsopendocument, {and a project requirement for lclbase for utf8 handling}
testsutility;
var
diff --git a/components/fpspreadsheet/tests/spreadtestgui.lpi b/components/fpspreadsheet/tests/spreadtestgui.lpi
index d9c45b0a4..4840d66ff 100644
--- a/components/fpspreadsheet/tests/spreadtestgui.lpi
+++ b/components/fpspreadsheet/tests/spreadtestgui.lpi
@@ -48,18 +48,22 @@
+
+
+
+
@@ -68,6 +72,7 @@
+
@@ -77,10 +82,12 @@
+
+
@@ -93,6 +100,7 @@
+
diff --git a/components/fpspreadsheet/tests/stringtests.pas b/components/fpspreadsheet/tests/stringtests.pas
index 4f691b90e..a9ca80d1d 100644
--- a/components/fpspreadsheet/tests/stringtests.pas
+++ b/components/fpspreadsheet/tests/stringtests.pas
@@ -25,7 +25,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpsutils, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpsutils, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
testsutility;
var
@@ -182,7 +182,7 @@ begin
CheckEquals(SollStrings[Row],ActualString,'Test value mismatch cell '+CellNotation(MyWorkSheet,Row));
end;
TempFile:=NewTempFile;
- MyWorkBook.WriteToFile(TempFile,sfExcel8,true);
+ MyWorkBook.WriteToFile(TempFile, sfExcel8, true);
finally
MyWorkbook.Free;
end;
diff --git a/components/fpspreadsheet/tests/virtualmodetests.pas b/components/fpspreadsheet/tests/virtualmodetests.pas
index 8723bb99c..baa7533d5 100644
--- a/components/fpspreadsheet/tests/virtualmodetests.pas
+++ b/components/fpspreadsheet/tests/virtualmodetests.pas
@@ -9,7 +9,7 @@ uses
// Not using lazarus package as the user may be working with multiple versions
// Instead, add .. to unit search path
Classes, SysUtils, fpcunit, testutils, testregistry,
- fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
+ fpstypes, fpsallformats, fpspreadsheet, xlsbiff8 {and a project requirement for lclbase for utf8 handling},
fpsutils, testsutility;
type
diff --git a/components/fpspreadsheet/wikitable.pas b/components/fpspreadsheet/wikitable.pas
index 56a24dbd9..da9cfecca 100644
--- a/components/fpspreadsheet/wikitable.pas
+++ b/components/fpspreadsheet/wikitable.pas
@@ -30,8 +30,8 @@ interface
uses
Classes, SysUtils,
- fpimage, fgl,
- fpspreadsheet, fpsutils, lconvencoding;
+ fpimage, fgl, lconvencoding,
+ fpsTypes, fpspreadsheet, fpsutils;
type
diff --git a/components/fpspreadsheet/xlsbiff2.pas b/components/fpspreadsheet/xlsbiff2.pas
index 8996a2922..b6d577153 100755
--- a/components/fpspreadsheet/xlsbiff2.pas
+++ b/components/fpspreadsheet/xlsbiff2.pas
@@ -33,8 +33,8 @@ unit xlsbiff2;
interface
uses
- Classes, SysUtils,
- fpspreadsheet, xlscommon, fpsutils, lconvencoding;
+ Classes, SysUtils, lconvencoding,
+ fpstypes, fpspreadsheet, xlscommon, fpsutils;
const
BIFF2_MAX_PALETTE_SIZE = 8;
diff --git a/components/fpspreadsheet/xlsbiff5.pas b/components/fpspreadsheet/xlsbiff5.pas
index 5417d8c5b..2b6e60354 100755
--- a/components/fpspreadsheet/xlsbiff5.pas
+++ b/components/fpspreadsheet/xlsbiff5.pas
@@ -63,7 +63,7 @@ interface
uses
Classes, SysUtils, fpcanvas,
- fpspreadsheet,
+ fpstypes, fpspreadsheet,
xlscommon,
{$ifdef USE_NEW_OLE}
fpolebasic,
diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas
index 9120077ff..6158cf751 100755
--- a/components/fpspreadsheet/xlsbiff8.pas
+++ b/components/fpspreadsheet/xlsbiff8.pas
@@ -56,7 +56,7 @@ interface
uses
Classes, SysUtils, fpcanvas, DateUtils,
- fpspreadsheet, xlscommon,
+ fpstypes, fpspreadsheet, xlscommon,
{$ifdef USE_NEW_OLE}
fpolebasic,
{$else}
diff --git a/components/fpspreadsheet/xlscommon.pas b/components/fpspreadsheet/xlscommon.pas
index 41bb2805e..9c421a052 100644
--- a/components/fpspreadsheet/xlscommon.pas
+++ b/components/fpspreadsheet/xlscommon.pas
@@ -18,7 +18,7 @@ uses
fpolestorage,
{$endif}
*)
- fpspreadsheet, fpsutils, lconvencoding;
+ fpstypes, fpspreadsheet, fpsutils, lconvencoding;
const
{ RECORD IDs which didn't change across versions 2-8 }
diff --git a/components/fpspreadsheet/xlsxooxml.pas b/components/fpspreadsheet/xlsxooxml.pas
index c0ab52628..67354a709 100755
--- a/components/fpspreadsheet/xlsxooxml.pas
+++ b/components/fpspreadsheet/xlsxooxml.pas
@@ -34,14 +34,14 @@ interface
uses
Classes, SysUtils,
- {$IF FPC_FULLVERSION >= 20701}
- zipper,
- {$ELSE}
- fpszipper,
- {$ENDIF}
laz2_xmlread, laz2_DOM,
AVL_Tree,
- fpspreadsheet, fpsutils, fpsxmlcommon, xlscommon;
+ {$IF FPC_FULLVERSION >= 20701}
+ zipper,
+ {$ELSE}
+ fpszipper,
+ {$ENDIF}
+ fpstypes, fpspreadsheet, fpsutils, fpsxmlcommon, xlscommon;
type