fpspreadsheet: Initial implementation of html font reader (so far, uses only "style" attribute of "td" node)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4254 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-08-05 18:51:32 +00:00
parent 2241febbd4
commit 8ad3ef69c7
3 changed files with 135 additions and 296 deletions

View File

@ -40,7 +40,8 @@ type
implementation
uses
Strings;
Strings,
fpsUtils;
const
// http://unicode.e-workers.de/entities.php
@ -481,7 +482,7 @@ begin
inc(i);
end;
inc(i); // skip the final '"'
Add(TsHTMLAttr.Create(lowercase(nam), value));
Add(TsHTMLAttr.Create(lowercase(trim(nam)), trim(value)));
nam := '';
end;
' ', '/', '>': ;
@ -514,12 +515,16 @@ begin
begin
case AStyle[i] of
':': begin // name-value separator
inc(i); // skip ':'
while (i <= len) and (AStyle[i] = ' ') do inc(i); // skip white space
value := '';
while (i <= len) and (AStyle[i] <> ';') do
begin
value := value + AStyle[i];
inc(i); // skip final ';'
Add(TsHTMLAttr.Create(lowercase(nam), value));
inc(i);
end;
// inc(i); // skip final ';'
Add(TsHTMLAttr.Create(lowercase(trim(nam)), UnquoteStr(trim(value))));
nam := '';
end;
' ': ;