Kaydet (Commit) 1552898a authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - solve incompatibility with AOO

Controller.FormOperations always returns <Null> in AOO. LibreOffice OK.
üst 56ed2a8c
...@@ -72,6 +72,8 @@ Dim sFilter As String, oWindow As Object, oDatabase As Object, oTarget As Object ...@@ -72,6 +72,8 @@ Dim sFilter As String, oWindow As Object, oDatabase As Object, oTarget As Object
Set oTarget = _DatabaseForm(._Name, pvControlName) Set oTarget = _DatabaseForm(._Name, pvControlName)
Case acQuery, acTable Case acQuery, acTable
If pvControlName &lt;&gt; &quot;&quot; Then Goto Exit_Function If pvControlName &lt;&gt; &quot;&quot; Then Goto Exit_Function
If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
&apos; FormOperations returns &lt;Null&gt; in OpenOffice
Set oTarget = .Frame.Controller.FormOperations.Cursor Set oTarget = .Frame.Controller.FormOperations.Cursor
Case Else &apos; Ignore action Case Else &apos; Ignore action
Goto Exit_Function Goto Exit_Function
...@@ -762,7 +764,8 @@ Public Function GoToRecord(Optional ByVal pvObjectType As Variant _ ...@@ -762,7 +764,8 @@ Public Function GoToRecord(Optional ByVal pvObjectType As Variant _
If _ErrorHandler() Then On Local Error Goto Error_Function If _ErrorHandler() Then On Local Error Goto Error_Function
GoToRecord = False GoToRecord = False
Utils._SetCalledSub(&quot;GoToRecord&quot;) Const cstThisSub = &quot;GoTorecord&quot;
Utils._SetCalledSub(cstThisSub)
If IsMissing(pvObjectName) Then pvObjectName = &quot;&quot; If IsMissing(pvObjectName) Then pvObjectName = &quot;&quot;
If IsMissing(pvObjectType) Then pvObjectType = acActiveDataObject If IsMissing(pvObjectType) Then pvObjectType = acActiveDataObject
&apos; If IsMissing(pvObjectType) Then &apos; If IsMissing(pvObjectType) Then
...@@ -791,6 +794,8 @@ Dim sObjectName, iLengthName As Integer ...@@ -791,6 +794,8 @@ Dim sObjectName, iLengthName As Integer
Case acForm Case acForm
Set oResultSet = _DatabaseForm(._Name, &quot;&quot;) Set oResultSet = _DatabaseForm(._Name, &quot;&quot;)
Case acQuery, acTable Case acQuery, acTable
If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
&apos; FormOperations returns &lt;Null&gt; in OpenOffice
Set oResultSet = .Frame.Controller.FormOperations.Cursor Set oResultSet = .Frame.Controller.FormOperations.Cursor
Case Else &apos; Ignore action Case Else &apos; Ignore action
Goto Exit_Function Goto Exit_Function
...@@ -820,9 +825,12 @@ Dim sObjectName, iLengthName As Integer ...@@ -820,9 +825,12 @@ Dim sObjectName, iLengthName As Integer
Set oResultSet = ofForm.DatabaseForm Set oResultSet = ofForm.DatabaseForm
Case acDataQuery Case acDataQuery
Set oWindow = _SelectWindow(acQuery, pvObjectName) Set oWindow = _SelectWindow(acQuery, pvObjectName)
If IsNull(oWindow.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
&apos; FormOperations returns &lt;Null&gt; in OpenOffice
Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor
Case acDataTable Case acDataTable
Set oWindow = _SelectWindow(acTable, pvObjectName) Set oWindow = _SelectWindow(acTable, pvObjectName)
If IsNull(oWindow.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor Set oResultSet = oWindow.Frame.Controller.FormOperations.Cursor
Case Else Case Else
End Select End Select
...@@ -858,10 +866,10 @@ Dim sObjectName, iLengthName As Integer ...@@ -858,10 +866,10 @@ Dim sObjectName, iLengthName As Integer
End Select End Select
Exit_Function: Exit_Function:
Utils._ResetCalledSub(&quot;GoToRecord&quot;) Utils._ResetCalledSub(cstThisSub)
Exit Function Exit Function
Error_Function: Error_Function:
TraceError(TRACEABORT, Err, &quot;GoToRecord&quot;, Erl) TraceError(TRACEABORT, Err, cstThisSub, Erl)
GoTo Exit_Function GoTo Exit_Function
Error_Target: Error_Target:
TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(2, pvObjectName)) TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(2, pvObjectName))
...@@ -869,6 +877,9 @@ Error_Target: ...@@ -869,6 +877,9 @@ Error_Target:
Error_Offset: Error_Offset:
TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(4, pvOffset)) TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(4, pvOffset))
Goto Exit_Function Goto Exit_Function
Error_NotApplicable:
TraceError(TRACEFATAL, ERRACTION, Utils._CalledSub(), 0, 1, cstThisSub)
Goto Exit_Function
End Function &apos; GoToRecord End Function &apos; GoToRecord
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
...@@ -1860,6 +1871,8 @@ Dim sOrder As String, oWindow As Object, oDatabase As Object, oTarget As Object ...@@ -1860,6 +1871,8 @@ Dim sOrder As String, oWindow As Object, oDatabase As Object, oTarget As Object
Set oTarget = _DatabaseForm(._Name, pvControlName) Set oTarget = _DatabaseForm(._Name, pvControlName)
Case acQuery, acTable Case acQuery, acTable
If pvControlName &lt;&gt; &quot;&quot; Then Goto Exit_Function If pvControlName &lt;&gt; &quot;&quot; Then Goto Exit_Function
If IsNull(.Frame.Controller.FormOperations) Then Goto Error_NotApplicable
&apos; FormOperations returns &lt;Null&gt; in OpenOffice
Set oTarget = .Frame.Controller.FormOperations.Cursor Set oTarget = .Frame.Controller.FormOperations.Cursor
Case Else &apos; Ignore action Case Else &apos; Ignore action
Goto Exit_Function Goto Exit_Function
...@@ -2017,7 +2030,6 @@ Public Function _getUpperShortcut(ByVal psShortcut As String, ByVal psLastCompon ...@@ -2017,7 +2030,6 @@ Public Function _getUpperShortcut(ByVal psShortcut As String, ByVal psLastCompon
End Function &apos; _getUpperShortcut End Function &apos; _getUpperShortcut
REM -----------------------------------------------------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Private Function _OpenObject(ByVal psObjectType As String _ Private Function _OpenObject(ByVal psObjectType As String _
, ByVal pvObjectName As Variant _ , ByVal pvObjectName As Variant _
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment