Kaydet (Commit) 890d86e1 authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure Kaydeden (comit) Andras Timar

Access2Base - Errors in CommandBarControls collection

- correct return value in Execute method: returned alays False, should return True when successful
- Item property of collection did not work because incomplete object initialisation

Change-Id: I9b2e682afb21747766e918bf905e35d9485b751d
Reviewed-on: https://gerrit.libreoffice.org/17351Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 774a2911
...@@ -170,6 +170,7 @@ Dim oObject As Object ...@@ -170,6 +170,7 @@ Dim oObject As Object
Set oObject = New Collect Set oObject = New Collect
oObject._CollType = COLLCOMMANDBARCONTROLS oObject._CollType = COLLCOMMANDBARCONTROLS
oObject._ParentType = OBJCOMMANDBAR oObject._ParentType = OBJCOMMANDBAR
oObject._ParentName = _Name
oObject._Count = iItemsCount oObject._Count = iItemsCount
Case Else &apos; pvIndex is numeric Case Else &apos; pvIndex is numeric
Goto Trace_IndexError Goto Trace_IndexError
......
...@@ -152,24 +152,25 @@ Const cstThisSub = &quot;CommandBarControl.Execute&quot; ...@@ -152,24 +152,25 @@ Const cstThisSub = &quot;CommandBarControl.Execute&quot;
Utils._SetCalledSub(cstThisSub) Utils._SetCalledSub(cstThisSub)
Dim sExecute As String Dim sExecute As String
Execute = False
Execute = True
sExecute = _GetPropertyValue(_Element, &quot;CommandURL&quot;, &quot;&quot;) sExecute = _GetPropertyValue(_Element, &quot;CommandURL&quot;, &quot;&quot;)
Select Case True Select Case True
Case sExecute = &quot;&quot; Case sExecute = &quot;&quot; : Execute = False
Case _IsLeft(sExecute, &quot;.uno:&quot;) Case _IsLeft(sExecute, &quot;.uno:&quot;)
Execute = DoCmd.RunCommand(sExecute) Execute = DoCmd.RunCommand(sExecute)
Case _IsLeft(sExecute, &quot;vnd.sun.star.script:&quot;) Case _IsLeft(sExecute, &quot;vnd.sun.star.script:&quot;)
Execute = Utils._RunScript(sExecute, Array(Nothing)) Execute = Utils._RunScript(sExecute, Array(Nothing))
Case Else Case Else
End Select End Select
Exit_Function: Exit_Function:
Utils._ResetCalledSub(cstThisSub) Utils._ResetCalledSub(cstThisSub)
Exit Function Exit Function
Error_Function: Error_Function:
TraceError(TRACEABORT, Err, cstThisSub, Erl) TraceError(TRACEABORT, Err, cstThisSub, Erl)
Reset = False Execute = False
GoTo Exit_Function GoTo Exit_Function
End Function &apos; Execute V1.3.0 End Function &apos; Execute V1.3.0
......
...@@ -2016,7 +2016,7 @@ End Sub &apos; _DispatchCommand V1.3.0 ...@@ -2016,7 +2016,7 @@ End Sub &apos; _DispatchCommand V1.3.0
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Private Function _getTempDirectoryURL() As String Private Function _getTempDirectoryURL() As String
&apos; Return the tempry directory defined in the OO Options (Paths) &apos; Return the temporary directory defined in the OO Options (Paths)
Dim sDirectory As String, oSettings As Object, oPathSettings As Object Dim sDirectory As String, oSettings As Object, oPathSettings As Object
If _ErrorHandler() Then On Local Error Goto Error_Function If _ErrorHandler() Then On Local Error Goto Error_Function
......
...@@ -156,7 +156,7 @@ Dim iNumProperties As Integer, i As Integer ...@@ -156,7 +156,7 @@ Dim iNumProperties As Integer, i As Integer
pvPropertyValuesArray(i) = pvPropertyValuesArray(i + 1) pvPropertyValuesArray(i) = pvPropertyValuesArray(i + 1)
Next i Next i
EndIf EndIf
&apos; Redimension the array to have one feweer element. &apos; Redimension the array to have one fewer element.
Redim Preserve pvPropertyValuesArray(iNumProperties - 2) Redim Preserve pvPropertyValuesArray(iNumProperties - 2)
EndIf EndIf
......
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