You've already forked lazarus-ccr
fpspreadsheet: Move type declarations from fpspreadsheet.pas to new unit fpstypes.pas. Update all examples.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3887 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9,7 +9,7 @@ program myexcel2read;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, fpscsv;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, fpscsv;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -9,7 +9,7 @@ program csvwrite;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, fpscsv;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, fpscsv;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -10,7 +10,7 @@ program excel2read;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsbiff2;
|
||||
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff2;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program excel2write;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsbiff2;
|
||||
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff2;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program excel5read;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsbiff5;
|
||||
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff5;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program excel5write;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsbiff5;
|
||||
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff5;
|
||||
|
||||
const
|
||||
Str_First = 'First';
|
||||
|
@ -10,7 +10,7 @@ program excel8read;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsbiff8,
|
||||
Classes, SysUtils, fpsTypes, fpspreadsheet, xlsbiff8,
|
||||
fpsutils;
|
||||
|
||||
var
|
||||
|
@ -35,11 +35,16 @@
|
||||
<PackageName Value="LazUtils"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="1">
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="excel8write.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="..\..\fpstypes.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="fpsTypes"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
@ -52,11 +57,6 @@
|
||||
<OtherUnitFiles Value="..\.."/>
|
||||
<UnitOutputDirectory Value="..\lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
|
@ -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';
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -10,7 +10,7 @@ program ooxmlread;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, xlsxooxml; //fpsallformats;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, xlsxooxml; //fpsallformats;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program ooxmlwrite;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, fpsallformats;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -11,7 +11,7 @@ program opendocread;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, fpsallformats;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program opendocwrite;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, fpsallformats;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, fpsallformats;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -14,8 +14,8 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
Classes,
|
||||
math, fpspreadsheet, fpsfunc, xlsbiff8;
|
||||
Classes, Math,
|
||||
fpstypes, fpspreadsheet, fpsfunc, xlsbiff8;
|
||||
|
||||
var
|
||||
workbook: TsWorkbook;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -8,9 +8,8 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
Classes, SysUtils,
|
||||
lazutf8,
|
||||
variants, fpspreadsheet, fpsallformats;
|
||||
Classes, SysUtils, lazutf8, variants,
|
||||
fpstypes, fpspreadsheet, fpsallformats;
|
||||
|
||||
type
|
||||
TDataProvider = class
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -10,8 +10,8 @@ program wikitableread;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, wikitable,
|
||||
fpsutils;
|
||||
Classes, SysUtils,
|
||||
fpstypes, fpspreadsheet, wikitable, fpsutils;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ program wikitablewrite;
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet, wikitable;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet, wikitable;
|
||||
|
||||
var
|
||||
MyWorkbook: TsWorkbook;
|
||||
|
@ -10,7 +10,7 @@ uses
|
||||
SynEditHighlighter, SynHighlighterHTML, SynHighlighterMulti,
|
||||
SynHighlighterCss, SynGutterBase, SynGutterMarks, SynGutterLineNumber,
|
||||
SynGutterChanges, SynGutter, SynGutterCodeFolding, fpspreadsheetgrid,
|
||||
fpspreadsheet, fpsallformats;
|
||||
fpstypes, fpspreadsheet, fpsallformats;
|
||||
|
||||
type
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
@ -12,7 +12,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, db,
|
||||
{%H-}fpsallformats, fpspreadsheet, fpsstrings, fpdbexport;
|
||||
{%H-}fpsallformats, fpspreadsheet, fpstypes, fpsstrings, fpdbexport;
|
||||
|
||||
Type
|
||||
|
||||
|
@ -52,7 +52,7 @@ unit fpsExprParser;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, contnrs, fpspreadsheet, fpsrpn;
|
||||
Classes, SysUtils, contnrs, fpstypes, fpspreadsheet, fpsrpn;
|
||||
|
||||
type
|
||||
{ Tokens }
|
||||
|
@ -9,7 +9,7 @@ unit fpsfunc;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpspreadsheet;
|
||||
Classes, SysUtils, fpstypes, fpspreadsheet;
|
||||
|
||||
procedure RegisterStdBuiltins(AManager: TComponent);
|
||||
|
||||
|
@ -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
|
||||
|
@ -31,14 +31,14 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree, math, dateutils,
|
||||
{$IF FPC_FULLVERSION >= 20701}
|
||||
zipper,
|
||||
{$ELSE}
|
||||
fpszipper,
|
||||
{$ENDIF}
|
||||
fpspreadsheet,
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree, math, dateutils,
|
||||
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 }
|
||||
|
@ -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 <b>Excel</b> file extension}
|
||||
STR_EXCEL_EXTENSION = '.xls';
|
||||
{@@ Default xml <b>Excel</b> file extension (>= Excel 2007) }
|
||||
STR_OOXML_EXCEL_EXTENSION = '.xlsx';
|
||||
{@@ Default <b>OpenDocument</b> spreadsheet file extension }
|
||||
STR_OPENDOCUMENT_CALC_EXTENSION = '.ods';
|
||||
{@@ Default extension of <b>comma-separated-values</b> file }
|
||||
STR_COMMA_SEPARATED_EXTENSION = '.csv';
|
||||
{@@ Default extension of <b>wikitable files</b> in <b>pipes</b> format}
|
||||
STR_WIKITABLE_PIPES = '.wikitable_pipes';
|
||||
{@@ Default extension of <b>wikitable files</b> in <b>wikimedia</b> 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 <b>elements in an expanded formula</b>.
|
||||
|
||||
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 <b>absolute</b>
|
||||
or <b>relative</b>. 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 <b>absolute</b>
|
||||
or <b>relative</b>. 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 <b>type of content</b> 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:
|
||||
<pre>
|
||||
--->
|
||||
ABC </pre>
|
||||
|
||||
So 90 degrees clockwise means that the text will be:
|
||||
<pre>
|
||||
| A
|
||||
| B
|
||||
v C </pre>
|
||||
|
||||
And 90 degree counter clockwise will be:
|
||||
<pre>
|
||||
^ C
|
||||
| B
|
||||
| A</pre>
|
||||
|
||||
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 <b>black</b> color in the standard color palettes }
|
||||
scBlack = $00;
|
||||
{@@ Index of <b>white</b> color in the standard color palettes }
|
||||
scWhite = $01;
|
||||
{@@ Index of <b>red</b> color in the standard color palettes }
|
||||
scRed = $02;
|
||||
{@@ Index of <b>green</b> color in the standard color palettes }
|
||||
scGreen = $03;
|
||||
{@@ Index of <b>blue</b> color in the standard color palettes }
|
||||
scBlue = $04;
|
||||
{@@ Index of <b>yellow</b> color in the standard color palettes }
|
||||
scYellow = $05;
|
||||
{@@ Index of <b>magenta</b> color in the standard color palettes }
|
||||
scMagenta = $06;
|
||||
{@@ Index of <b>cyan</b> color in the standard color palettes }
|
||||
scCyan = $07;
|
||||
{@@ Index of <b>dark red</b> color in the standard color palettes }
|
||||
scDarkRed = $08;
|
||||
{@@ Index of <b>dark green</b> color in the standard color palettes }
|
||||
scDarkGreen = $09;
|
||||
{@@ Index of <b>dark blue</b> color in the standard color palettes }
|
||||
scDarkBlue = $0A;
|
||||
{@@ Index of <b>"navy"</b> color (dark blue) in the standard color palettes }
|
||||
scNavy = $0A;
|
||||
{@@ Index of <b>olive</b> color in the standard color palettes }
|
||||
scOlive = $0B;
|
||||
{@@ Index of <b>purple</b> color in the standard color palettes }
|
||||
scPurple = $0C;
|
||||
{@@ Index of <b>teal</b> color in the standard color palettes }
|
||||
scTeal = $0D;
|
||||
{@@ Index of <b>silver</b> color in the standard color palettes }
|
||||
scSilver = $0E;
|
||||
{@@ Index of <b>grey</b> color in the standard color palettes }
|
||||
scGrey = $0F;
|
||||
{@@ Index of <b>gray</b> color in the standard color palettes }
|
||||
scGray = $0F; // redefine to allow different spelling
|
||||
{@@ Index of a <b>10% grey</b> color in the standard color palettes }
|
||||
scGrey10pct = $10;
|
||||
{@@ Index of a <b>10% gray</b> color in the standard color palettes }
|
||||
scGray10pct = $10;
|
||||
{@@ Index of a <b>20% grey</b> color in the standard color palettes }
|
||||
scGrey20pct = $11;
|
||||
{@@ Index of a <b>20% gray</b> color in the standard color palettes }
|
||||
scGray20pct = $11;
|
||||
{@@ Index of <b>orange</b> color in the standard color palettes }
|
||||
scOrange = $12;
|
||||
{@@ Index of <b>dark brown</b> color in the standard color palettes }
|
||||
scDarkbrown = $13;
|
||||
{@@ Index of <b>brown</b> color in the standard color palettes }
|
||||
scBrown = $14;
|
||||
{@@ Index of <b>beige</b> color in the standard color palettes }
|
||||
scBeige = $15;
|
||||
{@@ Index of <b>"wheat"</b> 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 *
|
||||
*******************************************************************************}
|
||||
|
@ -21,7 +21,7 @@ uses
|
||||
// TChart
|
||||
TACustomSource,
|
||||
// FPSpreadsheet
|
||||
fpspreadsheet, fpsutils,
|
||||
fpstypes, fpspreadsheet, fpsutils,
|
||||
// FPSpreadsheet Visual
|
||||
fpspreadsheetctrls, fpspreadsheetgrid;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)}
|
||||
|
@ -16,7 +16,7 @@ unit fpsRPN;
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, fpspreadsheet;
|
||||
SysUtils, fpstypes, fpspreadsheet;
|
||||
|
||||
type
|
||||
{@@ Pointer to a TPRNItem record
|
||||
|
446
components/fpspreadsheet/fpstypes.pas
Normal file
446
components/fpspreadsheet/fpstypes.pas
Normal file
@ -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 <b>Excel</b> file extension}
|
||||
STR_EXCEL_EXTENSION = '.xls';
|
||||
{@@ Default xml <b>Excel</b> file extension (>= Excel 2007) }
|
||||
STR_OOXML_EXCEL_EXTENSION = '.xlsx';
|
||||
{@@ Default <b>OpenDocument</b> spreadsheet file extension }
|
||||
STR_OPENDOCUMENT_CALC_EXTENSION = '.ods';
|
||||
{@@ Default extension of <b>comma-separated-values</b> file }
|
||||
STR_COMMA_SEPARATED_EXTENSION = '.csv';
|
||||
{@@ Default extension of <b>wikitable files</b> in <b>pipes</b> format}
|
||||
STR_WIKITABLE_PIPES = '.wikitable_pipes';
|
||||
{@@ Default extension of <b>wikitable files</b> in <b>wikimedia</b> 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 <b>elements in an expanded formula</b>.
|
||||
|
||||
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 <b>absolute</b>
|
||||
or <b>relative</b>. 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 <b>absolute</b>
|
||||
or <b>relative</b>. 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 <b>type of content</b> 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:
|
||||
<pre>
|
||||
--->
|
||||
ABC </pre>
|
||||
|
||||
So 90 degrees clockwise means that the text will be:
|
||||
<pre>
|
||||
| A
|
||||
| B
|
||||
v C </pre>
|
||||
|
||||
And 90 degree counter clockwise will be:
|
||||
<pre>
|
||||
^ C
|
||||
| B
|
||||
| A</pre>
|
||||
|
||||
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 <b>black</b> color in the standard color palettes }
|
||||
scBlack = $00;
|
||||
{@@ Index of <b>white</b> color in the standard color palettes }
|
||||
scWhite = $01;
|
||||
{@@ Index of <b>red</b> color in the standard color palettes }
|
||||
scRed = $02;
|
||||
{@@ Index of <b>green</b> color in the standard color palettes }
|
||||
scGreen = $03;
|
||||
{@@ Index of <b>blue</b> color in the standard color palettes }
|
||||
scBlue = $04;
|
||||
{@@ Index of <b>yellow</b> color in the standard color palettes }
|
||||
scYellow = $05;
|
||||
{@@ Index of <b>magenta</b> color in the standard color palettes }
|
||||
scMagenta = $06;
|
||||
{@@ Index of <b>cyan</b> color in the standard color palettes }
|
||||
scCyan = $07;
|
||||
{@@ Index of <b>dark red</b> color in the standard color palettes }
|
||||
scDarkRed = $08;
|
||||
{@@ Index of <b>dark green</b> color in the standard color palettes }
|
||||
scDarkGreen = $09;
|
||||
{@@ Index of <b>dark blue</b> color in the standard color palettes }
|
||||
scDarkBlue = $0A;
|
||||
{@@ Index of <b>"navy"</b> color (dark blue) in the standard color palettes }
|
||||
scNavy = $0A;
|
||||
{@@ Index of <b>olive</b> color in the standard color palettes }
|
||||
scOlive = $0B;
|
||||
{@@ Index of <b>purple</b> color in the standard color palettes }
|
||||
scPurple = $0C;
|
||||
{@@ Index of <b>teal</b> color in the standard color palettes }
|
||||
scTeal = $0D;
|
||||
{@@ Index of <b>silver</b> color in the standard color palettes }
|
||||
scSilver = $0E;
|
||||
{@@ Index of <b>grey</b> color in the standard color palettes }
|
||||
scGrey = $0F;
|
||||
{@@ Index of <b>gray</b> color in the standard color palettes }
|
||||
scGray = $0F; // redefine to allow different spelling
|
||||
{@@ Index of a <b>10% grey</b> color in the standard color palettes }
|
||||
scGrey10pct = $10;
|
||||
{@@ Index of a <b>10% gray</b> color in the standard color palettes }
|
||||
scGray10pct = $10;
|
||||
{@@ Index of a <b>20% grey</b> color in the standard color palettes }
|
||||
scGrey20pct = $11;
|
||||
{@@ Index of a <b>20% gray</b> color in the standard color palettes }
|
||||
scGray20pct = $11;
|
||||
{@@ Index of <b>orange</b> color in the standard color palettes }
|
||||
scOrange = $12;
|
||||
{@@ Index of <b>dark brown</b> color in the standard color palettes }
|
||||
scDarkbrown = $13;
|
||||
{@@ Index of <b>brown</b> color in the standard color palettes }
|
||||
scBrown = $14;
|
||||
{@@ Index of <b>beige</b> color in the standard color palettes }
|
||||
scBeige = $15;
|
||||
{@@ Index of <b>"wheat"</b> 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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -28,7 +28,7 @@
|
||||
This package is all you need if you don't want graphical components (like grids and charts)."/>
|
||||
<License Value="LGPL with static linking exception. This is the same license as is used in the LCL (Lazarus Component Library)."/>
|
||||
<Version Major="1" Minor="5"/>
|
||||
<Files Count="28">
|
||||
<Files Count="29">
|
||||
<Item1>
|
||||
<Filename Value="fpolestorage.pas"/>
|
||||
<UnitName Value="fpolestorage"/>
|
||||
@ -141,6 +141,11 @@ This package is all you need if you don't want graphical components (like grids
|
||||
<Filename Value="fpspatches.pas"/>
|
||||
<UnitName Value="fpspatches"/>
|
||||
</Item28>
|
||||
<Item29>
|
||||
<Filename Value="fpstypes.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="fpsTypes"/>
|
||||
</Item29>
|
||||
</Files>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
|
@ -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
|
||||
|
||||
|
21
components/fpspreadsheet/laz_fpspreadsheetexport_visual.pas
Normal file
21
components/fpspreadsheet/laz_fpspreadsheetexport_visual.pas
Normal file
@ -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.
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -68,7 +68,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
fpsUtils, rpnFormulaUnit;
|
||||
fpstypes, fpsUtils, rpnFormulaUnit;
|
||||
|
||||
const
|
||||
COLORSHEETNAME='color_sheet'; //for background color tests
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -48,18 +48,22 @@
|
||||
<Unit1>
|
||||
<Filename Value="datetests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="datetests"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="stringtests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="stringtests"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="numberstests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="numberstests"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="manualtests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="manualtests"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="testsutility.pas"/>
|
||||
@ -68,6 +72,7 @@
|
||||
<Unit6>
|
||||
<Filename Value="internaltests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="internaltests"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="formattests.pas"/>
|
||||
@ -77,10 +82,12 @@
|
||||
<Unit8>
|
||||
<Filename Value="colortests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="colortests"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="fonttests.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="fonttests"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="optiontests.pas"/>
|
||||
@ -93,6 +100,7 @@
|
||||
<Unit12>
|
||||
<Filename Value="rpnformulaunit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="rpnFormulaUnit"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="formulatests.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;
|
||||
|
@ -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
|
||||
|
@ -30,8 +30,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
fpimage, fgl,
|
||||
fpspreadsheet, fpsutils, lconvencoding;
|
||||
fpimage, fgl, lconvencoding,
|
||||
fpsTypes, fpspreadsheet, fpsutils;
|
||||
|
||||
type
|
||||
|
||||
|
@ -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;
|
||||
|
@ -63,7 +63,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcanvas,
|
||||
fpspreadsheet,
|
||||
fpstypes, fpspreadsheet,
|
||||
xlscommon,
|
||||
{$ifdef USE_NEW_OLE}
|
||||
fpolebasic,
|
||||
|
@ -56,7 +56,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcanvas, DateUtils,
|
||||
fpspreadsheet, xlscommon,
|
||||
fpstypes, fpspreadsheet, xlscommon,
|
||||
{$ifdef USE_NEW_OLE}
|
||||
fpolebasic,
|
||||
{$else}
|
||||
|
@ -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 }
|
||||
|
@ -34,14 +34,14 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree,
|
||||
{$IF FPC_FULLVERSION >= 20701}
|
||||
zipper,
|
||||
{$ELSE}
|
||||
fpszipper,
|
||||
{$ENDIF}
|
||||
laz2_xmlread, laz2_DOM,
|
||||
AVL_Tree,
|
||||
fpspreadsheet, fpsutils, fpsxmlcommon, xlscommon;
|
||||
fpstypes, fpspreadsheet, fpsutils, fpsxmlcommon, xlscommon;
|
||||
|
||||
type
|
||||
|
||||
|
Reference in New Issue
Block a user