XFA: merge patch from issue 801913002 and 804463003