spready: Adapt to changes in fpspreadsheet.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6582 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-08-10 11:25:16 +00:00
parent e908d9ba3b
commit fc35dffc82
5 changed files with 34 additions and 13 deletions

View File

@ -94,7 +94,7 @@ implementation
{$R *.lfm}
uses
LConvEncoding, fpsUtils;
LConvEncoding, fpsUtils, sUtils;
resourcestring
rsLikeSpreadsheet = 'like spreadsheet';
@ -134,7 +134,7 @@ var
arr: Array[1..12] of String;
i: Integer;
begin
fs := UTF8FormatSettings;
InitUTF8FormatSettings(fs);
if CbLongDateFormat.ItemIndex <> 0 then
fs.LongDateFormat := CbLongDateFormat.Text;
if CbShortDateFormat.ItemIndex <> 0 then

View File

@ -347,7 +347,7 @@ object MainForm: TMainForm
Width = 130
WorkbookSource = WorkbookSource
DropDownCount = 24
ItemIndex = 46
ItemIndex = 49
TabOrder = 0
Text = 'Arial'
end
@ -873,7 +873,7 @@ object MainForm: TMainForm
Category = 'FPSpreadsheet'
WorkbookSource = WorkbookSource
Caption = 'Fraction (1 digit)'
Hint = 'Fraction with 1-digit numbers'
Hint = 'Fraction (1 digit)'
NumberFormat = nfFraction
NumberFormatString = '# ?/?'
end
@ -881,7 +881,7 @@ object MainForm: TMainForm
Category = 'FPSpreadsheet'
WorkbookSource = WorkbookSource
Caption = 'Fraction (2 digits)'
Hint = 'Fraction with 2-digit numbers'
Hint = 'Fraction (2 digits)'
NumberFormat = nfFraction
NumberFormatString = '# ??/??'
end
@ -889,7 +889,7 @@ object MainForm: TMainForm
Category = 'FPSpreadsheet'
WorkbookSource = WorkbookSource
Caption = 'Fraction (3 digits)'
Hint = 'Fraction with 3-digit numbers'
Hint = 'Fraction (3 digits)'
NumberFormat = nfFraction
NumberFormatString = '# ???/???'
end

View File

@ -502,7 +502,7 @@ uses
fpsUtils, fpsCSV, fpsReaderWriter,
sCSVParamsForm, sCurrencyForm, sFormatSettingsForm, sSortParamsForm,
sHyperlinkForm, sNumFormatForm, sSearchForm, sColWidthForm, sRowHeightForm,
sWorksheetProtection, sAbout;
sWorksheetProtection, sAbout, sUtils;
var
SEARCH_DLG_POS: TPoint = (X: -1; Y: -1);

View File

@ -198,7 +198,7 @@
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="6">
<Exceptions Count="7">
<Item1>
<Name Value="EAbort"/>
</Item1>
@ -217,6 +217,9 @@
<Item6>
<Name Value="EFpSpreadsheet"/>
</Item6>
<Item7>
<Name Value="EFpSpreadsheetReader"/>
</Item7>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -5,18 +5,30 @@ unit sutils;
interface
uses
SysUtils,
fpstypes, fpspreadsheet;
function GetCellFormatAsString(AWorkbook: TsWorkbook; AIndex: Integer): String;
var
UTF8FormatSettings: TFormatSettings;
//function GetCellFormatAsString(AWorkbook: TsWorkbook; AIndex: Integer): String;
function GetColorName(AColor: TsColor): String;
function GetFontAsString(AFont: TsFont): String;
implementation
uses
fpsstrings, fpsNumFormat;
{@@ ----------------------------------------------------------------------------
Determines the name of a color from its rgb value
-------------------------------------------------------------------------------}
type
TRGBA = packed record
R, G, B, A: byte;
end;
function GetColorName(AColor: TsColor): string;
var
rgba: TRGBA absolute AColor;
@ -29,7 +41,7 @@ begin
scBlueGray : Result := rsBlueGray;
scBrown : Result := rsBrown;
scCoral : Result := rsCoral;
scCyan : Result := rsCyan;
//scCyan : Result := rsCyan;
scDarkBlue : Result := rsDarkBlue;
scDarkGreen : Result := rsDarkGreen;
scDarkPurple : Result := rsDarkPurple;
@ -51,9 +63,9 @@ begin
scLightOrange: Result := rsLightOrange;
scLightTurquoise: Result := rsLightTurquoise;
scLightYellow: Result := rsLightYellow;
scLime : Result := rsLime;
// scLime : Result := rsLime;
scMagenta : Result := rsMagenta;
scNavy : Result := rsNavy;
// scNavy : Result := rsNavy;
scOceanBlue : Result := rsOceanBlue;
scOlive : Result := rsOlive;
scOliveGreen : Result := rsOliveGreen;
@ -88,7 +100,7 @@ begin
end;
end;
end;
(*
{@@ ----------------------------------------------------------------------------
Returns a string describing the cell format with the specified index.
-------------------------------------------------------------------------------}
@ -100,6 +112,7 @@ var
numFmt: TsNumFormatParams;
begin
Result := '';
fmt := GetPointerToCellFormat(AIndex);
if fmt = nil then
exit;
@ -141,6 +154,7 @@ begin
Result := Format('%s; %s', [Result, GetEnumName(TypeInfo(TsBiDiMode), ord(fmt^.BiDiMode))]);
if Result <> '' then Delete(Result, 1, 2);
end;
*)
{@@ ----------------------------------------------------------------------------
Returns a string which identifies the font.
@ -163,4 +177,8 @@ begin
Result := '';
end;
initialization
InitUTF8FormatSettings(UTF8FormatSettings);
end.