├── 11 ├── System.IOS.Beacon.RSP-21460.11.0.patch ├── System.Android.Sensors.RSP-35804.11.0.patch ├── FMX.Canvas.D2D.RSP-17030.11.0.patch └── FMX.MediaLibrary.iOS.RSP-20875.11.0.patch ├── Screenshots └── CodexSourcePatchConfig.png ├── LICENSE ├── 10.4.2 ├── Readme.md ├── System.IOS.Beacon.RSP-21460.10.4.2.patch ├── System.Android.Sensors.RSP-35804.10.4.2.patch ├── FMX.Canvas.D2D.RSP-17030.10.4.2.patch ├── FMX.MediaLibrary.iOS.RSP-20875.10.4.2.patch └── Data.DB.10.4.2.patch ├── .gitignore └── Readme.md /Screenshots/CodexSourcePatchConfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiWorlds/DelphiPatches/HEAD/Screenshots/CodexSourcePatchConfig.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 DelphiWorlds 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /10.4.2/Readme.md: -------------------------------------------------------------------------------- 1 | ## Patches for Delphi 10.4.2 2 | 3 | | Patch file | QP Report (if applicable) | Description | 4 | | ------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | 5 | | FMX.Canvas.D2D.RSP-17030.10.4.2.patch | [RSP-17030](https://quality.embarcadero.com/browse/RSP-17030) | FireMonkey will not correctly display fonts that are loaded dynamically on Windows | 6 | | FMX.MediaLibrary.iOS.RSP-20875.10.4.2.patch | [RSP-20875](https://quality.embarcadero.com/browse/RSP-20875) | Ios: Orientation of UIImagePickerController is inversed | 7 | | System.IOS.Beacon.RSP-21460.10.4.2.patch | [RSP-21460](https://quality.embarcadero.com/browse/RSP-21460) | Ranging of beacons in the background is not implemented | 8 | | System.Android.Sensors.RSP-35804.10.4.2.patch | [RSP-21460](https://quality.embarcadero.com/browse/RSP-35804) | Android 12: App crashing when a location change for a TLocationSensor is fired | 9 | | Data.DB.10.4.2.patch | [RSP-37176](https://quality.embarcadero.com/browse/RSP-37176) | VCL: Will improve speed for parameterized queries. Only tested with UNIDAC from Devart | 10 | -------------------------------------------------------------------------------- /11/System.IOS.Beacon.RSP-21460.11.0.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\rtl\\net\\System.IOS.Beacon.pas" "b/Z:\\Patches\\Delphi\\11\\System.IOS.Beacon.pas" 2 | index 80a3e47..0a5438f 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\rtl\\net\\System.IOS.Beacon.pas" 4 | +++ "b/Z:\\Patches\\Delphi\\11\\System.IOS.Beacon.pas" 5 | @@ -301,7 +301,12 @@ end; 6 | procedure TBeaconLocationManagerDelegate.locationManagerDidDetermineStateForRegion(manager: CLLocationManager; state: CLRegionState; 7 | region: CLRegion); 8 | begin 9 | - // For debug purposes 10 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 start 11 | + if state = CLRegionStateInside then 12 | + manager.startRangingBeaconsInRegion(TCLBeaconRegion.Wrap(NSObjectToID(region))) 13 | + else if state = CLRegionStateOutside then 14 | + manager.stopRangingBeaconsInRegion(TCLBeaconRegion.Wrap(NSObjectToID(region))); 15 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 end 16 | end; 17 | 18 | procedure TBeaconLocationManagerDelegate.locationManagerDidEnterRegion(manager: CLLocationManager; region: CLRegion); 19 | @@ -1562,7 +1567,9 @@ begin 20 | else if (Major <> MAJOR_REGION_ALL) and (Minor = MINOR_REGION_ALL) then 21 | Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorIdentifier(LNSUUID, Major, StrToNSStr(LIniGUID))) 22 | else 23 | - Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorMinorIdentifier(LNSUUID, Major, Minor, StrToNSStr(LIniGUID))) 24 | + Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorMinorIdentifier(LNSUUID, Major, Minor, StrToNSStr(LIniGUID))); 25 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 26 | + Result.setNotifyEntryStateOnDisplay(True); 27 | end; 28 | 29 | procedure TBeaconRegion.Initialilize(const AGUID: TGUID; AMajor, AMinor: Integer); 30 | -------------------------------------------------------------------------------- /10.4.2/System.IOS.Beacon.RSP-21460.10.4.2.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\rtl\\net\\System.IOS.Beacon.pas" "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\System.IOS.Beacon.pas" 2 | index 509ceff..aebaee0 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\rtl\\net\\System.IOS.Beacon.pas" 4 | +++ "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\System.IOS.Beacon.pas" 5 | @@ -301,7 +301,12 @@ end; 6 | procedure TBeaconLocationManagerDelegate.locationManagerDidDetermineStateForRegion(manager: CLLocationManager; state: CLRegionState; 7 | region: CLRegion); 8 | begin 9 | - // For debug purposes 10 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 start 11 | + if state = CLRegionStateInside then 12 | + manager.startRangingBeaconsInRegion(TCLBeaconRegion.Wrap(NSObjectToID(region))) 13 | + else if state = CLRegionStateOutside then 14 | + manager.stopRangingBeaconsInRegion(TCLBeaconRegion.Wrap(NSObjectToID(region))); 15 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 end 16 | end; 17 | 18 | procedure TBeaconLocationManagerDelegate.locationManagerDidEnterRegion(manager: CLLocationManager; region: CLRegion); 19 | @@ -1562,7 +1567,9 @@ begin 20 | else if (Major <> MAJOR_REGION_ALL) and (Minor = MINOR_REGION_ALL) then 21 | Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorIdentifier(LNSUUID, Major, StrToNSStr(LIniGUID))) 22 | else 23 | - Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorMinorIdentifier(LNSUUID, Major, Minor, StrToNSStr(LIniGUID))) 24 | + Result := TCLBeaconRegion.Wrap(TCLBeaconRegion.Alloc.initWithProximityUUIDMajorMinorIdentifier(LNSUUID, Major, Minor, StrToNSStr(LIniGUID))); 25 | + // PATCH https://quality.embarcadero.com/browse/RSP-21460 26 | + Result.setNotifyEntryStateOnDisplay(True); 27 | end; 28 | 29 | procedure TBeaconRegion.Initialilize(const AGUID: TGUID; AMajor, AMinor: Integer); 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | 68 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 69 | modules/ 70 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## Delphi Patches 2 | 3 | This repository is a collection of patch files that can be applied to Delphi source to resolve various issues 4 | 5 | ### What are the patch files? 6 | 7 | The patch files are created by modifying the Delphi source, then using the `git diff` command from [Git](https://git-scm.com/) to generate differences between the original and the modification. 8 | 9 | The naming convention used for patch files is: 10 | 11 | * Original source file name minus the extension, plus 12 | * Quality Portal report number, if applicable, plus 13 | * Delphi version that the patch applies to (e.g. 10.4.2), plus 14 | * `.patch` extension 15 | 16 | e.g. FMX.Canvas.D2D.RSP-17030.10.4.2.patch is a patch for FMX.Canvas.D2D.pas for an issue reported [here](https://quality.embarcadero.com/browse/RSP-17030), and applies to Delphi 10.4.2 17 | 18 | Patches in this repository will contain non-breaking changes only, i.e. there will be no patches that include changes to the `interface` section of a unit. This is to reduce the likelihood that other unchanged source needs to be in the compiler path. 19 | 20 | ### Who creates the patch files? 21 | 22 | The patch files are created by Dave Nottage of Delphi Worlds, and anyone else that wishes to contribute 23 | 24 | ### Why create patch files? 25 | 26 | To solve issues in the Delphi source, of course! Also, Delphi source files (excluding auto-generated source, e.g. many of the API imports) are copyrighted, so entire files cannot be distributed publicly without permission 27 | 28 | ### How to apply the patch files 29 | 30 | Since the patch files are generated by using Git, it is recommended that you [install Git](https://git-scm.com/download/win) (even if you do not use it for source control), which includes a function that can be used to apply the patches 31 | 32 | To make patching source files a breeze, the [Codex Delphi add-in](https://github.com/DelphiWorlds/Codex) has been updated (version 1.4) to include this functionality. Here's a step-by-step: 33 | 34 | * Clone this repo 35 | * Install [Codex 1.4](https://github.com/DelphiWorlds/Codex/blob/master/Bin/CodexSetup_1.4.0.exe) (close Delphi first) 36 | * Open Delphi, go to Tools|Codex|Options, Source Patch tab, configure `Default location for patch files` to the repo location and configure the other options as applicable, e.g.: 37 | 38 | Codex Source Patch Config 39 | 40 | When a patch (or patches) becomes available, in Delphi go to Tools|Codex|Source Patch > Patch source, select a patch file, and click Open. Codex will then: 41 | 42 | * Attempt to find a source file that matches the patch file name. This is why they start with the original filename, and end with an extension of the applicable Delphi version, then `.patch` 43 | * If a matching source file is not found, Codex will prompt you to select the relevant source file 44 | * If a matching source file is found, Codex will copy the original source into the location configured in the Codex > Source Patch options, or will prompt for a location to copy to 45 | * Codex will then apply the patch to the copy of the source 46 | 47 | Codex makes a copy of the source file before applying the patch because it is good practice to leave the originals intact 48 | 49 | You can patch the source manually if you choose to; just remember that the tool you use to apply the patches needs to understand the format of the patch file 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /11/System.Android.Sensors.RSP-35804.11.0.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\rtl\\common\\System.Android.Sensors.pas" "b/Z:\\Patches\\Delphi\\11\\System.Android.Sensors.pas" 2 | index f72143f..5d6593a 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\rtl\\common\\System.Android.Sensors.pas" 4 | +++ "b/Z:\\Patches\\Delphi\\11\\System.Android.Sensors.pas" 5 | @@ -95,6 +95,16 @@ type 6 | class procedure Cancel; override; 7 | end; 8 | 9 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 10 | + [JavaSignature('android/location/LocationListener')] 11 | + JLocationListenerEx = interface(Androidapi.JNI.Location.JLocationListener) 12 | + ['{5D5C6F82-08E9-4D0F-9D1D-14D2D5BD7710}'] 13 | + procedure onLocationChanged(P1: JArrayList); overload; cdecl; 14 | + procedure onLocationChanged(P1: JLocation); overload; cdecl; 15 | + procedure onLocationChanged(P1: JObject); overload; cdecl; 16 | + end; 17 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 18 | + 19 | TUIAndroidLocationSensor = class(TCustomLocationSensor) 20 | private 21 | FPermitted: Boolean; 22 | @@ -103,12 +113,19 @@ type 23 | FAccuracy: TLocationAccuracy; 24 | FDistance: TLocationDistance; 25 | type 26 | - TLocationListener = class(TJavaLocal, JLocationListener) 27 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 28 | + // TLocationListener = class(TJavaLocal, JLocationListener) 29 | + TLocationListener = class(TJavaLocal, JLocationListener, JLocationListenerEx) 30 | private 31 | FLocationSensor: TUIAndroidLocationSensor; 32 | public 33 | constructor Create(ALocationSensor: TUIAndroidLocationSensor); 34 | - procedure onLocationChanged(P1: JLocation); cdecl; 35 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 36 | + // procedure onLocationChanged(P1: JLocation); cdecl; 37 | + procedure onLocationChanged(P1: JArrayList); overload; cdecl; 38 | + procedure onLocationChanged(P1: JLocation); overload; cdecl; 39 | + procedure onLocationChanged(P1: JObject); overload; cdecl; 40 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 41 | procedure onStatusChanged(P1: JString; P2: Integer; P3: JBundle); cdecl; 42 | procedure onProviderEnabled(P1: JString); cdecl; 43 | procedure onProviderDisabled(P1: JString); cdecl; 44 | @@ -978,6 +995,24 @@ begin 45 | FLocationSensor := ALocationSensor; 46 | end; 47 | 48 | +// PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 49 | +procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JArrayList); 50 | +begin 51 | + if TJNIResolver.IsInstanceOf(P1, TJLocation.GetClsID) then 52 | + onLocationChanged(TJLocation.Wrap(P1)) 53 | + else 54 | + onLocationChanged(TJLocation.Wrap(P1.get(P1.size - 1))); 55 | +end; 56 | + 57 | +procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JObject); 58 | +begin 59 | + if TJNIResolver.IsInstanceOf(P1, TJArrayList.GetClsID) then 60 | + onLocationChanged(TJArrayList.Wrap(P1)) 61 | + else if TJNIResolver.IsInstanceOf(P1, TJLocation.GetClsID) then 62 | + onLocationChanged(TJLocation.Wrap(P1)); 63 | +end; 64 | +// PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 65 | + 66 | procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JLocation); 67 | var 68 | OldLocation, CurrentLocation: TLocationCoord2D; 69 | @@ -1033,7 +1068,9 @@ const 70 | cMinTime = 100; 71 | cMinDistance = 10; 72 | begin 73 | - FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener); 74 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 75 | + // FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener); 76 | + FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener as JLocationListener); 77 | end; 78 | 79 | { TUIAndroidLocationSensor } 80 | @@ -1140,12 +1177,20 @@ end; 81 | procedure TUIAndroidLocationSensor.DoStop; 82 | begin 83 | inherited; 84 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 85 | + // if FPassiveListener <> nil then 86 | + // FLocationManager.removeUpdates(FPassiveListener); 87 | + // if FNetworkListener <> nil then 88 | + // FLocationManager.removeUpdates(FNetworkListener); 89 | + // if FGPSListener <> nil then 90 | + // FLocationManager.removeUpdates(FGPSListener); 91 | if FPassiveListener <> nil then 92 | - FLocationManager.removeUpdates(FPassiveListener); 93 | + FLocationManager.removeUpdates(FPassiveListener as JLocationListener); 94 | if FNetworkListener <> nil then 95 | - FLocationManager.removeUpdates(FNetworkListener); 96 | + FLocationManager.removeUpdates(FNetworkListener as JLocationListener); 97 | if FGPSListener <> nil then 98 | - FLocationManager.removeUpdates(FGPSListener); 99 | + FLocationManager.removeUpdates(FGPSListener as JLocationListener); 100 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 101 | end; 102 | 103 | function TUIAndroidLocationSensor.GetAccuracy: TLocationAccuracy; 104 | -------------------------------------------------------------------------------- /10.4.2/System.Android.Sensors.RSP-35804.10.4.2.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\rtl\\common\\System.Android.Sensors.pas" "b/Z:\\Patches\\Delphi\\10.4.2\\System.Android.Sensors.pas" 2 | index 330a6e7..62f3c77 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\rtl\\common\\System.Android.Sensors.pas" 4 | +++ "b/Z:\\Patches\\Delphi\\10.4.2\\System.Android.Sensors.pas" 5 | @@ -95,6 +95,16 @@ type 6 | class procedure Cancel; override; 7 | end; 8 | 9 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 10 | + [JavaSignature('android/location/LocationListener')] 11 | + JLocationListenerEx = interface(Androidapi.JNI.Location.JLocationListener) 12 | + ['{5D5C6F82-08E9-4D0F-9D1D-14D2D5BD7710}'] 13 | + procedure onLocationChanged(P1: JArrayList); overload; cdecl; 14 | + procedure onLocationChanged(P1: JLocation); overload; cdecl; 15 | + procedure onLocationChanged(P1: JObject); overload; cdecl; 16 | + end; 17 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 18 | + 19 | TUIAndroidLocationSensor = class(TCustomLocationSensor) 20 | private 21 | FPermitted: Boolean; 22 | @@ -103,12 +113,19 @@ type 23 | FAccuracy: TLocationAccuracy; 24 | FDistance: TLocationDistance; 25 | type 26 | - TLocationListener = class(TJavaLocal, JLocationListener) 27 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 28 | + // TLocationListener = class(TJavaLocal, JLocationListener) 29 | + TLocationListener = class(TJavaLocal, JLocationListener, JLocationListenerEx) 30 | private 31 | FLocationSensor: TUIAndroidLocationSensor; 32 | public 33 | constructor Create(ALocationSensor: TUIAndroidLocationSensor); 34 | - procedure onLocationChanged(P1: JLocation); cdecl; 35 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 36 | + // procedure onLocationChanged(P1: JLocation); cdecl; 37 | + procedure onLocationChanged(P1: JArrayList); overload; cdecl; 38 | + procedure onLocationChanged(P1: JLocation); overload; cdecl; 39 | + procedure onLocationChanged(P1: JObject); overload; cdecl; 40 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 41 | procedure onStatusChanged(P1: JString; P2: Integer; P3: JBundle); cdecl; 42 | procedure onProviderEnabled(P1: JString); cdecl; 43 | procedure onProviderDisabled(P1: JString); cdecl; 44 | @@ -978,6 +995,24 @@ begin 45 | FLocationSensor := ALocationSensor; 46 | end; 47 | 48 | +// PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 49 | +procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JArrayList); 50 | +begin 51 | + if TJNIResolver.IsInstanceOf(P1, TJLocation.GetClsID) then 52 | + onLocationChanged(TJLocation.Wrap(P1)) 53 | + else 54 | + onLocationChanged(TJLocation.Wrap(P1.get(P1.size - 1))); 55 | +end; 56 | + 57 | +procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JObject); 58 | +begin 59 | + if TJNIResolver.IsInstanceOf(P1, TJArrayList.GetClsID) then 60 | + onLocationChanged(TJArrayList.Wrap(P1)) 61 | + else if TJNIResolver.IsInstanceOf(P1, TJLocation.GetClsID) then 62 | + onLocationChanged(TJLocation.Wrap(P1)); 63 | +end; 64 | +// PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 65 | + 66 | procedure TUIAndroidLocationSensor.TLocationListener.onLocationChanged(P1: JLocation); 67 | var 68 | OldLocation, CurrentLocation: TLocationCoord2D; 69 | @@ -1033,7 +1068,9 @@ const 70 | cMinTime = 100; 71 | cMinDistance = 10; 72 | begin 73 | - FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener); 74 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 75 | + // FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener); 76 | + FLocationManager.requestLocationUpdates( FProvider, cMinTime, cMinDistance, FListener as JLocationListener); 77 | end; 78 | 79 | { TUIAndroidLocationSensor } 80 | @@ -1140,12 +1177,20 @@ end; 81 | procedure TUIAndroidLocationSensor.DoStop; 82 | begin 83 | inherited; 84 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 BEGIN 85 | + // if FPassiveListener <> nil then 86 | + // FLocationManager.removeUpdates(FPassiveListener); 87 | + // if FNetworkListener <> nil then 88 | + // FLocationManager.removeUpdates(FNetworkListener); 89 | + // if FGPSListener <> nil then 90 | + // FLocationManager.removeUpdates(FGPSListener); 91 | if FPassiveListener <> nil then 92 | - FLocationManager.removeUpdates(FPassiveListener); 93 | + FLocationManager.removeUpdates(FPassiveListener as JLocationListener); 94 | if FNetworkListener <> nil then 95 | - FLocationManager.removeUpdates(FNetworkListener); 96 | + FLocationManager.removeUpdates(FNetworkListener as JLocationListener); 97 | if FGPSListener <> nil then 98 | - FLocationManager.removeUpdates(FGPSListener); 99 | + FLocationManager.removeUpdates(FGPSListener as JLocationListener); 100 | + // PATCH: https://quality.embarcadero.com/browse/RSP-35804 END 101 | end; 102 | 103 | function TUIAndroidLocationSensor.GetAccuracy: TLocationAccuracy; 104 | -------------------------------------------------------------------------------- /11/FMX.Canvas.D2D.RSP-17030.11.0.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\fmx\\FMX.Canvas.D2D.pas" "b/Z:\\Patches\\Delphi\\11\\FMX.Canvas.D2D.pas" 2 | index 1437edd..40185b5 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\fmx\\FMX.Canvas.D2D.pas" 4 | +++ "b/Z:\\Patches\\Delphi\\11\\FMX.Canvas.D2D.pas" 5 | @@ -288,6 +288,31 @@ type 6 | procedure ConvertToPath(const APath: TPathData); override; 7 | end; 8 | 9 | +// PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 10 | +const 11 | + SID_IDWriteGdiInterop1 = '{4556BE70-3ABD-4F70-90BE-421780A6F515}'; 12 | + 13 | +type 14 | + IDWriteGdiInterop1 = interface(IDWriteGdiInterop) 15 | + [SID_IDWriteGdiInterop1] 16 | + function CreateFontFromLOGFONT(var logFont: LOGFONTW; 17 | + fontCollection : IDWriteFontCollection; 18 | + out font: IDWriteFont): HResult; stdcall; 19 | + 20 | + function GetFontSignature( 21 | + font : IDWriteFont; 22 | + out fontSignatre : FONTSIGNATURE): HResult; stdcall; overload; 23 | + 24 | + function GetFontSignature( 25 | + fontFace : IDWriteFontFace; 26 | + out fontSignatre : FONTSIGNATURE): HResult; stdcall; overload; 27 | + 28 | + function GetMatchingFontsByLOGFONT(const logFont: LOGFONTW; 29 | + fontSet : IDWriteFont{IDWriteFontSet}; 30 | + out filteredSet : IDWriteFont {IDWriteFontSet}): HResult; stdcall; 31 | + end; 32 | +// PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 33 | + 34 | var 35 | PrevFPUState: TArithmeticExceptionMask; 36 | 37 | @@ -2566,12 +2591,18 @@ var 38 | Names: IDWriteLocalizedStrings; 39 | LocaleName: array [0..LOCALE_NAME_MAX_LENGTH] of Char; 40 | LDC: HDC; 41 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 42 | + DWriteGDIInterop1: IDWriteGdiInterop1; 43 | + DWriteFontFace: IDWriteFontFace; 44 | + I: Integer; 45 | + LResult: HResult; 46 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 47 | begin 48 | Result := TDWriteFontDescriptor.Create(AFont.Family, FontWeightToDWrite(AFont.StyleExt.Weight), 49 | FontSlantToDWrite(AFont.StyleExt.Slant), FontStretchToDWrite(AFont.StyleExt.Stretch)); 50 | 51 | if FFontCollection = nil then 52 | - TCanvasD2D.SharedDWriteFactory.GetSystemFontCollection(FFontCollection); 53 | + TCanvasD2D.SharedDWriteFactory.GetSystemFontCollection(FFontCollection, False); // PATCH: https://quality.embarcadero.com/browse/RSP-17030 54 | FFontCollection.FindFamilyName(PChar(AFont.Family), FamilyIndex, FamilyExists); 55 | if not FamilyExists then 56 | begin 57 | @@ -2587,10 +2618,23 @@ begin 58 | LDC := GetDC(0); 59 | try 60 | EnumFontFamiliesEx(LDC, LogFont, @EnumFontFamExProc, NativeInt(@LogFont), 0); 61 | - finally 62 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 63 | + DWriteFont := nil; 64 | + LResult := DWriteGdiInterop.CreateFontFaceFromHdc(LDC, DWriteFontFace); 65 | + if Succeeded(LResult) then 66 | + begin 67 | + FFontCollection.GetFontFromFontFace(DWriteFontFace, DWriteFont); 68 | + DWriteFontFace := nil; 69 | + end; 70 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 71 | + finally 72 | ReleaseDC(0, LDC); 73 | end; 74 | - if Succeeded(DWriteGdiInterop.CreateFontFromLOGFONT(LogFont, DWriteFont)) then 75 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 76 | + // if Succeeded(DWriteGdiInterop.CreateFontFromLOGFONT(LogFont, DWriteFont)) then 77 | + DWriteGdiInterop1 := DWriteGdiInterop as IDWriteGdiInterop1; 78 | + if (DWriteFont <> nil) or Succeeded(DWriteGdiInterop1.CreateFontFromLOGFONT(LogFont, nil, DWriteFont)) then 79 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 80 | try 81 | if Succeeded(DWriteFont.GetFontFamily(DWriteFamily)) then 82 | try 83 | @@ -2702,8 +2746,13 @@ begin 84 | 85 | FontDescriptor := GetFontStyles(Font); 86 | 87 | - if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), FFontCollection, 88 | - FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size, PChar(FLocaleName), TextFormat)) then 89 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 90 | + // if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), FFontCollection, 91 | + // FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size, PChar(FLocaleName), TextFormat)) then 92 | + 93 | + if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), nil, 94 | + FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size,PChar(FLocaleName), TextFormat)) then 95 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 96 | try 97 | if RightToLeft then 98 | TextFormat.SetReadingDirection(DWRITE_READING_DIRECTION_RIGHT_TO_LEFT) 99 | @@ -2795,7 +2844,10 @@ var 100 | LFont: PLogFont; 101 | begin 102 | LFont := Pointer(lParam); 103 | - Move(lpelfe, LFont^, SizeOf(TLogFont)); 104 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 105 | + LFont^ := lpelfe; 106 | + //Move(lpelfe, LFont^, SizeOf(TLogFont)); 107 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 108 | Result := 0; 109 | end; 110 | 111 | -------------------------------------------------------------------------------- /10.4.2/FMX.Canvas.D2D.RSP-17030.10.4.2.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\fmx\\FMX.Canvas.D2D.pas" "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\FMX.Canvas.D2D.pas" 2 | index 9bad476..e9341b7 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\fmx\\FMX.Canvas.D2D.pas" 4 | +++ "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\FMX.Canvas.D2D.pas" 5 | @@ -282,6 +282,31 @@ type 6 | procedure ConvertToPath(const APath: TPathData); override; 7 | end; 8 | 9 | +// PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 10 | +const 11 | + SID_IDWriteGdiInterop1 = '{4556BE70-3ABD-4F70-90BE-421780A6F515}'; 12 | + 13 | +type 14 | + IDWriteGdiInterop1 = interface(IDWriteGdiInterop) 15 | + [SID_IDWriteGdiInterop1] 16 | + function CreateFontFromLOGFONT(var logFont: LOGFONTW; 17 | + fontCollection : IDWriteFontCollection; 18 | + out font: IDWriteFont): HResult; stdcall; 19 | + 20 | + function GetFontSignature( 21 | + font : IDWriteFont; 22 | + out fontSignatre : FONTSIGNATURE): HResult; stdcall; overload; 23 | + 24 | + function GetFontSignature( 25 | + fontFace : IDWriteFontFace; 26 | + out fontSignatre : FONTSIGNATURE): HResult; stdcall; overload; 27 | + 28 | + function GetMatchingFontsByLOGFONT(const logFont: LOGFONTW; 29 | + fontSet : IDWriteFont{IDWriteFontSet}; 30 | + out filteredSet : IDWriteFont {IDWriteFontSet}): HResult; stdcall; 31 | + end; 32 | +// PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 33 | + 34 | var 35 | PrevFPUState: TArithmeticExceptionMask; 36 | 37 | @@ -2533,12 +2558,18 @@ var 38 | Names: IDWriteLocalizedStrings; 39 | LocaleName: array [0..LOCALE_NAME_MAX_LENGTH] of Char; 40 | LDC: HDC; 41 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 42 | + DWriteGDIInterop1: IDWriteGdiInterop1; 43 | + DWriteFontFace: IDWriteFontFace; 44 | + I: Integer; 45 | + LResult: HResult; 46 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 47 | begin 48 | Result := TDWriteFontDescriptor.Create(AFont.Family, FontWeightToDWrite(AFont.StyleExt.Weight), 49 | FontSlantToDWrite(AFont.StyleExt.Slant), FontStretchToDWrite(AFont.StyleExt.Stretch)); 50 | 51 | if FFontCollection = nil then 52 | - TCanvasD2D.SharedDWriteFactory.GetSystemFontCollection(FFontCollection); 53 | + TCanvasD2D.SharedDWriteFactory.GetSystemFontCollection(FFontCollection, False); // PATCH: https://quality.embarcadero.com/browse/RSP-17030 54 | FFontCollection.FindFamilyName(PChar(AFont.Family), FamilyIndex, FamilyExists); 55 | if not FamilyExists then 56 | begin 57 | @@ -2554,10 +2585,23 @@ begin 58 | LDC := GetDC(0); 59 | try 60 | EnumFontFamiliesEx(LDC, LogFont, @EnumFontFamExProc, NativeInt(@LogFont), 0); 61 | - finally 62 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 63 | + DWriteFont := nil; 64 | + LResult := DWriteGdiInterop.CreateFontFaceFromHdc(LDC, DWriteFontFace); 65 | + if Succeeded(LResult) then 66 | + begin 67 | + FFontCollection.GetFontFromFontFace(DWriteFontFace, DWriteFont); 68 | + DWriteFontFace := nil; 69 | + end; 70 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 71 | + finally 72 | ReleaseDC(0, LDC); 73 | end; 74 | - if Succeeded(DWriteGdiInterop.CreateFontFromLOGFONT(LogFont, DWriteFont)) then 75 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 76 | + // if Succeeded(DWriteGdiInterop.CreateFontFromLOGFONT(LogFont, DWriteFont)) then 77 | + DWriteGdiInterop1 := DWriteGdiInterop as IDWriteGdiInterop1; 78 | + if (DWriteFont <> nil) or Succeeded(DWriteGdiInterop1.CreateFontFromLOGFONT(LogFont, nil, DWriteFont)) then 79 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 80 | try 81 | if Succeeded(DWriteFont.GetFontFamily(DWriteFamily)) then 82 | try 83 | @@ -2669,8 +2713,13 @@ begin 84 | 85 | FontDescriptor := GetFontStyles(Font); 86 | 87 | - if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), FFontCollection, 88 | - FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size, PChar(FLocaleName), TextFormat)) then 89 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 90 | + // if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), FFontCollection, 91 | + // FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size, PChar(FLocaleName), TextFormat)) then 92 | + 93 | + if Succeeded(TCanvasD2D.SharedDWriteFactory.CreateTextFormat(PChar(FontDescriptor.FamilyName), nil, 94 | + FontDescriptor.Weight, FontDescriptor.Style, FontDescriptor.Stretch, Font.Size,PChar(FLocaleName), TextFormat)) then 95 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 96 | try 97 | if RightToLeft then 98 | TextFormat.SetReadingDirection(DWRITE_READING_DIRECTION_RIGHT_TO_LEFT) 99 | @@ -2762,7 +2811,10 @@ var 100 | LFont: PLogFont; 101 | begin 102 | LFont := Pointer(lParam); 103 | - Move(lpelfe, LFont^, SizeOf(TLogFont)); 104 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 start 105 | + LFont^ := lpelfe; 106 | + //Move(lpelfe, LFont^, SizeOf(TLogFont)); 107 | + // PATCH: https://quality.embarcadero.com/browse/RSP-17030 end 108 | Result := 0; 109 | end; 110 | 111 | -------------------------------------------------------------------------------- /11/FMX.MediaLibrary.iOS.RSP-20875.11.0.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\fmx\\FMX.MediaLibrary.iOS.pas" "b/Z:\\Patches\\Delphi\\11\\FMX.MediaLibrary.iOS.pas" 2 | index 77fce7c..d4a0498 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\22.0\\source\\fmx\\FMX.MediaLibrary.iOS.pas" 4 | +++ "b/Z:\\Patches\\Delphi\\11\\FMX.MediaLibrary.iOS.pas" 5 | @@ -21,6 +21,8 @@ uses 6 | System.SysUtils, System.Classes, System.Types, System.Math, System.Generics.Collections, 7 | FMX.MediaLibrary, FMX.Types, FMX.Types3D, FMX.Controls, 8 | FMX.Platform, FMX.Graphics, FMX.Helpers.iOS, iOSapi.MediaPlayer, iOSapi.Foundation, iOSapi.UIKit, iOSapi.CoreGraphics, 9 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 10 | + iOSapi.CocoaTypes, 11 | Macapi.ObjectiveC, Macapi.Helpers, iOSapi.AssetsLibrary, System.TypInfo, Macapi.ObjCRuntime, FMX.Consts; 12 | 13 | type 14 | @@ -67,6 +69,8 @@ type 15 | TImageDelegate = class(TOCLocal, UIImagePickerControllerDelegate) 16 | private 17 | [Weak] FImageManager: TImageManagerCocoa; 18 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 19 | + FIsFullScreen: Boolean; 20 | FParams: TParamsPhotoQuery; 21 | protected 22 | procedure DoDidFinishTaking(const AImage: TBitmap); 23 | @@ -75,6 +79,8 @@ type 24 | function GetAngleOfImageOrientation(const AImage: UIImage): Single; 25 | public 26 | constructor Create(const AImageManager: TImageManagerCocoa); 27 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 28 | + property IsFullScreen: Boolean read FIsFullScreen write FIsFullScreen; 29 | property Params: TParamsPhotoQuery read FParams write FParams; 30 | { UIImagePickerControllerDelegate } 31 | procedure imagePickerController(picker: UIImagePickerController; didFinishPickingImage: UIImage; editingInfo: NSDictionary); overload; cdecl; 32 | @@ -95,6 +101,40 @@ type 33 | procedure Share(const AControl: TControl; const AText: string; const ABitmap: TBitmap); 34 | end; 35 | 36 | +// PATCH https://quality.embarcadero.com/browse/RSP-20875 start 37 | + IImagePickerController = interface(UIImagePickerController) 38 | + ['{B9BB3FA5-9C0D-4BFA-A905-6575B09A972E}'] 39 | + end; 40 | + 41 | + TImagePickerController = class(TOCLocal) 42 | + protected 43 | + function GetObjectiveCClass: PTypeInfo; override; 44 | + public 45 | + constructor Create; 46 | + function supportedInterfaceOrientations: NSUInteger; cdecl; 47 | + end; 48 | + 49 | +constructor TImagePickerController.Create; 50 | +var 51 | + V: Pointer; 52 | +begin 53 | + inherited; 54 | + V := UIImagePickerController(Super).init; 55 | + if GetObjectID <> V then 56 | + UpdateObjectID(V); 57 | +end; 58 | + 59 | +function TImagePickerController.GetObjectiveCClass: PTypeInfo; 60 | +begin 61 | + Result := TypeInfo(IImagePickerController); 62 | +end; 63 | + 64 | +function TImagePickerController.supportedInterfaceOrientations: NSUInteger; 65 | +begin 66 | + Result := SharedApplication.keyWindow.rootViewController.supportedInterfaceOrientations; 67 | +end; 68 | +// PATCH https://quality.embarcadero.com/browse/RSP-20875 end 69 | + 70 | procedure RegisterMediaLibraryServices; 71 | var 72 | ImageManager: TImageManagerCocoa; 73 | @@ -229,10 +269,15 @@ procedure TImageManagerCocoa.TakeImage(const AControl: TControl; const ASourceTy 74 | procedure ShowPicker; 75 | begin 76 | // Camera for iPad is showed only in full screen on iPad and iPhone 77 | - if not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera) then 78 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 79 | + // If you want the picker to be full screen *always*, modify the next line to: FImageDelegate.IsFullScreen := True; 80 | + FImageDelegate.IsFullScreen := not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera); 81 | + // if not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera) then 82 | + if FImageDelegate.IsFullScreen then 83 | ShowInFullScreen 84 | else 85 | ShowInPopover; 86 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 87 | end; 88 | 89 | begin 90 | @@ -243,7 +288,11 @@ begin 91 | FImagePicker.setDelegate(nil); 92 | FImagePicker.release; 93 | end; 94 | - FImagePicker := TUIImagePickerController.Create; 95 | + 96 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 97 | + // FImagePicker := TUIImagePickerController.Create; 98 | + FImagePicker := UIImagePickerController(TImagePickerController.Create.Super); 99 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 100 | FImagePicker.retain; 101 | FImagePicker.setDelegate(FImageDelegate.GetObjectID); 102 | 103 | @@ -311,10 +360,13 @@ end; 104 | 105 | procedure TImageDelegate.HidePicker(const APicker: UIImagePickerController); 106 | begin 107 | - if (FImageManager <> nil) and IsPad and (APicker.sourceType <> UIImagePickerControllerSourceTypeCamera) then 108 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 109 | + // if (FImageManager <> nil) and IsPad and (APicker.sourceType <> UIImagePickerControllerSourceTypeCamera) then 110 | + if (FImageManager <> nil) and not FIsFullScreen then 111 | FImageManager.ClosePopover 112 | else 113 | APicker.dismissModalViewControllerAnimated(True); 114 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 115 | end; 116 | 117 | procedure TImageDelegate.imagePickerController(picker: UIImagePickerController; didFinishPickingImage: UIImage; 118 | -------------------------------------------------------------------------------- /10.4.2/FMX.MediaLibrary.iOS.RSP-20875.10.4.2.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\fmx\\FMX.MediaLibrary.iOS.pas" "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\FMX.MediaLibrary.iOS.pas" 2 | index 77fce7c..d4a0498 100644 3 | --- "a/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\fmx\\FMX.MediaLibrary.iOS.pas" 4 | +++ "b/Z:\\Patches\\Private\\Delphi\\10.4.2\\FMX.MediaLibrary.iOS.pas" 5 | @@ -21,6 +21,8 @@ uses 6 | System.SysUtils, System.Classes, System.Types, System.Math, System.Generics.Collections, 7 | FMX.MediaLibrary, FMX.Types, FMX.Types3D, FMX.Controls, 8 | FMX.Platform, FMX.Graphics, FMX.Helpers.iOS, iOSapi.MediaPlayer, iOSapi.Foundation, iOSapi.UIKit, iOSapi.CoreGraphics, 9 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 10 | + iOSapi.CocoaTypes, 11 | Macapi.ObjectiveC, Macapi.Helpers, iOSapi.AssetsLibrary, System.TypInfo, Macapi.ObjCRuntime, FMX.Consts; 12 | 13 | type 14 | @@ -67,6 +69,8 @@ type 15 | TImageDelegate = class(TOCLocal, UIImagePickerControllerDelegate) 16 | private 17 | [Weak] FImageManager: TImageManagerCocoa; 18 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 19 | + FIsFullScreen: Boolean; 20 | FParams: TParamsPhotoQuery; 21 | protected 22 | procedure DoDidFinishTaking(const AImage: TBitmap); 23 | @@ -75,6 +79,8 @@ type 24 | function GetAngleOfImageOrientation(const AImage: UIImage): Single; 25 | public 26 | constructor Create(const AImageManager: TImageManagerCocoa); 27 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 28 | + property IsFullScreen: Boolean read FIsFullScreen write FIsFullScreen; 29 | property Params: TParamsPhotoQuery read FParams write FParams; 30 | { UIImagePickerControllerDelegate } 31 | procedure imagePickerController(picker: UIImagePickerController; didFinishPickingImage: UIImage; editingInfo: NSDictionary); overload; cdecl; 32 | @@ -95,6 +101,40 @@ type 33 | procedure Share(const AControl: TControl; const AText: string; const ABitmap: TBitmap); 34 | end; 35 | 36 | +// PATCH https://quality.embarcadero.com/browse/RSP-20875 start 37 | + IImagePickerController = interface(UIImagePickerController) 38 | + ['{B9BB3FA5-9C0D-4BFA-A905-6575B09A972E}'] 39 | + end; 40 | + 41 | + TImagePickerController = class(TOCLocal) 42 | + protected 43 | + function GetObjectiveCClass: PTypeInfo; override; 44 | + public 45 | + constructor Create; 46 | + function supportedInterfaceOrientations: NSUInteger; cdecl; 47 | + end; 48 | + 49 | +constructor TImagePickerController.Create; 50 | +var 51 | + V: Pointer; 52 | +begin 53 | + inherited; 54 | + V := UIImagePickerController(Super).init; 55 | + if GetObjectID <> V then 56 | + UpdateObjectID(V); 57 | +end; 58 | + 59 | +function TImagePickerController.GetObjectiveCClass: PTypeInfo; 60 | +begin 61 | + Result := TypeInfo(IImagePickerController); 62 | +end; 63 | + 64 | +function TImagePickerController.supportedInterfaceOrientations: NSUInteger; 65 | +begin 66 | + Result := SharedApplication.keyWindow.rootViewController.supportedInterfaceOrientations; 67 | +end; 68 | +// PATCH https://quality.embarcadero.com/browse/RSP-20875 end 69 | + 70 | procedure RegisterMediaLibraryServices; 71 | var 72 | ImageManager: TImageManagerCocoa; 73 | @@ -229,10 +269,15 @@ procedure TImageManagerCocoa.TakeImage(const AControl: TControl; const ASourceTy 74 | procedure ShowPicker; 75 | begin 76 | // Camera for iPad is showed only in full screen on iPad and iPhone 77 | - if not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera) then 78 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 79 | + // If you want the picker to be full screen *always*, modify the next line to: FImageDelegate.IsFullScreen := True; 80 | + FImageDelegate.IsFullScreen := not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera); 81 | + // if not IsPad or (ASourceType = UIImagePickerControllerSourceTypeCamera) then 82 | + if FImageDelegate.IsFullScreen then 83 | ShowInFullScreen 84 | else 85 | ShowInPopover; 86 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 87 | end; 88 | 89 | begin 90 | @@ -243,7 +288,11 @@ begin 91 | FImagePicker.setDelegate(nil); 92 | FImagePicker.release; 93 | end; 94 | - FImagePicker := TUIImagePickerController.Create; 95 | + 96 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 97 | + // FImagePicker := TUIImagePickerController.Create; 98 | + FImagePicker := UIImagePickerController(TImagePickerController.Create.Super); 99 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 100 | FImagePicker.retain; 101 | FImagePicker.setDelegate(FImageDelegate.GetObjectID); 102 | 103 | @@ -311,10 +360,13 @@ end; 104 | 105 | procedure TImageDelegate.HidePicker(const APicker: UIImagePickerController); 106 | begin 107 | - if (FImageManager <> nil) and IsPad and (APicker.sourceType <> UIImagePickerControllerSourceTypeCamera) then 108 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 start 109 | + // if (FImageManager <> nil) and IsPad and (APicker.sourceType <> UIImagePickerControllerSourceTypeCamera) then 110 | + if (FImageManager <> nil) and not FIsFullScreen then 111 | FImageManager.ClosePopover 112 | else 113 | APicker.dismissModalViewControllerAnimated(True); 114 | + // PATCH https://quality.embarcadero.com/browse/RSP-20875 end 115 | end; 116 | 117 | procedure TImageDelegate.imagePickerController(picker: UIImagePickerController; didFinishPickingImage: UIImage; 118 | -------------------------------------------------------------------------------- /10.4.2/Data.DB.10.4.2.patch: -------------------------------------------------------------------------------- 1 | diff --git "a/C:\\Attracs\\Attracs-Common\\components\\Patches\\DelphiSydney\\Delphi\\Data.DB.pas" "b/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\data\\Data.DB.pas" 2 | index 92d960e..8528d57 100644 3 | --- "a/C:\\Attracs\\Attracs-Common\\components\\Patches\\DelphiSydney\\Delphi\\Data.DB.pas" 4 | +++ "b/C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source\\data\\Data.DB.pas" 5 | @@ -2,7 +2,7 @@ 6 | { } 7 | { Delphi Runtime Library } 8 | { } 9 | -{ Copyright(c) 1995-2020 Embarcadero Technologies, Inc. } 10 | +{ Copyright(c) 1995-2021 Embarcadero Technologies, Inc. } 11 | { All rights reserved } 12 | { } 13 | {*******************************************************} 14 | @@ -10,6 +10,7 @@ 15 | unit Data.DB; 16 | 17 | {$R-,T-,H+,X+} 18 | +{$WARN SYMBOL_DEPRECATED OFF} 19 | 20 | interface 21 | 22 | @@ -5699,7 +5700,13 @@ end; 23 | 24 | procedure TField.SetEditText(const Value: string); 25 | begin 26 | - if Assigned(FOnSetText) then FOnSetText(Self, Value) else SetText(Value); 27 | + if Assigned(FOnSetText) then 28 | + begin 29 | + var S: string := Copy(Value, 1); 30 | + FOnSetText(Self, S); 31 | + end 32 | + else 33 | + SetText(Value); 34 | end; 35 | 36 | procedure TField.SetFieldKind(Value: TFieldKind); 37 | @@ -7605,11 +7612,11 @@ end; 38 | 39 | procedure TBooleanField.SetAsBoolean(Value: Boolean); 40 | var 41 | - B: WordBool; 42 | + B: Word; 43 | begin 44 | - if Value then Word(B) := 1 else Word(B) := 0; 45 | + if Value then B := 1 else B := 0; 46 | if FIOBuffer <> nil then 47 | - TDBBitConverter.UnsafeFrom(B, FIOBuffer); 48 | + TDBBitConverter.UnsafeFrom(WordBool(B), FIOBuffer); 49 | SetData(FIOBuffer); 50 | end; 51 | 52 | @@ -7722,6 +7729,8 @@ begin 53 | ftTime: F := FormatSettings.LongTimeFormat; 54 | end; 55 | DateTimeToString(Text, F, D); 56 | + if (DataType = ftTime) and (Sign(D) = NegativeValue) then 57 | + Text := '-' + Text; 58 | end else 59 | Text := ''; 60 | end; 61 | @@ -7760,7 +7769,11 @@ begin 62 | begin 63 | case DataType of 64 | ftDate: DateTime := StrToDate(Value); 65 | - ftTime: DateTime := StrToTime(Value); 66 | + ftTime: 67 | + if Value[1] = '-' then 68 | + DateTime := - StrToTime(Copy(Value, 2)) 69 | + else 70 | + DateTime := StrToTime(Value); 71 | else 72 | DateTime := StrToDateTime(Value); 73 | end; 74 | @@ -10893,13 +10906,18 @@ begin 75 | end; 76 | 77 | procedure TParams.Update(Item: TCollectionItem); 78 | +var 79 | + i: Integer; 80 | begin 81 | + for i := 0 to Count - 1 do 82 | + Items[i].FParamRef := nil; 83 | inherited Update(Item); 84 | end; 85 | 86 | function TParams.GetItem(Index: Integer): TParam; 87 | begin 88 | Result := TParam(inherited Items[Index]); 89 | + Result := Result.ParamRef; 90 | end; 91 | 92 | procedure TParams.SetItem(Index: Integer; Value: TParam); 93 | @@ -10922,6 +10940,7 @@ end; 94 | function TParams.AddParameter: TParam; 95 | begin 96 | Result := Add as TParam; 97 | + Items[Count-1].FParamRef := nil; 98 | end; 99 | 100 | procedure TParams.AssignTo(Dest: TPersistent); 101 | @@ -10935,13 +10954,8 @@ var 102 | I: Integer; 103 | P: TParam; 104 | begin 105 | - if count = 0 then 106 | - exit; 107 | for I := 0 to Value.Count - 1 do 108 | begin 109 | - if (Value.Count = Count) and (AnsiCompareText(GetItem(i).Name, Value[I].Name) = 0) then 110 | - p := GetItem(i) 111 | - else 112 | P := FindParam(Value[I].Name); 113 | if P <> nil then 114 | P.Assign(Value[I]); 115 | @@ -11235,8 +11249,6 @@ end; 116 | constructor TParam.Create(Collection: TCollection); 117 | begin 118 | inherited Create(Collection); 119 | - fParamRef := nil; // for compiler hint 120 | - ParamRef; // for compiler hint 121 | ParamType := ptUnknown; 122 | DataType := ftUnknown; 123 | FSize := 0; 124 | @@ -11274,7 +11286,11 @@ end; 125 | 126 | function TParam.ParamRef: TParam; 127 | begin 128 | - Result := self; 129 | + if not Assigned(FParamRef) then 130 | + if Assigned(Collection) and (Name <> '') then 131 | + FParamRef := TParams(Collection).ParamByName(Name) else 132 | + FParamRef := Self; 133 | + Result := FParamRef; 134 | end; 135 | 136 | function TParam.GetIsNull: Boolean; 137 | @@ -11300,12 +11316,12 @@ end; 138 | 139 | function TParam.GetParamType: TParamType; 140 | begin 141 | - Result := FParamType; 142 | + Result := ParamRef.FParamType; 143 | end; 144 | 145 | procedure TParam.SetParamType(Value: TParamType); 146 | begin 147 | - FParamType := Value; 148 | + ParamRef.FParamType := Value; 149 | end; 150 | 151 | procedure TParam.SetStream(Stream: TStream; AInstanceOwner: Boolean; KnownSize: Integer); 152 | @@ -11320,7 +11336,7 @@ end; 153 | 154 | function TParam.GetDataType: TFieldType; 155 | begin 156 | - Result := FDataType; 157 | + Result := ParamRef.FDataType; 158 | end; 159 | 160 | procedure TParam.SetDataType(Value: TFieldType); 161 | @@ -11337,19 +11353,19 @@ const 162 | var 163 | vType: Integer; 164 | begin 165 | - FDataType := Value; 166 | - if Assigned(DataSet) and (not IsNull) then 167 | + ParamRef.FDataType := Value; 168 | + if Assigned(DataSet) and (not ParamRef.IsNull) then 169 | begin 170 | vType := VarTypeMap[Value]; 171 | if vType <> varError then 172 | try 173 | - VarCast(FData, FData, vType); 174 | + VarCast(ParamRef.FData, ParamRef.FData, vType); 175 | except 176 | - Clear; 177 | + ParamRef.Clear; 178 | end else 179 | - Clear; 180 | + ParamRef.Clear; 181 | end else 182 | - Clear; 183 | + ParamRef.Clear; 184 | end; 185 | 186 | function TParam.GetDataSize: Integer; 187 | @@ -12208,6 +12224,8 @@ end; 188 | 189 | procedure TParam.SetAsVariant(const Value: Variant); 190 | begin 191 | + if ParamRef = Self then 192 | + begin 193 | FBound := not VarIsClear(Value); 194 | FNull := VarIsClear(Value) or VarIsNull(Value); 195 | if FDataType = ftUnknown then 196 | @@ -12239,11 +12257,13 @@ begin 197 | FDataType := ftUnknown; 198 | end; 199 | FData := Value; 200 | + end else 201 | + ParamRef.SetAsVariant(Value); 202 | end; 203 | 204 | function TParam.GetAsVariant: Variant; 205 | begin 206 | - Result := FData; 207 | + Result := ParamRef.FData; 208 | end; 209 | 210 | function TParam.GetAsMemo: string; 211 | @@ -13379,7 +13399,13 @@ procedure TDataSet.DataConvert(Field: TField; Source: TValueBuffer; var Dest: TV 212 | TimeStamp.Date := 0; 213 | end; 214 | end; 215 | - Result := TimeStampToDateTime(TimeStamp); 216 | + if (DataType = ftTime) and (TimeStamp.Time < 0) then 217 | + begin 218 | + TimeStamp.Time := - TimeStamp.Time; 219 | + Result := - TimeStampToDateTime(TimeStamp); 220 | + end 221 | + else 222 | + Result := TimeStampToDateTime(TimeStamp); 223 | end; 224 | 225 | function DateTimeToNative(DataType: TFieldType; Data: TDateTime): TDateTimeRec; 226 | @@ -13389,7 +13415,11 @@ procedure TDataSet.DataConvert(Field: TField; Source: TValueBuffer; var Dest: TV 227 | TimeStamp := DateTimeToTimeStamp(Data); 228 | case DataType of 229 | ftDate: Result.Date := TimeStamp.Date; 230 | - ftTime: Result.Time := TimeStamp.Time; 231 | + ftTime: 232 | + if Sign(Data) = NegativeValue then 233 | + Result.Time := - TimeStamp.Time 234 | + else 235 | + Result.Time := TimeStamp.Time; 236 | else 237 | Result.DateTime := TimeStampToMSecs(TimeStamp); 238 | end; 239 | --------------------------------------------------------------------------------