[Libreoffice-commits] help.git: source/text
Olivier Hallot (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 28 12:23:01 UTC 2019
source/text/sbasic/shared/03131600.xhp | 34 +++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
New commits:
commit 2060b9069fa292aee06cc636e8febe0ab3d79207
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Thu Jun 27 14:08:21 2019 -0300
Commit: Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Fri Jun 28 14:22:23 2019 +0200
Add example on CreateUnoService for Calc functions
Most demanded from user base on how to call Calc function
with the API.
Change-Id: I0a01b941385d26f35369a4e6226da223e7c57cf4
Reviewed-on: https://gerrit.libreoffice.org/74813
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
diff --git a/source/text/sbasic/shared/03131600.xhp b/source/text/sbasic/shared/03131600.xhp
index cd5e2a8c8..bf830adf2 100644
--- a/source/text/sbasic/shared/03131600.xhp
+++ b/source/text/sbasic/shared/03131600.xhp
@@ -26,30 +26,41 @@
</meta>
<body>
-
-
<section id="createunoservice">
<bookmark xml-lang="en-US" branch="index" id="bm_id3150682">
- <bookmark_value>CreateUnoService function</bookmark_value>
+<bookmark_value>CreateUnoService function</bookmark_value>
</bookmark>
-
<paragraph id="hd_id3150682" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03131600.xhp" name="CreateUnoService Function">CreateUnoService Function</link></paragraph>
<paragraph id="par_id3152924" role="paragraph" xml-lang="en-US">Instantiates a Uno service with the ProcessServiceManager.</paragraph>
</section>
-<paragraph id="hd_id3152801" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+<paragraph id="par_id3153346" role="code" xml-lang="en-US">oService = CreateUnoService( Uno service name )</paragraph>
+
+<paragraph id="par_idN1060F" role="paragraph" xml-lang="en-US">For a list of available services, go to: <link href="https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html" name="api.libreoffice.org com::sun::star Module Reference">https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html</link></paragraph>
+
+<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+<bookmark xml-lang="en-US" branch="index" id="bm_id731561653332192">
+<bookmark_value>Calc functions;API Service</bookmark_value>
+<bookmark_value>Calling Calc functions in Basic</bookmark_value>
+<bookmark_value>CreateUnoService function; Calling Calc functions</bookmark_value>
+</bookmark>
+<paragraph role="paragraph" id="par_id891561653344669">Calling Calc functions in Basic:</paragraph>
<bascode>
-<paragraph id="par_id3153346" role="bascode" xml-lang="en-US">oService = CreateUnoService( Uno service name )</paragraph>
+ <paragraph role="bascode" id="par_id511561653511948" xml-lang="en-US" localize="false">Function MyVlook(item, InRange As Object, FromCol As Integer)</paragraph>
+ <paragraph role="bascode" id="par_id771561653522280" xml-lang="en-US" localize="false"> Dim oService As Object</paragraph>
+ <paragraph role="bascode" id="par_id791561653536896" xml-lang="en-US" localize="false"> oService = createUnoService("com.sun.star.sheet.FunctionAccess")</paragraph>
+ <paragraph role="bascode" id="par_id31561653863623" xml-lang="en-US"> REM Always use the function English name</paragraph>
+ <paragraph role="bascode" id="par_id391561653548274" xml-lang="en-US" localize="false"> MyVlook = oService.callFunction("VLOOKUP",Array(item, InRange, FromCol, True))</paragraph>
+ <paragraph role="bascode" id="par_id951561653556383" xml-lang="en-US" localize="false">End Function</paragraph>
</bascode>
-<paragraph id="par_idN1060F" role="paragraph" xml-lang="en-US">For a list of available services, go to: <link href="https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html" name="api.libreoffice.org com::sun::star Module Reference">https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html</link></paragraph>
-<paragraph id="hd_id3151111" role="heading" level="2" xml-lang="en-US">Examples:</paragraph>
-<paragraph id="par_id3154046" role="paragraph" xml-lang="en-US">oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" )</paragraph>
+<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+<paragraph id="par_id3154046" role="paragraph" localize="false" xml-lang="en-US"><literal>oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" )</literal></paragraph>
<bookmark xml-lang="en-US" branch="index" id="bm_id8334604">
- <bookmark_value>filepicker;API service</bookmark_value>
+<bookmark_value>filepicker;API service</bookmark_value>
</bookmark>
-
<paragraph id="par_idN10625" role="paragraph" xml-lang="en-US">The following code uses a service to open a file open dialog:</paragraph>
<bascode>
<paragraph id="par_idm1206777616" role="bascode" localize="false" xml-lang="en-US">Sub Main</paragraph>
@@ -66,5 +77,4 @@
<paragraph id="par_idm1206765040" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
</bascode>
</body>
-
</helpdocument>
More information about the Libreoffice-commits
mailing list