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

Jean-Pierre Ledure jp at ledure.be
Wed Dec 31 00:35:55 PST 2014


 wizards/source/access2base/DoCmd.xba |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 1552898a66562e439e52769a12769239818d29fc
Author: Jean-Pierre Ledure <jp at ledure.be>
Date:   Wed Dec 31 09:31:59 2014 +0100

    Access2Base - solve incompatibility with AOO
    
    Controller.FormOperations always returns <Null> in AOO. LibreOffice OK.

diff --git a/wizards/source/access2base/DoCmd.xba b/wizards/source/access2base/DoCmd.xba
index 0ca7dd6..75112e2 100644
--- a/wizards/source/access2base/DoCmd.xba
+++ b/wizards/source/access2base/DoCmd.xba
@@ -72,6 +72,8 @@ Dim sFilter As String, oWindow As Object, oDatabase As Object, oTarget As Object
 				Set oTarget = _DatabaseForm(._Name, pvControlName)
 			Case acQuery, acTable
 				If pvControlName <> "" Then Goto Exit_Function
+				If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
+						'	FormOperations returns <Null> in OpenOffice
 				Set oTarget = .Frame.Controller.FormOperations.Cursor
 			Case Else		'	Ignore action
 				Goto Exit_Function
@@ -762,7 +764,8 @@ Public Function GoToRecord(Optional ByVal pvObjectType As Variant _
 	If _ErrorHandler() Then On Local Error Goto Error_Function
 	GoToRecord = False
 	
-	Utils._SetCalledSub("GoToRecord")
+Const cstThisSub = "GoTorecord"
+	Utils._SetCalledSub(cstThisSub)
 	If IsMissing(pvObjectName) Then pvObjectName = ""
 	If IsMissing(pvObjectType) Then pvObjectType = acActiveDataObject
 '	If IsMissing(pvObjectType) Then
@@ -791,6 +794,8 @@ Dim sObjectName, iLengthName As Integer
 					Case acForm
 						Set oResultSet = _DatabaseForm(._Name, "")
 					Case acQuery, acTable
+						If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
+								'	FormOperations returns <Null> in OpenOffice
 						Set oResultSet = .Frame.Controller.FormOperations.Cursor
 					Case Else		'	Ignore action
 						Goto Exit_Function
@@ -820,9 +825,12 @@ Dim sObjectName, iLengthName As Integer
 			Set oResultSet = ofForm.DatabaseForm
 		Case acDataQuery
 			Set oWindow = _SelectWindow(acQuery, pvObjectName)
+			If IsNull(oWindow.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
+						'	FormOperations returns <Null> in OpenOffice
 			Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor
 		Case acDataTable
 			Set oWindow = _SelectWindow(acTable, pvObjectName)
+			If IsNull(oWindow.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
 			Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor
 		Case Else
 	End Select
@@ -858,10 +866,10 @@ Dim sObjectName, iLengthName As Integer
 	End Select
 	
 Exit_Function:
-	Utils._ResetCalledSub("GoToRecord")
+	Utils._ResetCalledSub(cstThisSub)
 	Exit Function
 Error_Function:
-	TraceError(TRACEABORT, Err, "GoToRecord", Erl)
+	TraceError(TRACEABORT, Err, cstThisSub, Erl)
 	GoTo Exit_Function
 Error_Target:
 	TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(2, pvObjectName))
@@ -869,6 +877,9 @@ Error_Target:
 Error_Offset:
 	TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(4, pvOffset))
 	Goto Exit_Function
+Error_NotApplicable:
+	TraceError(TRACEFATAL, ERRACTION, Utils._CalledSub(), 0, 1, cstThisSub)
+	Goto Exit_Function
 End Function		'	GoToRecord
 
 REM -----------------------------------------------------------------------------------------------------------------------
@@ -1860,6 +1871,8 @@ Dim sOrder As String, oWindow As Object, oDatabase As Object, oTarget As Object
 				Set oTarget = _DatabaseForm(._Name, pvControlName)
 			Case acQuery, acTable
 				If pvControlName <> "" Then Goto Exit_Function
+				If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
+						'	FormOperations returns <Null> in OpenOffice
 				Set oTarget = .Frame.Controller.FormOperations.Cursor
 			Case Else		'	Ignore action
 				Goto Exit_Function
@@ -2018,7 +2031,6 @@ Public Function _getUpperShortcut(ByVal psShortcut As String, ByVal psLastCompon
 End Function		'	_getUpperShortcut
 
 REM -----------------------------------------------------------------------------------------------------------------------
-REM -----------------------------------------------------------------------------------------------------------------------
 Private Function _OpenObject(ByVal psObjectType As String _
 			, ByVal pvObjectName As Variant _
 			, ByVal pvView As Variant _


More information about the Libreoffice-commits mailing list