[Libreoffice-commits] core.git: wizards/source
Jean-Pierre Ledure (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 20 14:37:43 UTC 2020
wizards/source/sfdocuments/SF_Form.xba | 40 +++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
New commits:
commit e3fe4a46104d9379bca3302fd9ed3883915f2d80
Author: Jean-Pierre Ledure <jp at ledure.be>
AuthorDate: Sun Dec 20 14:23:34 2020 +0100
Commit: Jean-Pierre Ledure <jp at ledure.be>
CommitDate: Sun Dec 20 15:37:03 2020 +0100
ScriptForge - new CloseFormDocument() method
Only when form instance is inside a Base form document
Change-Id: I6fd0cf1d77588b9720efb2c45384371a122dbd4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108048
Tested-by: Jean-Pierre Ledure <jp at ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp at ledure.be>
diff --git a/wizards/source/sfdocuments/SF_Form.xba b/wizards/source/sfdocuments/SF_Form.xba
index ca4be09e56df..a6c4a074d0b9 100644
--- a/wizards/source/sfdocuments/SF_Form.xba
+++ b/wizards/source/sfdocuments/SF_Form.xba
@@ -257,6 +257,46 @@ Catch:
GoTo Finally
End Function ' SFDocuments.SF_Form.Activate
+REM -----------------------------------------------------------------------------
+Public Function CloseFormDocument() As Boolean
+''' Close the form document containing the actual form instance
+''' The form instance is disposed
+''' The method does nothong if the actual form is not located in a Base form document
+''' Args:
+''' Returns:
+''' True if closure is successful
+''' Example:
+''' myForm.CloseFormDocument()
+
+Dim bClose As Boolean ' Return value
+Dim oContainer As Object ' com.sun.star.awt.XWindow
+Const cstThisSub = "SFDocuments.Form.CloseFormDocument"
+Const cstSubArgs = ""
+
+ If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
+ bClose = False
+
+Check:
+ If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
+ If Not _IsStillAlive() Then GoTo Finally
+ End If
+Try:
+ Select Case _FormType
+ Case ISDOCFORM, ISCALCFORM, ISSUBFORM
+ Case ISBASEFORM
+ _MainForm.close()
+ Dispose()
+ bClose = True
+ End Select
+
+Finally:
+ CloseFormDocument = bClose
+ ScriptForge.SF_Utils._ExitFunction(cstThisSub)
+ Exit Function
+Catch:
+ GoTo Finally
+End Function ' SFDocuments.SF_Form.CloseFormDocument
+
REM -----------------------------------------------------------------------------
Public Function Controls(Optional ByVal ControlName As Variant) As Variant
''' Return either
More information about the Libreoffice-commits
mailing list