anchor.diff:    HScrollbar.RePaint;
   end;
   
  -//BG, 26.01.2014: debug stuff:
  -var
  -    AStr: AnsiString;
  -    StartPos: Integer;
  -    EndPos: Integer;
  -    LenFrag: Integer;
  -//BG, 26.01.2014: end of debug stuff:
  -
   procedure THtmlViewer.CopyToClipboard;
   
     procedure CopyToClipboardAsHtml(HTML: ThtString; StSrc, EnSrc: Integer);
   
  -    procedure CopyToClipBoard(const Source: ThtString);
  +    procedure CopyToClipBoard(const Utf8: AnsiString; Len: Integer);
       // Put SOURCE on the clipboard, using FORMAT as the clipboard format
     {$ifdef LCL}
       var
  -      Utf8: UTF8String;
  +//      Len: Integer;
  +//      Utf8: UTF8String;
         CF_HTML: UINT;
       begin
         CF_HTML := RegisterClipboardFormat('HTML Format'); {not sure this is necessary}
  -      Utf8 := UTF8Encode(Source);
  -      Clipboard.AddFormat(CF_HTML, Utf8, Length(Utf8));
  +//      Len := Length(Utf8);
  +//      Utf8 := UTF8Encode(Source);
  +      Clipboard.AddFormat(CF_HTML, Utf8, Len);
       end;
     {$else}
       var
  -      Len: Integer;
         Mem: HGLOBAL;
         Buf: PAnsiChar;
  -      L: Integer;
         CF_HTML: UINT;
       begin
  -      Len := WideCharToMultiByte(CP_UTF8, 0, PWideChar(Source), Length(Source), nil, 0, nil, nil);;
         CF_HTML := RegisterClipboardFormat('HTML Format'); {not sure this is necessary}
         Mem := GlobalAlloc(GMEM_DDESHARE + GMEM_MOVEABLE, Len + 1);
         try
           Buf := GlobalLock(Mem);
           try
  -          L := WideCharToMultiByte(CP_UTF8, 0, PWideChar(Source), Length(Source), Buf, Len, nil, nil);
  -          Buf[L] := #0;
  -//BG, 26.01.2014: debug stuff:
  -          AStr := Buf;
  -          StartPos := Pos('<!--StartFragment-->', AStr);
  -          EndPos := Pos('<!--EndFragment-->', AStr);
  -          LenFrag := EndPos - StartPos;
  -//BG, 26.01.2014: end of debug stuff:
  +          Move(Utf8[1], Buf[0], Len);
  +          Buf[Len] := #0;
             SetClipboardData(CF_HTML, Mem);
           finally
             GlobalUnlock(Mem);
  
positive.code:       Result := Copy(HTML, 1, I); {truncate the tags}
      end;
  
    begin
    {Truncate beyond EnSrc}
      HTML := Copy(HTML, 1, EnSrc - 1);
  
negative.code:   Vcl.Themes,
  {$endif}
    Math, Clipbrd, Forms, Printers,
  {$ifndef NoGDIPlus}
    GDIPL2A,
  {$endif}
  