[Libreoffice-commits] help.git: source/text
Alain Romedenne (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 6 13:49:02 UTC 2021
source/text/sbasic/shared/03/sf_ui.xhp | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 6be958e9618242079c2c674297670ca5797a21c2
Author: Alain Romedenne <alain.romedenne at libreoffice.org>
AuthorDate: Fri Jun 18 15:59:19 2021 +0200
Commit: Rafael Lima <rafael.palma.lima at gmail.com>
CommitDate: Tue Jul 6 15:48:42 2021 +0200
extra args for sf_ui.GetDocuments() method
Change-Id: Ia991e14b5896d8c84d8e3fae115df366723d75b0
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/117418
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima at gmail.com>
diff --git a/source/text/sbasic/shared/03/sf_ui.xhp b/source/text/sbasic/shared/03/sf_ui.xhp
index ce4f93b01..c56a754bf 100644
--- a/source/text/sbasic/shared/03/sf_ui.xhp
+++ b/source/text/sbasic/shared/03/sf_ui.xhp
@@ -323,22 +323,26 @@
<bookmark_value>UI service;GetDocument</bookmark_value>
</bookmark>
<h2 id="hd_id171588520551515" localize="false">GetDocument</h2>
- <paragraph role="paragraph" id="par_id201588520551463">Returns a document object referring to either the active window or the given window.</paragraph>
+ <paragraph role="paragraph" id="par_id201588520551463">Returns a document object referring to either the active window, a given window or the active document.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
- <paragraph role="paragraph" localize="false" id="par_id811620320778478">
- <input>svc.GetDocument(windowname: str = ''): svc</input>
- </paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id811620320778478"> <input>svc.GetDocument(windowname: str = ''): svc</input></paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id251624026292796"><input>svc.GetDocument(windowname: uno): svc</input></paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
- <paragraph role="paragraph" id="par_id851588520551368"><emph>windowname</emph>: See the definitions <link href="text/sbasic/shared/03/sf_ui.xhp#WindowName" name="WindowName section">above</link>. If this argument is absent, the active window is used.</paragraph>
+ <paragraph role="paragraph" id="par_id851588520551368"><emph>windowname</emph>: See the definitions <link href="text/sbasic/shared/03/sf_ui.xhp#WindowName" name="WindowName section">above</link>. If this argument is absent, the active window is used. UNO objects of types <literal>com.sun.star.lang.XComponent</literal> or <literal>com.sun.star.comp.dba.ODatabaseDocument</literal> are also accepted. Thus passing <literal>ThisComponent</literal> or <literal>ThisDatabaseDocument</literal> as argument creates a new <link href="text/sbasic/shared/03/sf_document.xhp" name="Document service">SFDocuments.Document</link>, <link href="text/sbasic/shared/03/sf_base.xhp" name="Base service">Base</link> or <link href="text/sbasic/shared/03/sf_calc.xhp" name="Calc service">Calc</link> service.
+</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id191588522924110">Dim myDoc As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id591588520551682">Set myDoc = ui.GetDocument("C:\Documents\My file.odt")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id651624025734467">Set myBase = ui.GetDocument(ThisDatabaseDocument)</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id831620330074037">myDoc = svcUI.GetDocument(r"C:\Documents\My file.odt")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id931624025986035">from scriptforge import CreateScriptService</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id641624026031595">bridge = CreateScriptService("Basic")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id601624025839840">myDoc = svcui.GetDocument(bridge.ThisComponent)</paragraph>
</pycode>
<tip id="par_id521620330287071">To access the name of the currently active window, refer to the <literal>ActiveWindow</literal> property.</tip>
</section>
@@ -576,6 +580,8 @@
</section>
<section id="relatedtopics">
+ <embed href="text/sbasic/shared/03/sf_basic.xhp#BasicService"/>
+ <embed href="text/sbasic/shared/03/sf_calc.xhp#CalcService"/>
<embed href="text/sbasic/shared/03/sf_document.xhp#DocumentService"/>
</section>
</body>
More information about the Libreoffice-commits
mailing list