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

View File

@ -49,7 +49,7 @@ unit uCEFDomVisitor;
interface interface
uses uses
uCEFBaseRefCounted, uCEFInterfaces; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type type
TCefDomVisitorOwn = class(TCefBaseRefCountedOwn, ICefDomVisitor) TCefDomVisitorOwn = class(TCefBaseRefCountedOwn, ICefDomVisitor)
@ -83,10 +83,25 @@ type
destructor Destroy; override; destructor Destroy; override;
end; 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 implementation
uses uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFTypes, uCEFDomDocument; uCEFMiscFunctions, uCEFLibFunctions, uCEFDomDocument;
procedure cef_dom_visitor_visite(self: PCefDomVisitor; document: PCefDomDocument); stdcall; procedure cef_dom_visitor_visite(self: PCefDomVisitor; document: PCefDomDocument); stdcall;
var var
@ -151,4 +166,30 @@ begin
FProc(FBrowser, FFrame, document); FProc(FBrowser, FFrame, document);
end; 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. end.

View File

@ -236,6 +236,7 @@ type
TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean); TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean);
TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument); 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); 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); TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring);
TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(selectedAcceptFilter: Integer; const filePaths: TStrings); TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(selectedAcceptFilter: Integer; const filePaths: TStrings);
TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(); 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); procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo);
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
function GetExtendedFileVersion(const aFileName : ustring) : uint64; 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; function GetDLLVersion(const aDLLFile : ustring; var aVersionInfo : TFileVersionInfo) : boolean;
procedure OutputLastErrorMessage; procedure OutputLastErrorMessage;
{$ENDIF} {$ENDIF}
@ -1305,7 +1305,7 @@ begin
{$ENDIF} {$ENDIF}
end; end;
function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean; function GetStringFileInfo(const aFileName, aField : ustring; var aValue : ustring) : boolean;
type type
PLangAndCodepage = ^TLangAndCodepage; PLangAndCodepage = ^TLangAndCodepage;
TLangAndCodepage = record TLangAndCodepage = record
@ -1317,7 +1317,7 @@ var
TempBuffer : pointer; TempBuffer : pointer;
TempHandle : cardinal; TempHandle : cardinal;
TempPointer : pointer; TempPointer : pointer;
TempSubBlock : string; TempSubBlock : ustring;
TempLang : PLangAndCodepage; TempLang : PLangAndCodepage;
TempArray : array of TLangAndCodepage; TempArray : array of TLangAndCodepage;
i, j : DWORD; i, j : DWORD;

View File

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