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

Access2Base - FIX AllDialogs() should run when no active document

Stopped erroneously with error message "No active connection"
üst 359286b9
...@@ -195,6 +195,7 @@ Dim iMode As Integer, vDialogs() As Variant, i As Integer, j As Integer, iCount ...@@ -195,6 +195,7 @@ Dim iMode As Integer, vDialogs() As Variant, i As Integer, j As Integer, iCount
Dim oMacLibraries As Object, vAllDialogs As Variant, oLibrary As Object, vNames() As Variant, bFound As Boolean Dim oMacLibraries As Object, vAllDialogs As Variant, oLibrary As Object, vNames() As Variant, bFound As Boolean
Dim oLibDialog As Object, sLibrary As String, oDocLibraries As Object, bLocalStorage As Boolean Dim oLibDialog As Object, sLibrary As String, oDocLibraries As Object, bLocalStorage As Boolean
Dim vLibraries() As Variant, vMacLibraries() As Variant, vDocLibraries() As Variant, oDocMacLib As Object Dim vLibraries() As Variant, vMacLibraries() As Variant, vDocLibraries() As Variant, oDocMacLib As Object
Dim vCurrentDocument As Variant
Const cstCount = 0 Const cstCount = 0
Const cstByIndex = 1 Const cstByIndex = 1
Const cstByName = 2 Const cstByName = 2
...@@ -209,8 +210,14 @@ Const cstSepar = "!" ...@@ -209,8 +210,14 @@ Const cstSepar = "!"
Set vAllDialogs = Nothing Set vAllDialogs = Nothing
Set oDocLibraries = _A2B_.CurrentDocument.Document.DialogLibraries ' ThisComponent.DialogLibraries Set vCurrentDocument = _A2B_.CurrentDocument
vDocLibraries = oDocLibraries.getElementNames() If IsNull(vCurrentDocument) Then
Set oDocLibraries = Nothing
vDocLibraries = Array()
Else
Set oDocLibraries = _A2B_.CurrentDocument.Document.DialogLibraries ' ThisComponent.DialogLibraries
vDocLibraries = oDocLibraries.getElementNames()
End If
Set oMacLibraries = DialogLibraries Set oMacLibraries = DialogLibraries
vMacLibraries = oMacLibraries.getElementNames() vMacLibraries = oMacLibraries.getElementNames()
'Remove Access2Base from the list 'Remove Access2Base from the list
......
...@@ -202,7 +202,7 @@ Public Function CurrentDocument(ByVal Optional piDocIndex As Integer) As Variant ...@@ -202,7 +202,7 @@ Public Function CurrentDocument(ByVal Optional piDocIndex As Integer) As Variant
' Returns the CurrentDoc(...) referring to the current document or to the argument ' Returns the CurrentDoc(...) referring to the current document or to the argument
Dim iDocIndex As Integer Dim iDocIndex As Integer
If IsMissing(piDocIndex) Then iDocIndex = CurrentDocIndex() Else iDocIndex = piDocIndex If IsMissing(piDocIndex) Then iDocIndex = CurrentDocIndex(, False) Else iDocIndex = piDocIndex
If iDocIndex >= 0 And iDocIndex <= UBound(CurrentDoc) Then Set CurrentDocument = CurrentDoc(iDocIndex) Else Set CurrentDocument = Nothing If iDocIndex >= 0 And iDocIndex <= UBound(CurrentDoc) Then Set CurrentDocument = CurrentDoc(iDocIndex) Else Set CurrentDocument = Nothing
End Function End Function
......
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