Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Fix ElTree.pas

Please add following check in TCustomElTree.MeasureCellText

 if Item.IsHTML and (Copy(SText, 1, 6) = '<html>') then
 begin
    begin
          if not Assigned(FView.FRender.Data) then                                  // <- Begin Modification
          begin
            if ColumnNum = FView.Owner.FMainTreeCol then
              htmldata := Item.FHTMLData
            else
            begin
              if Item.FHTMLDataArray <> nil then
                if ColumnNum <= FView.Owner.FMainTreeCol then
                  htmldata := TLMDHTMLData(Item.FHTMLDataArray[ColumnNum])
                else
                  htmldata := TLMDHTMLData(Item.FHTMLDataArray[ColumnNum-1])
              else
                htmldata := nil;
            end;

            if Assigned(htmldata) then
              FView.FRender.SetData(htmldata);
          end;                                                                                               // <- End Modification

          with FView.FRender do
            if Assigned(Data) then                                                                   // <- Add Extra Check
            begin
              Data.DefaultStyle := Canvas.Font.Style;
              Data.DefaultFont  := Canvas.Font.Name;
              Data.DefaultHeight := Canvas.Font.Height;
              Data.Charset      := Canvas.Font.Charset;

              PrepareText(SText, MaxWidth, Item.WordWrap and Item.Multiline);
              R3.Right := Data.TextSize.cx;
              R3.Bottom := Data.TextSize.cy;
            end;



Comments

Sign In or Register to comment.