diff --git a/components/fpspreadsheet/examples/visual/fpsctrls/main.lfm b/components/fpspreadsheet/examples/visual/fpsctrls/main.lfm index 8e7b5b06d..e527c6d0f 100644 --- a/components/fpspreadsheet/examples/visual/fpsctrls/main.lfm +++ b/components/fpspreadsheet/examples/visual/fpsctrls/main.lfm @@ -903,21 +903,21 @@ object MainForm: TMainForm WorkbookSource = WorkbookSource Caption = 'Fraction (1 digit)' NumberFormat = nfFraction - NumberFormatString = '#" "#/#' + NumberFormatString = '# #/#' end object AcNumFormatFraction2: TsNumberFormatAction Category = 'FPSpreadsheet' WorkbookSource = WorkbookSource Caption = 'Fraction (2 digits)' NumberFormat = nfFraction - NumberFormatString = '#" "##/##' + NumberFormatString = '# ##/##' end object AcNumFormatFraction3: TsNumberFormatAction Category = 'FPSpreadsheet' WorkbookSource = WorkbookSource Caption = 'Fraction (3 digits)' NumberFormat = nfFraction - NumberFormatString = '#" "###/###' + NumberFormatString = '# ###/###' end object AcNumFormatDateTime: TsNumberFormatAction Category = 'FPSpreadsheet' diff --git a/components/fpspreadsheet/fpsnumformatparser.pas b/components/fpspreadsheet/fpsnumformatparser.pas index 0f68949c7..d191adb18 100644 --- a/components/fpspreadsheet/fpsnumformatparser.pas +++ b/components/fpspreadsheet/fpsnumformatparser.pas @@ -122,13 +122,9 @@ type // Format string function BuildFormatString(ADialect: TsNumFormatDialect): String; virtual; function BuildFormatStringFromSection(ASection: Integer; - ADialect: TsNumFormatDialect; AStartIndex: Integer = 0): String; virtual; + ADialect: TsNumFormatDialect): String; virtual; // NumberFormat procedure EvalNumFormatOfSection(ASection: Integer); - {; out ANumFormat: TsNumberFormat; - out ADecimals: byte; out ANumerator, ADenominator: Integer; - out ACurrencySymbol: String; out AColor: TsColor); - } function IsCurrencyAt(ASection: Integer; out ANumFormat: TsNumberFormat; out ADecimals: byte; out ACurrencySymbol: String; out AColor: TsColor): Boolean; function IsDateAt(ASection,AIndex: Integer; out ANumberFormat: TsNumberFormat; @@ -296,7 +292,7 @@ end; { Creates a format string for the given section. This implementation covers the formatstring dialects of fpc (nfdDefault) and Excel (nfdExcel). } function TsNumFormatParser.BuildFormatStringFromSection(ASection: Integer; - ADialect: TsNumFormatDialect; AStartIndex: Integer = 0): String; + ADialect: TsNumFormatDialect): String; var element: TsNumFormatElement; i: Integer; @@ -588,7 +584,7 @@ begin exit; end; // nfFraction - if IsTextAt(' ', ASection, next) and + if (IsTokenAt(nftSpace, ASection, next) or IsTextAt(' ', ASection, next)) and IsNumberAt(ASection, next+1, nf, num, next) and IsTokenAt(nftFraction, ASection, next) and IsNumberAt(ASection, next+1, nf, denom, next) and @@ -659,7 +655,7 @@ begin end; end; - // What is left must be a custom format. + // If we get here it must be a custom format. FSections[ASection].NumFormat := nfCustom; end; diff --git a/components/fpspreadsheet/fpsutils.pas b/components/fpspreadsheet/fpsutils.pas index ea8f3875e..d916df50f 100644 --- a/components/fpspreadsheet/fpsutils.pas +++ b/components/fpspreadsheet/fpsutils.pas @@ -1151,7 +1151,7 @@ begin DupeString('#', ANumeratorDigits), DupeString('#', ADenominatorDigits) ]); if AMixedFraction then - Result := '#" "' + Result; + Result := '# ' + Result; end; {@@ ---------------------------------------------------------------------------- diff --git a/components/fpspreadsheet/reference/BIFFExplorer/BIFFExplorer.lpi b/components/fpspreadsheet/reference/BIFFExplorer/BIFFExplorer.lpi index 153eb8ebe..98e61dc83 100644 --- a/components/fpspreadsheet/reference/BIFFExplorer/BIFFExplorer.lpi +++ b/components/fpspreadsheet/reference/BIFFExplorer/BIFFExplorer.lpi @@ -20,12 +20,21 @@ + + + + + + + + + @@ -48,6 +57,9 @@ + + + @@ -165,7 +177,6 @@ -