Fixed compiler warnings in Delphi 7 with string type conversions

- Added TCefFastDomVisitor3
This commit is contained in:
Salvador Díaz Fau 2020-06-20 16:10:29 +02:00
parent 32ea814c9c
commit ef2277fe6c
5 changed files with 52 additions and 10 deletions

View File

@ -317,7 +317,7 @@ type
function CheckCEFLibrary : boolean;
procedure RegisterWidevineCDM;
{$IFDEF MSWINDOWS}
function FindFlashDLL(var aFileName : string) : boolean;
function FindFlashDLL(var aFileName : ustring) : boolean;
{$ENDIF}
procedure ShowErrorMessageDlg(const aError : string); virtual;
procedure UpdateSupportedSchemes(aIncludeDefaults : boolean = True); virtual;
@ -1355,10 +1355,10 @@ begin
end;
{$IFDEF MSWINDOWS}
function TCefApplicationCore.FindFlashDLL(var aFileName : string) : boolean;
function TCefApplicationCore.FindFlashDLL(var aFileName : ustring) : boolean;
var
TempSearchRec : TSearchRec;
TempProductName, TempPath : string;
TempProductName, TempPath : ustring;
begin
Result := False;
aFileName := '';
@ -1593,7 +1593,7 @@ var
i : integer;
{$IFDEF MSWINDOWS}
TempVersionInfo : TFileVersionInfo;
TempFileName : string;
TempFileName : ustring;
{$ENDIF}
begin
if (commandLine <> nil) and (FProcessType = ptBrowser) and (processType = '') then

View File

@ -49,7 +49,7 @@ unit uCEFDomVisitor;
interface
uses
uCEFBaseRefCounted, uCEFInterfaces;
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type
TCefDomVisitorOwn = class(TCefBaseRefCountedOwn, ICefDomVisitor)
@ -83,10 +83,25 @@ type
destructor Destroy; override;
end;
TCefFastDomVisitor3 = class(TCefDomVisitorOwn)
protected
FProc : TCefDomVisitorProc3;
FBrowser : ICefBrowser;
FFrame : ICefFrame;
FValue : ustring;
procedure visit(const document: ICefDomDocument); override;
public
constructor Create(const browser: ICefBrowser; const frame: ICefFrame; const proc: TCefDomVisitorProc3; const aValue : ustring); reintroduce; virtual;
destructor Destroy; override;
end;
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFTypes, uCEFDomDocument;
uCEFMiscFunctions, uCEFLibFunctions, uCEFDomDocument;
procedure cef_dom_visitor_visite(self: PCefDomVisitor; document: PCefDomDocument); stdcall;
var
@ -151,4 +166,30 @@ begin
FProc(FBrowser, FFrame, document);
end;
// TCefFastDomVisitor3
constructor TCefFastDomVisitor3.Create(const browser: ICefBrowser; const frame: ICefFrame; const proc: TCefDomVisitorProc3; const aValue : ustring);
begin
inherited Create;
FBrowser := browser;
FFrame := frame;
FProc := proc;
FValue := aValue;
end;
destructor TCefFastDomVisitor3.Destroy;
begin
FBrowser := nil;
FFrame := nil;
inherited Destroy;
end;
procedure TCefFastDomVisitor3.visit(const document: ICefDomDocument);
begin
FProc(FBrowser, FFrame, document, FValue);
end;
end.

View File

@ -236,6 +236,7 @@ type
TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean);
TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument);
TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument);
TCefDomVisitorProc3 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument; const aValue : ustring);
TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring);
TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(selectedAcceptFilter: Integer; const filePaths: TStrings);
TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure();

View File

@ -213,7 +213,7 @@ function CefClearCrossOriginWhitelist: Boolean;
procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo);
{$IFDEF MSWINDOWS}
function GetExtendedFileVersion(const aFileName : ustring) : uint64;
function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean;
function GetStringFileInfo(const aFileName, aField : ustring; var aValue : ustring) : boolean;
function GetDLLVersion(const aDLLFile : ustring; var aVersionInfo : TFileVersionInfo) : boolean;
procedure OutputLastErrorMessage;
{$ENDIF}
@ -1305,7 +1305,7 @@ begin
{$ENDIF}
end;
function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean;
function GetStringFileInfo(const aFileName, aField : ustring; var aValue : ustring) : boolean;
type
PLangAndCodepage = ^TLangAndCodepage;
TLangAndCodepage = record
@ -1317,7 +1317,7 @@ var
TempBuffer : pointer;
TempHandle : cardinal;
TempPointer : pointer;
TempSubBlock : string;
TempSubBlock : ustring;
TempLang : PLangAndCodepage;
TempArray : array of TLangAndCodepage;
i, j : DWORD;

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 145,
"InternalVersion" : 146,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "83.3.12.0"
}