From 1461a91522a764503c71576f522c7306d88a14c9 Mon Sep 17 00:00:00 2001 From: juha Date: Thu, 22 Aug 2013 11:56:14 +0000 Subject: [PATCH] LCL: check for Interfaces unit for clipboard. It can be missing when clipboard is used in cmd line prog and LCL dependency added manually. git-svn-id: trunk@42446 - --- lcl/lclintf.pas | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lcl/lclintf.pas b/lcl/lclintf.pas index a0766a5367..66a1dba46d 100644 --- a/lcl/lclintf.pas +++ b/lcl/lclintf.pas @@ -47,7 +47,7 @@ uses {$IFDEF UNIX}Unix, {$ENDIF} {$IFDEF Darwin}MacOSAll, {$ENDIF} Types, Math, Classes, SysUtils, LCLType, LCLProc, GraphType, InterfaceBase, - LResources, FileUtil, UTF8Process, Maps, LMessages, lazutf8sysutils; + LResources, FileUtil, UTF8Process, Maps, LMessages, lazutf8sysutils, LCLStrConsts; {$ifdef Trace} {$ASSERTIONS ON} @@ -59,8 +59,7 @@ uses // All interface communication (Our additions) {$I lclintfh.inc} -function PredefinedClipboardFormat( - AFormat: TPredefinedClipboardFormat): TClipboardFormat; +function PredefinedClipboardFormat(AFormat: TPredefinedClipboardFormat): TClipboardFormat; function MsgKeyDataToShiftState(KeyData: PtrInt): TShiftState; @@ -178,12 +177,14 @@ end; {$ENDIF} -function PredefinedClipboardFormat(AFormat: TPredefinedClipboardFormat - ): TClipboardFormat; +function PredefinedClipboardFormat(AFormat: TPredefinedClipboardFormat): TClipboardFormat; begin - if FPredefinedClipboardFormats[AFormat]=0 then + if FPredefinedClipboardFormats[AFormat]=0 then begin + if WidgetSet=nil then + raise Exception.Create(rsNoWidgetSet); FPredefinedClipboardFormats[AFormat]:= ClipboardRegisterFormat(PredefinedClipboardMimeTypes[AFormat]); + end; Result:=FPredefinedClipboardFormats[AFormat]; end;