Skip to content

Commit 0ca51f9

Browse files
committed
Update VBAexpressionsScope.xba
1 parent 9989cbc commit 0ca51f9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/LO Basic/VBAExpressionsLib/VBAexpressionsScope.xba

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ Public Function CopyToScope() As Object
335335
Dim i As Long
336336
Dim tmpValue As String
337337
Dim tmpName As String
338-
Dim tmpScope As VBAexpressionsScope
338+
Dim tmpScope As Object
339+
Dim ConstKey As String
339340

340341
Set tmpScope = New VBAexpressionsScope
341342
For i = 0 To P_EXPR_VARIABLES.aindex
342343
tmpName = P_EXPR_VARIABLES.Storage(i).aName
343344
tmpValue = P_EXPR_VARIABLES.Storage(i).value
344345
If tmpValue <> vbNullString Then
346+
tmpScope.AddVariable(tmpName, ConstKey)
345347
tmpScope.LetVarValue(tmpName, tmpValue)
346348
End If
347349
Next
@@ -357,6 +359,24 @@ Private Sub ExpandCBbuffer(ByRef aBuffer As ClusterBuffer)
357359
aBuffer.Storage = tmpBuffer
358360
End Sub
359361

362+
Public Sub ExtendScope(ByRef sourceScope As Object)
363+
Dim i As Long
364+
Dim tmpVar() As String
365+
Dim varLB As Long
366+
Dim cKey As String
367+
Dim cValue As String
368+
369+
With sourceScope
370+
tmpVar() = Split(.CurrentVariables, "; ")
371+
varLB = LBound(tmpVar)
372+
For i=VarLB To UBound(tmpVar)
373+
AddVariable tmpVar(i), cKey
374+
cValue = .GetVarValue(tmpVar(i))
375+
LetVarValue tmpVar(i), cValue
376+
Next i
377+
End With
378+
End Sub
379+
360380
Public Sub FillPredefinedVars()
361381
Dim i As Long
362382
Dim tmpIdx As Long

0 commit comments

Comments
 (0)