1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Disable TNetEncoding calls for older Delphi versions in the MiniBrowser demo

This commit is contained in:
Salvador Díaz Fau 2021-05-20 16:59:01 +02:00
parent c737b63a04
commit a3d361d8ba
2 changed files with 27 additions and 17 deletions

View File

@ -1221,25 +1221,35 @@ begin
begin
if (length(FDevToolsMsgValue) > 0) then
begin
TempData := nil;
if (aMessage.LParam = FScreenshotMsgID) then
begin
SaveDialog1.DefaultExt := 'png';
SaveDialog1.Filter := 'PNG files (*.png)|*.PNG';
{$IFDEF DELPHI21_UP}
// TO-DO: TNetEncoding was a new feature in Delphi XE7. Replace
// TNetEncoding.Base64.DecodeStringToBytes with Soap.EncdDecd.DecodeBase64 for older Delphi versions
TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue);
{$ENDIF}
end
else
if (aMessage.LParam = FMHTMLMsgID) then
begin
SaveDialog1.DefaultExt := 'png';
SaveDialog1.Filter := 'PNG files (*.png)|*.PNG';
TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue);
SaveDialog1.DefaultExt := 'mhtml';
SaveDialog1.Filter := 'MHTML files (*.mhtml)|*.MHTML';
TempData := BytesOf(FDevToolsMsgValue);
end
else
if (aMessage.LParam = FMHTMLMsgID) then
begin
SaveDialog1.DefaultExt := 'mhtml';
SaveDialog1.Filter := 'MHTML files (*.mhtml)|*.MHTML';
TempData := BytesOf(FDevToolsMsgValue);
end
else
begin
SaveDialog1.DefaultExt := '';
SaveDialog1.Filter := 'All files (*.*)|*.*';
TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue);
end;
else
begin
SaveDialog1.DefaultExt := '';
SaveDialog1.Filter := 'All files (*.*)|*.*';
{$IFDEF DELPHI21_UP}
// TO-DO: TNetEncoding was a new feature in Delphi XE7. Replace
// TNetEncoding.Base64.DecodeStringToBytes with Soap.EncdDecd.DecodeBase64 for older Delphi versions
TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue);
{$ENDIF}
end;
TempLen := length(TempData);

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 292,
"InternalVersion" : 293,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "90.6.5.0"
}