From a3d361d8babdd95139826af27d48b11ef99a6c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Thu, 20 May 2021 16:59:01 +0200 Subject: [PATCH] Disable TNetEncoding calls for older Delphi versions in the MiniBrowser demo --- demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas | 42 ++++++++++++------- update_CEF4Delphi.json | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas index d6b108f3..4bb0b233 100644 --- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas +++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas @@ -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); diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index f343072c..9fd9182f 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 292, + "InternalVersion" : 293, "Name" : "cef4delphi_lazarus.lpk", "Version" : "90.6.5.0" }