From 3044d81586365cd35b6f3ed51b7be9ec4f50638d Mon Sep 17 00:00:00 2001 From: Jean-Pierre Ledure Date: Tue, 15 Mar 2022 17:26:13 +0100 Subject: ScriptForge - (SF_Form) fix use of BaseForm Context: Base documents. In a form or formcontrol event, a user script might need the name of the form document in which the form or control is located, f.i. to close it. The name of the form document is supposed to be found in the SF_Form.BaseForm property. The property is set correctly when the Base form document to form/formcontrol path is taken (top-down), not when the opposite path is taken (bottom-up), typically in events. In the latter case BaseForm is equal to an empty string. The actual commit initializes correctly the BaseForm property with the hierarchical name of the form document. Change-Id: Icdee6ee9909f577f6c01ba96864fe3d6eaf3e750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131618 Tested-by: Jean-Pierre Ledure Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure --- wizards/source/sfdocuments/SF_Form.xba | 1 + 1 file changed, 1 insertion(+) (limited to 'wizards') diff --git a/wizards/source/sfdocuments/SF_Form.xba b/wizards/source/sfdocuments/SF_Form.xba index 15c3d498e78e..404c24bd3b20 100644 --- a/wizards/source/sfdocuments/SF_Form.xba +++ b/wizards/source/sfdocuments/SF_Form.xba @@ -1259,6 +1259,7 @@ Try: Set _Component = oParent If IsNull([_Parent]._FormDocuments) Then Set [_Parent]._FormDocuments = _Component.getFormDocuments() Set _FormDocument = [_Parent]._FindByPersistentName([_Parent]._FormDocuments, sPersistentName) + _FormDocumentName = _FormDocument.HierarchicalName Case Else End Select If oSession.HasUnoProperty(oParent, "Parent") Then Set oParent = oParent.Parent Else Set oParent = Nothing -- cgit v1.2.3