anchor.diff:  end;
   
   procedure ClipBuffer.CopyToClipboard;
  -{$ifdef LCL}
  -begin
  -  Clipboard.AddFormat(CF_UNICODETEXT, Buffer[0], BufferLeng * sizeof(WIDECHAR));
  -end;
  -{$else}
  -var
  -  Len: Integer;
  -  Mem: HGLOBAL;
  -  Wuf: PWideChar;
  -begin
  -  Len := BufferLeng;
  -  Mem := GlobalAlloc(GMEM_DDESHARE + GMEM_MOVEABLE, (Len + 1) * SizeOf(ThtChar));
  +{Unicode clipboard routine courtesy Mike Lischke}
  +var
  +  Data: THandle;
  +  DataPtr: Pointer;
  +begin
  +  Data := GlobalAlloc(GMEM_MOVEABLE + GMEM_DDESHARE, 2 * BufferLeng);
     try
  -    Wuf := GlobalLock(Mem);
  +    DataPtr := GlobalLock(Data);
       try
  -      Move(Buffer[0], Wuf[0], Len * SizeOf(ThtChar));
  -      Wuf[Len] := #0;
  -      // BG, 28.06.2012: use API method. The vcl clipboard does not support multiple formats.
  -      SetClipboardData(CF_UNICODETEXT, Mem);
  +      Move(Buffer^, DataPtr^, 2 * BufferLeng);
  +{$ifndef FPC_TODO}
  +      Clipboard.SetAsHandle(CF_UNICODETEXT, Data);
  +{$endif}
       finally
  -      GlobalUnlock(Mem);
  +      GlobalUnlock(Data);
       end;
     except
  -    GlobalFree(Mem);
  -  end;
  -end;
  -{$endif}
  +    GlobalFree(Data);
  +    raise;
  +  end;
  +end;
   
   function ClipBuffer.Terminate: Integer;
   begin
  
positive.code: function CalcClipRect(Canvas: TCanvas; const Rect: TRect; Printing: boolean): TRect;
  procedure GetClippingRgn(Canvas: TCanvas; const ARect: TRect; Printing: boolean; var Rgn, SaveRgn: HRgn);
  
  procedure FillRectWhite(Canvas: TCanvas; X1, Y1, X2, Y2: Integer; Color: TColor);
  procedure DrawFormControlRect(Canvas: TCanvas; X1, Y1, X2, Y2: Integer; Raised, PrintMonoBlack, Disabled: boolean; Color: TColor);
  
  procedure DrawBorder(Canvas: TCanvas; ORect, IRect: TRect; const C: htColorArray;
    const S: htBorderStyleArray; BGround: TColor; Print: boolean);
  
  implementation
  
  uses
    Forms, Math,
    {$ifndef FPC_TODO}jpeg, {$endif}
    {$IFDEF UNICODE} PngImage, {$ENDIF}
    DitherUnit, StylePars;
  
negative.code:     begin
        Pen.Width := 2;
        if Raised then
          Pen.Color := ThemedColor(clBtnHighlight{$ifdef has_StyleElements},seClient in AStyleElements{$endif})//clSilver
        else
          Pen.Color := ThemedColor(clBtnShadow{$ifdef has_StyleElements},seClient in AStyleElements{$endif});
      end;
      MoveTo(X1, Y2);
      LineTo(X1, Y1);
      LineTo(X2, Y1);
      if not MonoBlack then begin
        if Raised then
          Pen.Color := ThemedColor(clBtnShadow{$ifdef has_StyleElements},seClient in AStyleElements{$endif})
        else
          Pen.Color := ThemedColor(clBtnHighlight{$ifdef has_StyleElements},seClient in AStyleElements{$endif});//clSilver;
      end else begin
        Pen.Color := clSilver;
      end;
      LineTo(X2, Y2);
      LineTo(X1, Y2);
      Pen.Style := OldStyle;
  