summaryrefslogtreecommitdiff
path: root/wizards/source/sfdialogs/SF_Register.xba
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2020-12-08 15:06:31 +0100
committerJean-Pierre Ledure <jp@ledure.be>2020-12-08 16:31:11 +0100
commit5fa2182d3b5c79bc4cf8ec9621228ddc00283a1f (patch)
treeb0c259d753ec784e463d46841beec3af9c0658fc /wizards/source/sfdialogs/SF_Register.xba
parent73d592f963c4135b36c4417436bf14c87e1cf0d4 (diff)
ScriptForge - (SFDialogs) OnNodeSelected/Expanded for tree controls
OnNodeSelected and OnNodeExpanded cannot be defined thru the Basic IDE Those editable new properties are used to set up the relevant listeners on the control's view The listener Subs are garthered in a new module, SF_DialogListener The need to preserve these 2 properties required the existence of a cache of all control objects in the parent dialog instance This technique with listeners can be reused (mutatis mutandis) in other contexts to introduce additional event types Change-Id: I243808590e0534901e041a5f5abad64eb5e118d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107420 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards/source/sfdialogs/SF_Register.xba')
-rw-r--r--wizards/source/sfdialogs/SF_Register.xba11
1 files changed, 7 insertions, 4 deletions
diff --git a/wizards/source/sfdialogs/SF_Register.xba b/wizards/source/sfdialogs/SF_Register.xba
index 7018385a1442..ac19bdebff34 100644
--- a/wizards/source/sfdialogs/SF_Register.xba
+++ b/wizards/source/sfdialogs/SF_Register.xba
@@ -203,6 +203,8 @@ Dim oBasicDialog As Object &apos; Return value
Dim oCache As _DialogCache &apos; Entry in the cache
Set oBasicDialog = Nothing
+
+Try:
For Each oCache In _SF_.SFDialogs
If EqualUnoObjects(poDialog, oCache.XUnoDialog) And Not oCache.Terminated Then
Set oBasicDialog = oCache.BasicDialog
@@ -210,8 +212,9 @@ Dim oCache As _DialogCache &apos; Entry in the cache
End If
Next oCache
+Finally:
Set _FindDialogInCache = oBasicDialog
-
+ Exit Function
End Function &apos; SFDialogs.SF_Documents._FindDialogInCache
REM -----------------------------------------------------------------------------
@@ -231,7 +234,7 @@ Dim vLibrary As Variant &apos; Alias of pvArgs(1)
Dim vDialogName As Variant &apos; Alias of pvArgs(2)
Dim oLibraries As Object &apos; com.sun.star.comp.sfx2.DialogLibraryContainer
Dim oLibrary As Object &apos; com.sun.star.container.XNameAccess
-Dim o_DialogProvider As Object &apos; com.sun.star.io.XInputStreamProvider
+Dim oDialogProvider As Object &apos; com.sun.star.io.XInputStreamProvider
Dim oEnum As Object &apos; com.sun.star.container.XEnumeration
Dim oComp As Object &apos; com.sun.star.lang.XComponent
Dim vWindow As Window &apos; A single component
@@ -301,7 +304,7 @@ Try:
If Not .isLibraryLoaded(vLibrary) Then .loadLibrary(vLibrary)
Set oLibrary = .getByName(vLibrary)
If Not oLibrary.hasByName(vDialogName) Then GoTo CatchNotFound
- Set o_DialogProvider = oLibrary.getByName(vDialogName)
+ Set oDialogProvider = oLibrary.getByName(vDialogName)
End With
Set oDialog = New SF_Dialog
@@ -310,7 +313,7 @@ Try:
If VarType(vContainer) = V_STRING Then ._Container = vContainer Else ._Container = vWindow.WindowName
._Library = vLibrary
._Name = vDialogName
- Set ._DialogProvider = o_DialogProvider
+ Set ._DialogProvider = oDialogProvider
._Initialize()
End With