fpspreadsheet: Entering an empty string in an unformatted cell of the WorksheetGrid removes the cell from the worksheet. wiki writer takes stores font name.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3608 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-09-27 22:46:21 +00:00
parent 408d51b845
commit 055dc7e089
3 changed files with 12 additions and 4 deletions

View File

@ -22,11 +22,9 @@ begin
// Create the spreadsheet
MyWorkbook := TsWorkbook.Create;
MyWorkbook.SetDefaultFont('Times New Roman', 9);
MyWorksheet := MyWorkbook.AddWorksheet('Sheet');
// Use first row and column as a header
// Use first row and column as headers
Myworksheet.Options := MyWorksheet.Options + [soHasFrozenPanes];
Myworksheet.TopPaneHeight := 1;
Myworksheet.LeftPaneWidth := 1;

View File

@ -3427,12 +3427,20 @@ procedure TsWorksheet.WriteCellValueAsString(ACell: PCell; AValue: String);
var
isPercent: Boolean;
number: Double;
r, c: Cardinal;
begin
if ACell = nil then
exit;
if AValue = '' then begin
WriteBlank(ACell^.Row, ACell^.Col);
if ACell^.UsedFormattingFields = [] then
begin
r := ACell^.Row;
c := ACell^.Col;
RemoveCell(r, c);
end
else
WriteBlank(ACell);
exit;
end;

View File

@ -428,6 +428,8 @@ begin
// Default font
lStyleStr := '';
lFont := FWorkbook.GetDefaultFont;
if lFont.FontName <> DEFAULTFONTNAME then
lStyleStr := lStyleStr + Format('font-family:%s;', [lFont.FontName]);
if fssBold in lFont.Style then
lStyleStr := lStyleStr + 'font-weight:bold;';
if fssItalic in lFont.Style then