[Libreoffice-commits] help.git: source/text
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Mar 2 15:01:07 UTC 2019
source/text/sbasic/python/python_dialogs.xhp | 6 ++----
source/text/sbasic/python/python_programming.xhp | 11 ++++++++++-
2 files changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 8e550a4a314857e55602979b124a0c8953e7e4c2
Author: LibreOfficiant <LibreOfficiant at sfr.fr>
AuthorDate: Sat Mar 2 14:19:29 2019 +0100
Commit: Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Sat Mar 2 16:00:44 2019 +0100
minor correction
Change-Id: I900e7175a028599f320d80ff30822fcad55d9046
Reviewed-on: https://gerrit.libreoffice.org/68620
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
diff --git a/source/text/sbasic/python/python_dialogs.xhp b/source/text/sbasic/python/python_dialogs.xhp
index e11055b29..6989e48f3 100644
--- a/source/text/sbasic/python/python_dialogs.xhp
+++ b/source/text/sbasic/python/python_dialogs.xhp
@@ -23,7 +23,7 @@
<section id="pythondialog1">
<h1 id="N0336"><variable id="pythondialog"><link href="text/sbasic/python/python_dialogs.xhp" name="command_name">Opening a Dialog in Python</link></variable></h1>
</section>
- <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp" name="dialog editor">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from on Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph>
+ <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp" name="dialog editor">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph>
<h2 id="N0338">My Macros or %PRODUCTNAME Macros dialogs</h2>
<paragraph role="paragraph" id="N0339">The examples below open <literal>Access2Base Trace</literal> console or the imported <literal>TutorialsDialog</literal> dialog with <menuitem>Tools – Macros – Run Macro...</menuitem> menu:</paragraph>
<pycode>
@@ -65,13 +65,11 @@
<paragraph role="pycode" id="N0379" localize="false"> </paragraph>
<paragraph role="pycode" id="N0380" localize="false">g_exportedScripts = (docDialog,)</paragraph>
</pycode>
+ <paragraph role="paragraph" id="N0381">Refer to <literal>msgbox.py</literal> in <literal>{installation}/program/</literal> directory for Python dynamic dialog examples.</paragraph>
<section id="relatedtopics" >
<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
<embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/>
<embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/>
- <paragraph role="paragraph" id="N0381">
- Refer to <literal>msgbox.py</literal> in <literal>{installation}/program/</literal> directory for Python dynamic dialog examples.
- </paragraph>
</section>
</body>
</helpdocument>
diff --git a/source/text/sbasic/python/python_programming.xhp b/source/text/sbasic/python/python_programming.xhp
index 47ed4a363..80c5ff516 100644
--- a/source/text/sbasic/python/python_programming.xhp
+++ b/source/text/sbasic/python/python_programming.xhp
@@ -260,12 +260,21 @@
<paragraph role="tablecontent" localize="false" id="N0297">ctx = uno.getComponentContext()</paragraph>
<paragraph role="tablecontent" localize="false" id="N0298">smgr = ctx.getServiceManager()</paragraph>
<paragraph role="tablecontent" localize="false" id="N0299">DESK = 'com.sun.star.frame.Desktop'</paragraph>
- <paragraph role="tablecontent" localize="false" id="N0300">obj = smgr.createInstanceWithContext(DESK , ctx)</paragraph>
+ <paragraph role="tablecontent" localize="false" id="N0300">desktop = smgr.createInstanceWithContext(DESK , ctx)</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="N0301">StarDesktop</paragraph>
</tablecell>
</tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph role="tablecontent" localize="false" id="N0298">desktop = smgr.createInstanceWithContext(DESK , ctx)</paragraph>
+ <paragraph role="tablecontent" localize="false" id="N0299">doc = desktop.CurrentComponent</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph role="tablecontent" localize="false" id="N0301">ThisComponent</paragraph>
+ </tablecell>
+ </tablerow>
</table>
<h2 id="N0297">Importing an embedded Module</h2>
<section id="PythonEmbeddedImport" >
More information about the Libreoffice-commits
mailing list