anchor.diff:    try
       if IsVisible and (Cell.Count > 0) then
       begin
  -    {clip cell contents to prevent overflow.  First check to see if there is
  -     already a clip region}
  -      SaveRgn := CreateRectRgn(0, 0, 1, 1);
  -      Rslt := GetClipRgn(Canvas.Handle, SaveRgn); {Rslt = 1 for existing region, 0 for none}
  -    {Form the region for this cell}
  -      GetWindowOrgEx(Canvas.Handle, Point); {when scrolling or animated Gifs, canvas may not start at X=0, Y=0}
  -      if not Cell.Document.Printing then
  -        if IsWin95 then
  -          Rgn := CreateRectRgn(BL - Point.X, Max(BT - Point.Y, -32000), BR - Point.X, Min(BB - Point.Y, 32000))
  +      Rslt := 0;
  +      Rgn := 0;
  +      SaveRgn := 0;
  +      if HideOverflow then
  +      begin
  +      {clip cell contents to prevent overflow.  First check to see if there is
  +       already a clip region}
  +        SaveRgn := CreateRectRgn(0, 0, 1, 1);
  +        Rslt := GetClipRgn(Canvas.Handle, SaveRgn); {Rslt = 1 for existing region, 0 for none}
  +      {Form the region for this cell}
  +        GetWindowOrgEx(Canvas.Handle, Point); {when scrolling or animated Gifs, canvas may not start at X=0, Y=0}
  +        if not Cell.Document.Printing then
  +          if IsWin95 then
  +            Rgn := CreateRectRgn(BL - Point.X, Max(BT - Point.Y, -32000), BR - Point.X, Min(BB - Point.Y, 32000))
  +          else
  +            Rgn := CreateRectRgn(BL - Point.X, BT - Point.Y, BR - Point.X, BB - Point.Y)
           else
  -          Rgn := CreateRectRgn(BL - Point.X, BT - Point.Y, BR - Point.X, BB - Point.Y)
  -      else
  -      begin
  -        GetViewportExtEx(Canvas.Handle, SizeV);
  -        GetWindowExtEx(Canvas.Handle, SizeW);
  -        HF := (SizeV.cx / SizeW.cx); {Horizontal adjustment factor}
  -        VF := (SizeV.cy / SizeW.cy); {Vertical adjustment factor}
  -        if IsWin95 then
  -          Rgn := CreateRectRgn(Round(HF * (BL - Point.X) - 1), Max(Round(VF * (BT - Point.Y) - 1), -32000), Round(HF * (X + Wd - Point.X) + 1), Min(Round(VF * (YO + Ht - Point.Y)), 32000))
  -        else
  -          Rgn := CreateRectRgn(Round(HF * (BL - Point.X) - 1), Round(VF * (BT - Point.Y) - 1), Round(HF * (X + Wd - Point.X) + 1), Round(VF * (YO + Ht - Point.Y)));
  +        begin
  +          GetViewportExtEx(Canvas.Handle, SizeV);
  +          GetWindowExtEx(Canvas.Handle, SizeW);
  +          HF := (SizeV.cx / SizeW.cx); {Horizontal adjustment factor}
  +          VF := (SizeV.cy / SizeW.cy); {Vertical adjustment factor}
  +          if IsWin95 then
  +            Rgn := CreateRectRgn(Round(HF * (BL - Point.X) - 1), Max(Round(VF * (BT - Point.Y) - 1), -32000), Round(HF * (X + Wd - Point.X) + 1), Min(Round(VF * (YO + Ht - Point.Y)), 32000))
  +          else
  +            Rgn := CreateRectRgn(Round(HF * (BL - Point.X) - 1), Round(VF * (BT - Point.Y) - 1), Round(HF * (X + Wd - Point.X) + 1), Round(VF * (YO + Ht - Point.Y)));
  +        end;
  +        if Rslt = 1 then {if there was a region, use the intersection with this region}
  +          CombineRgn(Rgn, Rgn, SaveRgn, Rgn_And);
  +        SelectClipRgn(Canvas.Handle, Rgn);
         end;
  -      if Rslt = 1 then {if there was a region, use the intersection with this region}
  -        CombineRgn(Rgn, Rgn, SaveRgn, Rgn_And);
  -      SelectClipRgn(Canvas.Handle, Rgn);
         try
           Cell.Draw(Canvas, ARect, Wd - HzSpace - CellSpacingHorz,
             X + FPad.Left + FBrd.Left + CellSpacingHorz,
             Y + FPad.Top + FBrd.Top + YIndent, ARect.Left, 0); {possibly should be IRgn.LfEdge}
         finally
  -        if Rslt = 1 then {restore any previous clip region}
  -          SelectClipRgn(Canvas.Handle, SaveRgn)
  -        else
  -          SelectClipRgn(Canvas.Handle, 0);
  -        DeleteObject(Rgn);
  -        DeleteObject(SaveRgn);
  +        if HideOverflow then
  +        begin
  +          if Rslt = 1 then {restore any previous clip region}
  +            SelectClipRgn(Canvas.Handle, SaveRgn)
  +          else
  +            SelectClipRgn(Canvas.Handle, 0);
  +          DeleteObject(Rgn);
  +          DeleteObject(SaveRgn);
  +        end;
         end;
       end;
     except
  
positive.code:   HF, VF: double;
    BRect: TRect;
    IsVisible: Boolean;
  
  begin
    YO := Y - Cell.Document.YOff;
  
  
negative.code:   if Assigned(Item) then
    begin
      if Item is TSection then
        Add(Section, TagIndex);
      inherited Add(Item);
      Item.SetDocument(Document);
    end;
  end;
  
  //-- BG ---------------------------------------------------------- 14.01.2015 --
  procedure TCellBasic.Add(var Section: TSection; TagIndex: Integer);
  begin
    if Assigned(Section) then
    begin
      if Length(Section.XP) <> 0 then
      begin
        Section.ProcessText(TagIndex);
        if not (Section.WhiteSpaceStyle in [wsPre, wsPreWrap, wsPreLine]) and (Section.Len = 0)
          and not Section.AnchorName and (Section.ClearAttr = clrNone) then
        begin
          Section.CheckFree;
          FreeAndNil(Section); {discard empty TSections that aren't anchors}
          Exit;
        end;
      end;
      inherited Add(Section);
      Section.SetDocument(Document);
    end;
  end;
  
  