Browse Source

* foreground,background color sitemap reading for TOC, fixes #40402

marcoonthegit 2 years ago
parent
commit
fb0d1c353c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      packages/chm/src/chmsitemap.pas

+ 8 - 2
packages/chm/src/chmsitemap.pas

@@ -58,7 +58,9 @@ type
                              siteattr_EXWINDOW_STYLES,
                              siteattr_EXWINDOW_STYLES,
                              siteattr_FONT,
                              siteattr_FONT,
                              siteattr_IMAGELIST,
                              siteattr_IMAGELIST,
-                             siteattr_IMAGETYPE
+                             siteattr_IMAGETYPE,
+                             siteattr_BACKGROUND,
+                             siteattr_FOREGROUND
                             );
                             );
 
 
   { TChmSiteMapSubItem }
   { TChmSiteMapSubItem }
@@ -251,7 +253,9 @@ const sitemapkws : array[TChmSiteMapItemAttrName] of string = (
                     'EXWINDOW STYLES',
                     'EXWINDOW STYLES',
                     'FONT',
                     'FONT',
                     'IMAGELIST',
                     'IMAGELIST',
-                    'IMAGETYPE');
+                    'IMAGETYPE',
+                    'BACKGROUND',
+                    'FOREGROUND');
 
 
 function indexitemcompare(Item1, Item2: Pointer): Integer;
 function indexitemcompare(Item1, Item2: Pointer): Integer;
 begin
 begin
@@ -397,6 +401,8 @@ begin
                    siteattr_FONT            : Font:=TagAttributeValue;
                    siteattr_FONT            : Font:=TagAttributeValue;
                    siteattr_IMAGELIST       : ImageList:=TagAttributeValue;
                    siteattr_IMAGELIST       : ImageList:=TagAttributeValue;
                    siteattr_IMAGETYPE       : UseFolderImages:=uppercase(TagAttributeValue)='FOLDER';
                    siteattr_IMAGETYPE       : UseFolderImages:=uppercase(TagAttributeValue)='FOLDER';
+                   siteattr_BACKGROUND      : BackgroundColor:=strtointdef(trim(TagAttributeValue),longint(-1));
+                   siteattr_FOREGROUND      : ForegroundColor:=strtointdef(trim(TagAttributeValue),0)
                    end;
                    end;
              end;
              end;
               // writeln('0:',flevel,' ' ,aactualtag,' ',tagname,' ' ,tagattributename, ' ' ,tagattributevalue);
               // writeln('0:',flevel,' ' ,aactualtag,' ',tagname,' ' ,tagattributename, ' ' ,tagattributevalue);