[Libreoffice-commits] help.git: source/text

Olivier Hallot (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 13:31:58 UTC 2019


 source/text/scalc/guide/userdefined_function.xhp |   33 ++++++++++++-----------
 1 file changed, 18 insertions(+), 15 deletions(-)

New commits:
commit ce079ee2ec1dcdb38eebdefd1323c4e0d4a8591f
Author:     Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Thu Nov 7 10:25:33 2019 -0300
Commit:     Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Thu Nov 7 14:31:38 2019 +0100

    Housekeeping page on Calc custom functions
    
    + Proper code formatting
    + proper menu path with MAC option
    + refactor some tags
    
    Change-Id: Ib54ade5fd1db56e27e67e4bcc1f7808cddb07341
    Reviewed-on: https://gerrit.libreoffice.org/82215
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/source/text/scalc/guide/userdefined_function.xhp b/source/text/scalc/guide/userdefined_function.xhp
index 6edae964a..c842a0809 100644
--- a/source/text/scalc/guide/userdefined_function.xhp
+++ b/source/text/scalc/guide/userdefined_function.xhp
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
-
 <!--
  * This file is part of the LibreOffice project.
  *
@@ -18,7 +16,6 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  -->
-	
 <helpdocument version="1.0">
 <meta>
 <topic id="textscalcguideuserdefined_functionxml" indexer="include" status="PUBLISH">
@@ -36,8 +33,8 @@
 <bookmark_value>IDE; Basic IDE</bookmark_value>
 <bookmark_value>programming;functions</bookmark_value>
 </bookmark>
-<paragraph role="heading" id="hd_id3155411" xml-lang="en-US" level="1"><variable id="userdefined_function"><link href="text/scalc/guide/userdefined_function.xhp" name="Defining Functions Yourself">User-Defined Functions</link>
-</variable></paragraph>
+<h1 id="hd_id3155411"><variable id="userdefined_function"><link href="text/scalc/guide/userdefined_function.xhp" name="Defining Functions Yourself">User-Defined Functions</link>
+</variable></h1>
 <paragraph role="paragraph" id="par_id3153969" xml-lang="en-US">You can apply user-defined functions in $[officename] Calc in the following ways:</paragraph>
 <list type="unordered">
 <listitem>
@@ -47,29 +44,35 @@
 <paragraph role="listitem" id="par_id3153768" xml-lang="en-US">You can program functions as <link href="text/scalc/01/04060111.xhp" name="add-ins">add-ins</link>. This method requires an advanced knowledge of programming.</paragraph>
 </listitem>
 </list>
-<paragraph role="heading" id="hd_id3149260" xml-lang="en-US" level="2">Defining A Function Using %PRODUCTNAME Basic</paragraph>
+<h2 id="hd_id3149260">Defining A Function Using %PRODUCTNAME Basic</h2>
 <list type="ordered">
 <listitem>
-<paragraph role="listitem" id="par_id3148456" xml-lang="en-US">Choose <item type="menuitem">Tools - Macros - Organize Macros - %PRODUCTNAME Basic</item>.</paragraph>
+    <paragraph role="listitem" id="par_id3148456" xml-lang="en-US">Choose <switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Basic</menuitem>.</paragraph>
 </listitem>
 <listitem>
 <paragraph role="listitem" id="par_id3154510" xml-lang="en-US">Click the <emph>Edit</emph> button. You will now see the Basic IDE.</paragraph>
 </listitem>
 <listitem>
-<paragraph role="listitem" id="par_id3150327" xml-lang="en-US">Enter the function code. In this example, we define a <item type="literal">VOL(a; b; c)</item> function that calculates the volume of a rectangular solid with side lengths <item type="literal">a</item>, <item type="literal">b</item> and <item type="literal">c</item>:</paragraph>
-<paragraph role="code" id="par_id9797426" xml-lang="en-US" localize="false">Function VOL(a, b, c)<br/>VOL = a*b*c<br/>End Function</paragraph>
+<paragraph role="listitem" id="par_id3150327" xml-lang="en-US">Enter the function code. In this example, we define a <literal>VOL(a; b; c)</literal> function that calculates the volume of a rectangular solid with side lengths <literal>a</literal>, <literal>b</literal> and <literal>c</literal>:</paragraph>
 </listitem>
+</list>
+<bascode>
+    <paragraph role="bascode" id="par_id9797426" xml-lang="en-US" localize="false">Function VOL(a, b, c)</paragraph>
+    <paragraph role="bascode" id="par_id781573129338912" xml-lang="en-US" localize="false">    VOL = a*b*c</paragraph>
+    <paragraph role="bascode" id="par_id291573129348062" xml-lang="en-US" localize="false">End Function</paragraph>
+</bascode>
+<list type="unordered">
 <listitem>
 <paragraph role="listitem" id="par_id3155443" xml-lang="en-US">Close the Basic-IDE window.</paragraph>
 <paragraph role="listitem" id="par_id3150043" xml-lang="en-US">Your function is automatically saved in the default module and is now available. If you apply the function in a Calc document that is to be used on another computer, you can copy the function to the Calc document as described in the next section.</paragraph>
 </listitem>
 </list>
-<paragraph role="heading" id="hd_id3147340" xml-lang="en-US" level="2">Copying a Function To a Document</paragraph>
+<h2 id="hd_id3147340">Copying a Function To a Document</h2>
 <paragraph role="paragraph" id="par_id3145232" xml-lang="en-US">In stage 2 of "Defining A Function Using %PRODUCTNAME Basic", in the <emph>Macro</emph> dialog you clicked on <emph>Edit </emph>. As the default, in the <emph>Macro from</emph> field the <emph>My Macros - Standard - Module1</emph> module is selected. The <emph>Standard</emph> library resides locally in your user directory.</paragraph>
 <paragraph role="paragraph" id="par_id3154022" xml-lang="en-US">If you want to copy the user-defined function to a Calc document:</paragraph>
 <list type="ordered">
 <listitem>
-<paragraph role="listitem" id="par_id3150304" xml-lang="en-US">Choose <item type="menuitem">Tools - Macros - Organize Macros - %PRODUCTNAME Basic</item> .</paragraph>
+    <paragraph role="listitem" id="par_id3150304" xml-lang="en-US">Choose <switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Basic</menuitem>.</paragraph>
 </listitem>
 <listitem>
 <paragraph role="listitem" id="par_id3150086" xml-lang="en-US">In the <emph>Macro from</emph> field select <emph>My Macros - Standard - Module1</emph> and click <emph>Edit</emph>.</paragraph>
@@ -90,15 +93,15 @@
 <paragraph role="listitem" id="par_id3148699" xml-lang="en-US">Paste the clipboard contents in the Basic-IDE of the document.</paragraph>
 </listitem>
 </list>
-<paragraph role="heading" id="hd_id3153305" xml-lang="en-US" level="2">Applying a User-defined Function in $[officename] Calc</paragraph>
-<paragraph role="paragraph" id="par_id3148869" xml-lang="en-US">Once you have defined the function <item type="literal">VOL(a; b; c)</item> in the Basic-IDE, you can apply it the same way as the built-in functions of $[officename] Calc.</paragraph>
+<h2 id="hd_id3153305">Applying a User-defined Function in $[officename] Calc</h2>
+<paragraph role="paragraph" id="par_id3148869" xml-lang="en-US">Once you have defined the function <literal>VOL(a; b; c)</literal> in the Basic-IDE, you can apply it the same way as the built-in functions of $[officename] Calc.</paragraph>
 <list type="ordered">
 <listitem>
-<paragraph role="listitem" id="par_id3148606" xml-lang="en-US">Open a Calc document and enter numbers for the function parameters <item type="literal">a</item>, <item type="literal">b</item>, and <item type="literal">c</item> in cells A1, B1, and C1.</paragraph>
+<paragraph role="listitem" id="par_id3148606" xml-lang="en-US">Open a Calc document and enter numbers for the function parameters <literal>a</literal>, <literal>b</literal> and <literal>c</literal> in cells A1, B1, and C1.</paragraph>
 </listitem>
 <listitem>
 <paragraph role="listitem" id="par_id3156019" xml-lang="en-US">Set the cursor in another cell and enter the following:</paragraph>
-<paragraph role="code" id="par_id3155264" xml-lang="en-US">=VOL(A1;B1;C1)</paragraph>
+<paragraph role="paragraph" localize="false" id="par_id3155264" xml-lang="en-US"><input>=VOL(A1;B1;C1)</input></paragraph>
 </listitem>
 <listitem>
 <paragraph role="listitem" id="par_id3146776" xml-lang="en-US">The function is evaluated and you will see the result in the selected cell.</paragraph>


More information about the Libreoffice-commits mailing list