fpspreadsheet: Improved number format parser

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4082 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-04-18 14:58:38 +00:00
parent 088f219acc
commit 03b7dedde7
34 changed files with 3077 additions and 2559 deletions

View File

@@ -405,10 +405,15 @@ var
r1, c1, r2, c2: Cardinal;
isHeader: Boolean;
borders: TsCellBorders;
fs: TFormatSettings;
begin
FWorksheet := Workbook.GetFirstWorksheet();
FWorksheet.UpdateCaches;
fs := FWorksheet.FormatSettings;
fs.DecimalSeparator := '.';
fs.ThousandSeparator := ',';
AStrings.Add('<!-- generated by fpspreadsheet -->');
// Show/hide grid lines
@@ -442,7 +447,7 @@ begin
for j := 0 to FWorksheet.GetLastColIndex do
begin
lCell := FWorksheet.FindCell(i, j);
lCurStr := FWorksheet.ReadAsUTF8Text(lCell);
lCurStr := FWorksheet.ReadAsUTF8Text(lCell, fs);
// if lCurStr = '' then lCurStr := '&nbsp;';
// Check for invalid characters
@@ -487,9 +492,7 @@ begin
if fssItalic in lFont.Style then lCurStr := '<i>' + lCurStr + '</i>';
if fssUnderline in lFont.Style then lCurStr := '<u>' + lCurStr + '</u>';
if fssStrikeout in lFont.Style then lCurStr := '<s>' + lCurStr + '</s>';
end;{ else
if uffBold in lCurUsedFormatting then
lCurStr := '<b>' + lCurStr + '</b>';}
end;
// Background color
if uffBackground in lCurUsedFormatting then