[Libreoffice-commits] core.git: wizards/source

Jean-Pierre Ledure jp at ledure.be
Thu Oct 26 11:31:18 UTC 2017


 wizards/source/access2base/Database.xba |  139 +++++++++++++++++++++++++++++++-
 1 file changed, 138 insertions(+), 1 deletion(-)

New commits:
commit 86a773cd43ac297b9e5fb2bf36dac37bc1e40de2
Author: Jean-Pierre Ledure <jp at ledure.be>
Date:   Thu Oct 26 13:28:15 2017 +0200

    Access2Base - Database events
    
    Introduce 21 database On... events returning the invoked scripts
    Read-only

diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba
index 9672bec48221..cdf26aa14bab 100644
--- a/wizards/source/access2base/Database.xba
+++ b/wizards/source/access2base/Database.xba
@@ -103,6 +103,111 @@ Property Get ObjectType() As String
 End Property		'	ObjectType (get)
 
 REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnCreate() As String
+	OnCreate = _PropertyGet("OnCreate")
+End Property		'	OnCreate (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnFocus() As String
+	OnFocus = _PropertyGet("OnFocus")
+End Property		'	OnFocus (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnLoad() As String
+	OnLoad = _PropertyGet("OnLoad")
+End Property		'	OnLoad (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnLoadFinished() As String
+	OnLoadFinished = _PropertyGet("OnLoadFinished")
+End Property		'	OnLoadFinished (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnModifyChanged() As String
+	OnModifyChanged = _PropertyGet("OnModifyChanged")
+End Property		'	OnModifyChanged (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnNew() As String
+	OnNew = _PropertyGet("OnNew")
+End Property		'	OnNew (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnPrepareUnload() As String
+	OnPrepareUnload = _PropertyGet("OnPrepareUnload")
+End Property		'	OnPrepareUnload (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnPrepareViewClosing() As String
+	OnPrepareViewClosing = _PropertyGet("OnPrepareViewClosing")
+End Property		'	OnPrepareViewClosing (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSave() As String
+	OnSave = _PropertyGet("OnSave")
+End Property		'	OnSave (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSaveAs() As String
+	OnSaveAs = _PropertyGet("OnSaveAs")
+End Property		'	OnSaveAs (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSaveAsDone() As String
+	OnSaveAsDone = _PropertyGet("OnSaveAsDone")
+End Property		'	OnSaveAsDone (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSaveAsFailed() As String
+	OnSaveAsFailed = _PropertyGet("OnSaveAsFailed")
+End Property		'	OnSaveAsFailed (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSaveDone() As String
+	OnSaveDone = _PropertyGet("OnSaveDone")
+End Property		'	OnSaveDone (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSaveFailed() As String
+	OnSaveFailed = _PropertyGet("OnSaveFailed")
+End Property		'	OnSaveFailed (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSubComponentClosed() As String
+	OnSubComponentClosed = _PropertyGet("OnSubComponentClosed")
+End Property		'	OnSubComponentClosed (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnSubComponentOpened() As String
+	OnSubComponentOpened = _PropertyGet("OnSubComponentOpened")
+End Property		'	OnSubComponentOpened (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnTitleChanged() As String
+	OnTitleChanged = _PropertyGet("OnTitleChanged")
+End Property		'	OnTitleChanged (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnUnfocus() As String
+	OnUnfocus = _PropertyGet("OnUnfocus")
+End Property		'	OnUnfocus (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnUnload() As String
+	OnUnload = _PropertyGet("OnUnload")
+End Property		'	OnUnload (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnViewClosed() As String
+	OnViewClosed = _PropertyGet("OnViewClosed")
+End Property		'	OnViewClosed (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OnViewCreated() As String
+	OnViewCreated = _PropertyGet("OnViewCreated")
+End Property		'	OnViewCreated (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
 Property Get Version() As String
 	Version = _PropertyGet("Version")
 End Property		'	Version (get)
@@ -1654,7 +1759,14 @@ End Function	'	_OutputToHTML	V1.4.0
 REM -----------------------------------------------------------------------------------------------------------------------
 Private Function _PropertiesList() As Variant
 
-	_PropertiesList = Array("Connect", "Name", "ObjectType", "Version")
+	_PropertiesList = Array("Connect", "Name", "ObjectType" _
+						, "OnCreate", "OnFocus", "OnLoad", "OnLoadFinished", "OnModifyChanged" _
+						, "OnNew", "OnPrepareUnload", "OnPrepareViewClosing", "OnSave", "OnSaveAs" _
+						, "OnSaveAsDone", "OnSaveAsFailed", "OnSaveDone", "OnSaveFailed", "OnSaveTo" _
+						, "OnSaveToDone", "OnSaveToFailed", "OnSubComponentClosed", "OnSubComponentOpened" _
+						, "OnTitleChanged", "OnUnfocus", "OnUnload", "OnViewClosed", "OnViewCreated" _
+						, "Version" _
+						)
 
 End Function	'	_PropertiesList
 
@@ -1662,6 +1774,8 @@ REM ----------------------------------------------------------------------------
 Private Function _PropertyGet(ByVal psProperty As String) As Variant
 '	Return property value of the psProperty property name
 
+Dim i As Integer, vEvents As Variant, sEvent As String, vEvent As Variant
+
 	If _ErrorHandler() Then On Local Error Goto Error_Function
 	Utils._SetCalledSub("Database.get" & psProperty)
 
@@ -1675,6 +1789,29 @@ Private Function _PropertyGet(ByVal psProperty As String) As Variant
 			_PropertyGet = Title
 		Case UCase("ObjectType")
 			_PropertyGet = _Type
+		Case UCase("OnCreate"), UCase("OnFocus"), UCase("OnLoad"), UCase("OnLoadFinished"), UCase("OnModifyChanged") _
+						, UCase("OnNew"), UCase("OnPrepareUnload"), UCase("OnPrepareViewClosing"), UCase("OnSave"), UCase("OnSaveAs") _
+						, UCase("OnSaveAsDone"), UCase("OnSaveAsFailed"), UCase("OnSaveDone"), UCase("OnSaveFailed"), UCase("OnSaveTo") _
+						, UCase("OnSaveToDone"), UCase("OnSaveToFailed"), UCase("OnSubComponentClosed"), UCase("OnSubComponentOpened") _
+						, UCase("OnTitleChanged"), UCase("OnUnfocus"), UCase("OnUnload"), UCase("OnViewClosed"), UCase("OnViewCreated")
+			'	Find script event
+			sEvent = ""
+			vEvents = Document.getEvents().ElementNames			'	Returns an array
+			For i = 0 To UBound(vEvents)
+				If UCase(vEvents(i)) = UCase(psProperty) Then sEvent = vEvents(i)
+			Next i
+			If sEvent = "" Then
+				_PropertyGet = ""
+			Else
+				vEvent = Document.getEvents().getByName(sEvent)
+				If IsEmpty(vEvent) Then
+					_PropertyGet = ""
+				ElseIf vEvent(0).Value <> "Script" Then
+					_PropertyGet = ""
+				Else
+					_PropertyGet = vEvent(1).Value
+				End If
+			End If
 		Case UCase("Version")
 			_PropertyGet = MetaData.getDatabaseProductName() & " " & MetaData.getDatabaseProductVersion
 		Case Else


More information about the Libreoffice-commits mailing list