summaryrefslogtreecommitdiff
path: root/wizards/source/scriptforge/SF_UI.xba
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/scriptforge/SF_UI.xba')
-rw-r--r--wizards/source/scriptforge/SF_UI.xba9
1 files changed, 7 insertions, 2 deletions
diff --git a/wizards/source/scriptforge/SF_UI.xba b/wizards/source/scriptforge/SF_UI.xba
index 9b98053a85c9..122dd218da93 100644
--- a/wizards/source/scriptforge/SF_UI.xba
+++ b/wizards/source/scriptforge/SF_UI.xba
@@ -402,12 +402,14 @@ REM ----------------------------------------------------------------------------
Public Function GetDocument(Optional ByVal WindowName As Variant) As Variant
''' Returns a SFDocuments.Document object referring to the active window or the given window
''' Args:
-''' WindowName: see definitions. If absent the active window is considered
+''' WindowName: when a string, see definitions. If absent the active window is considered.
+''' when an object, must be a UNO object of types
+''' com.sun.star.lang.XComponent or com.sun.star.comp.dba.ODatabaseDocument
''' Exceptions:
''' DOCUMENTERROR The targeted window could not be found
''' Examples:
''' Dim oDoc As Object
-''' Set oDoc = ui.GetDocument
+''' Set oDoc = ui.GetDocument ' or Set oDoc = ui.GetDcument(ThisComponent)
''' oDoc.Save()
Dim oDocument As Object ' Return value
@@ -420,7 +422,10 @@ Const cstSubArgs = "[WindowName]"
Check:
If IsMissing(WindowName) Or IsEmpty(WindowName) Then WindowName = ""
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
+ If Not SF_Utils._Validate(WindowName, "WindowName", Array(V_STRING, V_OBJECT)) Then GoTo Finally
+ If VarType(WindowName) = V_STRING Then
If Not SF_Utils._ValidateFile(WindowName, "WindowName", , True) Then GoTo Finally
+ End If
End If
Try: