diff options
author | Alain Romedenne <alain.romedenne@libreoffice.org> | 2021-05-31 09:00:38 +0200 |
---|---|---|
committer | Rafael Lima <rafael.palma.lima@gmail.com> | 2021-06-08 14:15:19 +0200 |
commit | cfd0aa4ba18b58179724d50d7d1ac4f500ca1db4 (patch) | |
tree | b96d81d40a8b1fe5d973c78bc0386c287c723246 | |
parent | 68a8e252d2600cabc694d9c489ec641dbd3c902a (diff) |
Remove literals that prevent proper L10N
- extra index
- index relocation
Change-Id: Ia52c0db88406dd5b24514280c663cfb5de157091
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116169
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
-rw-r--r-- | source/text/sbasic/python/python_document_events.xhp | 37 | ||||
-rw-r--r-- | source/text/sbasic/shared/01040000.xhp | 1 |
2 files changed, 24 insertions, 14 deletions
diff --git a/source/text/sbasic/python/python_document_events.xhp b/source/text/sbasic/python/python_document_events.xhp index 187d299f1e..21c6457c7e 100644 --- a/source/text/sbasic/python/python_document_events.xhp +++ b/source/text/sbasic/python/python_document_events.xhp @@ -20,27 +20,27 @@ <bookmark_value>Python;Monitoring Document Events</bookmark_value> <bookmark_value>Access2Base;Console</bookmark_value> <bookmark_value>Access2Base;Trace</bookmark_value> - <bookmark_value>Tools;Strings</bookmark_value> - <bookmark_value>API;GlobalScope.BasicLibraries</bookmark_value> <bookmark_value>API;document.DocumentEvent: Monitoring Document Event</bookmark_value> <bookmark_value>API;document.XDocumentEventBroadcaster: Monitoring Document Event</bookmark_value> <bookmark_value>API;document.XDocumentEventListener: Monitoring Document Event</bookmark_value> - <bookmark_value>API;frame.Desktop: Monitoring Document Event</bookmark_value> - <bookmark_value>API;frame.GlobalEventBroadcaster: Monitoring Document Event</bookmark_value> <bookmark_value>API;lang.EventObject: Monitoring Document Event</bookmark_value> - <bookmark_value>API;script.provider.MasterScriptProviderFactory: Monitoring Document Event</bookmark_value> - <bookmark_value>API;script.provider.XScript: Monitoring Document Event</bookmark_value> </bookmark> <section id="pythonmonitor1"> <h1 id="N0527"><variable id="pythonmonitor"><link href="text/sbasic/python/python_document_events.xhp" name="Monitoring Document Events">Monitoring Document Events</link></variable></h1> </section> <paragraph role="paragraph" id="N0528">Next to <link href="text/sbasic/shared/01040000.xhp" name ="assigning macros to events">assigning macros to events</link>, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts.</paragraph> <h2 id="N0529">Listening to Document Events</h2> - <paragraph role="paragraph" id="N0530">Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning <literal>OnLoad</literal> script, to the <literal>Open Document</literal> event, suffices to initiate and terminate document event monitoring. <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab is used to assign either scripts.</paragraph> - <paragraph role="paragraph" id="N0531">Intercepting events helps setting scripts pre- and post-conditions such as loading and unloading libraries or track script processing in the background. <literal>Access2Base Trace</literal> module usage is illustrating that second context.</paragraph> - <h3 id="N0532">With Python</h3> + <paragraph role="paragraph" id="N0530">Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning <literal>OnLoad</literal> script, to the <emph>Open Document</emph> event, suffices to initiate and terminate document event monitoring. <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab is used to assign either scripts.</paragraph> + <paragraph role="paragraph" id="N0531">Intercepting events helps setting scripts pre- and post-conditions such as loading and unloading libraries or track script processing in the background. <literal>Access2Base.Trace</literal> module usage is illustrating that second context.</paragraph> + + <h3 id="N0532">With Python</h3> + <bookmark xml-lang="en-US" branch="index" id="bm_id721622446590963"> + <bookmark_value>API;frame.Desktop: Monitoring Document Event</bookmark_value> + <bookmark_value>API;script.provider.MasterScriptProviderFactory: Monitoring Document Event</bookmark_value> + <bookmark_value>API;script.provider.XScript: Monitoring Document Event</bookmark_value> + </bookmark> <paragraph role="paragraph" id="N0533">Events monitoring starts from object instantiation and ultimately stops when Python releases the object. Raised events are reported using <literal>Access2Base</literal> console.</paragraph> - <note id="N0534"><literal>OnLoad</literal> and <literal>OnUnload</literal> events can be used to respectively set and unset Python programs path. They are described as <literal>Open document</literal> and <literal>Document closed</literal>.</note> + <note id="N0534"><literal>OnLoad</literal> and <literal>OnUnload</literal> events can be used to respectively set and unset Python programs path. They are described as <emph>Open document</emph> and <emph>Document closed</emph>.</note> <pycode> <paragraph role="pycode" localize="false" id="N0535"># -*- coding: utf-8 -*-</paragraph> <paragraph role="pycode" localize="false" id="N0536">from __future__ import unicode_literals</paragraph> @@ -149,9 +149,14 @@ <paragraph role="pycode" localize="false" id="N0646"> return xScript</paragraph> </pycode> <warning id="N0647">Mind the misspelled <literal>documentEventOccured</literal> method that inherits a typo from %PRODUCTNAME Application Programming Interface (API).</warning> - <paragraph role="tip" id="N0648"><literal>Start application</literal> and <literal>Close application</literal> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <literal>Open document</literal> and <literal>Document closed</literal> events. Refer to <link href="text/sbasic/python/python_import.xhp" name ="Importing Python Modules">Importing Python Modules</link> for more information.</paragraph> - <h3 id="N0649">With %PRODUCTNAME Basic</h3> - <paragraph role="paragraph" id="N0650">The <literal>Onload</literal> script is assigned to <literal>Open document</literal> event using <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab. Events monitoring starts from the moment a <literal>ConsoleLogger</literal> object is instantiated and ultimately stops when Basic engine releases it. <literal>OnLoad</literal> event loads necessary Basic libraries, while caught events are reported using <literal>Access2Base.Trace</literal> module.</paragraph> + <paragraph role="tip" id="N0648"><emph>Start application</emph> and <emph>Close application</emph> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <emph>Open document</emph> and <emph>Document closed</emph> events. Refer to <link href="text/sbasic/python/python_import.xhp" name ="Importing Python Modules">Importing Python Modules</link> for more information.</paragraph> + + <h3 id="N0649">With %PRODUCTNAME Basic</h3> + <bookmark xml-lang="en-US" branch="index" id="bm_id591622446367707"> + <bookmark_value>API;GlobalScope.BasicLibraries</bookmark_value> + <bookmark_value>Tools;Strings</bookmark_value> + </bookmark> + <paragraph role="paragraph" id="N0650">The <literal>Onload</literal> script is assigned to <emph>Open document</emph> event using <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab. Events monitoring starts from the moment a <literal>ConsoleLogger</literal> object is instantiated and ultimately stops when Basic engine releases it. <literal>OnLoad</literal> event loads necessary Basic libraries, while caught events are reported using <literal>Access2Base.Trace</literal> module.</paragraph> <bascode> <paragraph role="bascode" xml-lang="en-US" id="N0651">REM controller.Events module</paragraph> <paragraph role="bascode" localize="false" id="N0652">Option Explicit</paragraph> @@ -228,7 +233,11 @@ <paragraph role="bascode" xml-lang="en-US" id="N0723">' Your code for handled events goes here</paragraph> </bascode> <warning id="N0724">Mind the misspelled <literal>_documentEventOccured</literal> method that inherits a typo from %PRODUCTNAME Application Programming Interface (API).</warning> - <h2 id="N0725">Discovering Documents Events</h2> + + <h2 id="N0725">Discovering Documents Events</h2> + <bookmark xml-lang="en-US" branch="index" id="bm_id681622445958242"> + <bookmark_value>API;frame.GlobalEventBroadcaster: Monitoring Document Event</bookmark_value> + </bookmark> <paragraph role="paragraph" id="N0726">The broadcaster API object provides the list of events it is responsible for:</paragraph> <h3 id="N0727">With Python</h3> <pycode> diff --git a/source/text/sbasic/shared/01040000.xhp b/source/text/sbasic/shared/01040000.xhp index 182aa39ade..942be5ce68 100644 --- a/source/text/sbasic/shared/01040000.xhp +++ b/source/text/sbasic/shared/01040000.xhp @@ -33,6 +33,7 @@ <bookmark_value>assigning macros to events</bookmark_value> <bookmark_value>documents; events</bookmark_value> <bookmark_value>events; assigning macros</bookmark_value> + <bookmark_value>events; in documents</bookmark_value> <bookmark_value>API; XDocumentEventListener</bookmark_value> </bookmark> <h1 id="hd_id3147348"><link href="text/sbasic/shared/01040000.xhp" name="Event-Driven Macros">Document Event-Driven Macros</link></h1> |