diff options
author | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-12-24 23:17:55 +0000 |
---|---|---|
committer | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-12-24 23:17:55 +0000 |
commit | e5d245f4ac41ddd3e45159d933a3cb7073068f38 (patch) | |
tree | e20ec6a8b6720eacb780b6f9895a9569221bffe8 /packages | |
parent | f1fab238237dc74a2cb45628dd26e47f90a00a72 (diff) | |
download | fpc-e5d245f4ac41ddd3e45159d933a3cb7073068f38.tar.gz |
Merged revision(s) 47687 from trunk:
* fix for Mantis #38151: when a Variant is passed by reference to a IDispatch property then invoke it using DISPATCH_PROPERTYPUTREF instead of DISPATCH_PROPERTYPUT
+ added test
........
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_2@47846 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages')
-rw-r--r-- | packages/winunits-base/src/comobj.pp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/winunits-base/src/comobj.pp b/packages/winunits-base/src/comobj.pp index fd17c6860f..e7cbfb7ec1 100644 --- a/packages/winunits-base/src/comobj.pp +++ b/packages/winunits-base/src/comobj.pp @@ -1381,7 +1381,13 @@ HKCR case InvokeKind of DISPATCH_PROPERTYPUT: begin - if (Arguments[0].VType and varTypeMask) = varDispatch then + if ((Arguments[0].VType and varTypeMask) in [varDispatch]) or + { if we have a variant that's passed as a reference we pass it + to the property as a reference as well } + ( + ((Arguments[0].VType and varTypeMask) in [varVariant]) and + ((CallDesc^.argtypes[0] and $80) <> 0) + ) then InvokeKind:=DISPATCH_PROPERTYPUTREF; { first name is actually the name of the property to set } DispIDs^[0]:=DISPID_PROPERTYPUT; |