summaryrefslogtreecommitdiff
path: root/wizards
AgeCommit message (Collapse)Author
2021-07-14ScriptForge - (SF_Base) new CloseFormDocument() methodJean-Pierre Ledure
The closure of a form document is available from the SF_Form service. A form document is since recent commits associated with actions like PrintOut() that do not require to access its internal forms. As a consequence, the closure of a form document from the SF_Base service gains in relevance. Hence the actual commit. Change-Id: I9d4af078e6631d18c2d92c17249be6025ac9dfdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118857 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-13ScriptForge - (SF_L10N) FIX return value of AddText()Jean-Pierre Ledure
Return value should be True when successful. Was erroneously False. Minor bug. No correction in 7.1 and 7.2 Change-Id: I71040f2ba8fec80297428b0ca317e9d67c79a25e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118815 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-13ScriptForge - (SFDocuments) new PrintOut() methodJean-Pierre Ledure
The PrintOut() method launches the printing of a LO document to a printer previously defined by default, by the user or by the SetPrinter() method. It is applicable on any document, on a Calc sheet, a Base form document. For a Writer document specific arguments may be provided. Implemented both for Basic and Python user scripts. Change-Id: I51ce897b66d3e5624cec97a46e5eb28d9132357a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118786 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-09ScriptForge - (SF_Document) new SetPrinter() methodJean-Pierre Ledure
The SetPrinter() method is applicable to any document type, except Base documents. It is also applicable to Base form documents with an additional "FormDocument" argument. Implemented in Basic and in Python. The method defines next printer settings: - the printer name - the orientation - the paper format The settings are kept per document or form document To bypass array management troubles in Basic, the SF_Utils._SetPropertyValue() Sub is converted to a Function. (no user scripts impact, only internal use). Change-Id: I39290d924646ff3b2a65a6d9282f1265ca7543b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118685 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-07ScriptForge - (SF_Writer) move Forms() method from SF_DocumentJean-Pierre Ledure
The Forms() method was placed in the SF_Document service but was applicable only on Writer documents Now it is placed correctly in the recently created Writer service. Effective in Basic and Python. Additionally redundant parentheses have been removed in scriptforge.py Change-Id: I0d328b40577ddf81a188fdf72611f84751bcb506 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118559 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-07ScriptForge - (SFDocuments) New SF_Writer serviceJean-Pierre Ledure
Addition of the skeleton of the new SF_Writer service as a subclass of SF_Document. Entry points in CreateScriptService are provided both for Basic and Python user scripts. Full compatibility with existing user scripts. Specific properties and methods will be provided in later commits. Change-Id: Ib00a9ea52023707d1429e8ad9dcb4dca2ca63174 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118515 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-02ScriptForge - (SF_Exception) new PythonPrint() methodJean-Pierre Ledure
Send from BASIC the arguments of the method to the Python shell (APSO) console. The same string is added to the ScriptForge debug console. From PYTHON use simply the builtin print() statement instead. Change-Id: Iac175b2f7c5773e0369361c3f26bbc33485848db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118225 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-01ScriptForge - Backdoor to alternate Python helper scriptJean-Pierre Ledure
While developing a new version of ScriptForgeHelper.py the dev should be sure to invoke the new version instead of the standard version shipped with its LO release. This can be done now by setting - in Python a specific ScriptForge class property ScriptForge.pythonhelpermodule2 = 'user#QA/ScriptForgeHelper.py' - in Basic a specific property of the root class _SF_.PythonHelper2 = "QA/ScriptForgeHelper.py" both in the test script Testing a new version of scriptforge.py can be configured entirely from the test script by inserting next statements import sys sys.path.reverse() sys.path.append('/home/jean-pierre/.config/libreoffice/4/user/Scripts/python/QA') sys.path.reverse() Change-Id: Iab6db518932e9dde9030b7e5bbe00a50dee31840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118171 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-30Add Portuguese support to ScriptForge library (l10n)Rafael Lima
Change-Id: I04341059becb36467795a2aa1d5c2f573fe1bc6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118092 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-25ScriptForge - (SF_Platform) new Printers propertyJean-Pierre Ledure
The SF_Platform.Printers property returns the list of available printers as a zero-based array. The default printer is put in the 1st position of the list (index = [0]). The property is available in Basic and Python. Change-Id: I3f02b1b5e37aa9866491d9285683fc45d17fb664 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117776 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-22ScriptForge - (SF_UI) CreateBaseDocument() new CalcFileName argumentJean-Pierre Ledure
Syntax of CreateBaseDocument() becomes FileName, [EmbeddedDatabase=HSQLDB|FIREBIRD|CALC], [RegistrationName=""], [CalcFileName] Only when EmbedddedDatabase = "CALC", the new argument CalcFileName represents the file containing the tables as Calc sheets. The file must exist or an error is raised. Example: Dim myBase As Object, myCalcBase As Object Set myBase = ui.CreateBaseDocument("C:\Databases\MyBaseFile.odb", "FIREBIRD") Set myCalcBase = ui.CreateBaseDocument("C:\Databases\MyCalcBaseFile.odb", _ "CALC", , "C:\Databases\MyCalcFile.ods") Both Basic and Python are supported. Change-Id: I9912b110dcec12fe451a47abb61ab143fb543b94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117665 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-20Fix typosAndrea Gelmini
Change-Id: I70d723ea2d0cad5a28840e250ae261aab6a08bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117514 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-19ScriptForge - (SF_Exception) Fix signature in error messagesJean-Pierre Ledure
Basic use ProperCased arguments, Python lowercased ones. The error messages always displayed the ProperCase notation. Example: BEFORE: called both from Basic or Python: Library : ScriptForge Service : FileSystem Method : OpenTextFile Arguments: FileName, [IOMode=1], [Create=False], [Encoding="UTF-8"] A serious error has been detected in your code on argument : FileName The given file could not be found on your system. FileName = /... AFTER: called from Basic, as above, and from Python: Library : ScriptForge Service : FileSystem Method : OpenTextFile Arguments: filename, [iomode=1], [create=False], [encoding="UTF-8"] A serious error has been detected in your code on argument : filename The given file could not be found on your system. filename = /... Minor user visibility. No need to cherry-pick to 7.2 branch. Change-Id: I6938c3149fe883ded97051897c19aca23eadcc58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117501 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-19ScriptForge - (SF_PythonHelper.xba) fix signature of PyInputBox()Jean-Pierre Ledure
The last 2 arguments have resp. XPosTwips and YPosTwips as names. The signature in Python is correct. The signature in Basic still used the XPos and YPos names. No visibility towards users. No need to cherry-pick to the 7.2 branch. Change-Id: Id93de702cbcb0f3ae72a1f95247189299cb7cf30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117482 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-19ScriptForge - (SF_UI) GetDocument() accepts component objectJean-Pierre Ledure
SF_UI.GetDocument() has 1 argument. Before, must be a string designating an open window Now, also a UNO object of types com.sun.star.lang.XComponent or com.sun.star.comp.dba.ODatabaseDocument Typical usage: pass ThisComponent or ThisDatabaseDocument as argument to create a new SFDocuments.Document/Base/Calc service. Change-Id: Id9e0a40425dc3ce5e83953af5da4fb7ef8dd6f63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117442 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-18ScriptForge - (scriptforge.py/CreateScriptService) allow keyword argsJean-Pierre Ledure
For Python scripts only: the CreateScriptService() method accepts now both positional (as before) and keyword arguments. The impacted services are: - database - dialog - document - base - calc Done with the ReviewServiceArgs() class method that returns the input arguments as a tuple in the correct sequence. This method is inserted in each of the impacted service definitions. Change-Id: I545ca5ef0a4e7946d598eed07a2122885e4f864a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117387 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-17ScriptForge - Comments in code: pointers to help pagesJean-Pierre Ledure
Insert in each service module a pointer to the help page on https://help.libreoffice.org containing the user documentation of the given service. Example: SF_Array.xba contains a pointer to next help page https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_array.html?DbPAR=BASIC Only addition of comments lines. No code change. Change-Id: I83899d9fab247d23e2d5123378e2fb3fd0ade60e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117370 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-17ScriptForge - Increment version numberJean-Pierre Ledure
Increment the versioning constants from 7.2 to 7.3 in next files modified: wizards/source/scriptforge/SF_Utils.xba modified: wizards/source/scriptforge/po/ScriptForge.pot modified: wizards/source/scriptforge/po/en.po modified: wizards/source/scriptforge/python/scriptforge.py Change-Id: Iba78215cea9c16f3e7dd9302b84c90815c7a9e68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117258 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-11ScriptForge - (scriptforge.py) add reference to SF/Python help pageJean-Pierre Ledure
Change-Id: I68ec6c53bbf9f6631f33192776b154936c1b721e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117065 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-06-04ScriptForge - (scriptforge.py) ThisComponent, ThisDatabaseDocumentJean-Pierre Ledure
Addition to the Basic service for Python scripts of 2 Basic builtin objects: - ThisComponent returning the current component - ThisDatabaseDocument returning the main Base component when a subcomponent is active Both are implemented as properties of SF_Basic. The behaviour can be slightly different versus native Basic when the Basic IDE is involved. Read comments in code. Change-Id: I5d59b0ae0bae026f9b7e4c1d7068e84958aab56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116674 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-24ScriptForge - (scriptforge.py.SF_Basic): methods in alphabatical orderJean-Pierre Ledure
GetSystemTicks() and GetPathSeparator() are inverted Change-Id: I7e5c14041d6c70fe0a47519c93a24360ccc2d162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116048 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-22ScriptForge - (SF_Basic) Add new CDate() methodJean-Pierre Ledure
The CDate() method replicates in Python the behavior of the Basic builtin function with the same name, except that it returns its unique input argument when it could not be recognized as a valid date, while Basic raises an DataType error. The method is introduced to make it easy to Python devs to convert numbers stored in Calc cells and representing dates to their corresponding datetime.datetime instance. Change-Id: Ifd8fbd4bf7a97bf6b91cf481c09d75ec14159916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115989 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-21ScriptForge - (scriptforge.py) FIX stdout redirection in PythonShell()Jean-Pierre Ledure
Previous behavior: After a PythonShell() statement that opened the APSO shell console, subsequent print() statements executed in the same macro run were not displayed in the console. They were only from a next macro run. Solution: Force a brief suspension of the Python process by inserting a call to a Basic routine (IPC) immediately after the launch of the shell console. Result: The redirection of STDOUT and STDERR happens normally inside the APSO code, as expected. Change-Id: Ifbf267a898d45a97c346f0f3ea824edd4e6045ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115930 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-15ScriptForge - (scriptforge.py) None as default valueJean-Pierre Ledure
CreateScriptService() does not accept keyword arguments. In Basic positional arguments may be skipped, not in Python. This makes CreateScriptSevice('Dialog', '', '', 'myDialog') rather inelegant. Only for the Dialog service, None is accepted as default value i.o. '' for the Container and Library arguments. Change-Id: Ib96e23373140264c7100f174c7704ed32351f124 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115629 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-06ScriptForge - (scriptforge.py)Non-modal dialogs and OK/Cancel buttonsJean-Pierre Ledure
In the SFDialogs.SF_Dialog class: - Fix the comments describing the behaviour of non-modal dialogs - Add the OKBUTTON and CANCELBUTTON definitions Change-Id: I2d3abc1c610b0c60949987feb1a9d66e21abfdc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115152 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-04ScriptForge - (SF_TextStream)FIX raise error when end-of-fileJean-Pierre Ledure
Error was announced with a message box. Error message was not translatable. Managed with standard exception handling. Change-Id: I10d67985ec4bdebce5bda9123caddb4134646b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115095 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-03ScriptForge - (scriptforge.py) Fix dates transfer Basic <-> PythonJean-Pierre Ledure
Strings in CSV file recognized as dates are passed via their ISO format, not in the default com.sun.star.util.DateTime format. This required a fix in Basic ImportFromCSVFile(). Errors in user scripts can be announced to users from Python with the same interface as from Basic: SF_Exception.RaiseFatal(). Error messages become translatable. Used by SF_Exception.PythonShell(), display of APSO console, when the APSO extension is not present. Addition of the PYTHONSHELL error message in the po files. Review of typos. Change-Id: I52a19faa3773904bd37505fee780d517436485f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115032 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-05-03clean up some Java warningsNoel Grandin
Change-Id: Id54e8fd6803c3a6c0d924338d1781679ed0b1bfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115025 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-29ScriptForge - (scriptforge.py) dates passed as UNO datesJean-Pierre Ledure
In replacement of the ISO format, to avoid any misinterpretation of strings containing accidentally a date, from now on, dates are exchanged between Basic and Python as com.sun.star.util.DateTime structures. The year boundaries are [1900 - 9999]. The code managing the Python-Basic protocol has been changed on both sides. The Basic service receives the - CDateFromUnoDateTime() - CDateToUnoDateTime() methods, equivalent with their Basic homonyms. Change-Id: Ib6ded20c24ff71d3349d242f72bd7b88f69a2661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114815 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-27ScriptForge - (SFDialogs.SF_Register) DialogProviderJean-Pierre Ledure
When launching a dialog from a Python script while the dialog is contained in a document, the DialogProvider setup from that context was built by the wrong method. Use createInstanceWithArguments() i.o. createInstanceWithContext() This caused a LibreOffice crash. Change-Id: I3615c55068134085579662004f5bb085de008cbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114677 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-26ScriptForge - (SFDatabases/SFDocuments) CommandType must be a LongJean-Pierre Ledure
cfr. https://gerrit.libreoffice.org/c/core/+/114659 Change-Id: I1638ee3f523e685b324201cc9916a743db0ecb7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114662 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-24ScriptForge - (scriptforge.py) SF_Exception.PythonShell() methodJean-Pierre Ledure
The PythonShell() method invokes the console() method of the APSO extension. It accepts 1 argument, which is a dictionary of variables that the user wants transferred to the console to become part of the Python context there. Typical usage: exc.PythonShell( {**globals(), **locals()} ) Subsequent print() statements executed in the user script are displayed in the console. An (untranslated - english) error message is raised when the APSO extension is not installed. Change-Id: I1b620bc041e1293234ddfd789e0ce8892dc87169 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114561 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-22Fix typosAndrea Gelmini
Change-Id: I83e1fb153601106d028641db3c9a636813b928e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114348 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-22ScriptForge - (scriptforge.py) @classmethodsJean-Pierre Ledure
A number of methods were defined implicitly as instance methods. Where apropriate they are replaced by class methods: - insertion of the @classmethod decorator - self replaced with cls 1 line in SF_PythonHelper.xba uncommented: it was so far commented in for debugging Change-Id: Ie8c3dd740f0129511295877ef947b1db35475c48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114440 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-20ScriptForge - (SF_Database) Remove unused codeJean-Pierre Ledure
Change-Id: I85f7f1f870078aa18f28402e24b55422a10eea0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114338 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-20ScriptForge - (scriptforge.py) Dialog and DialogControl classesJean-Pierre Ledure
New classes to manage Basic dialogs and their controls from Python. The use of UNO interfaces has been reviewed in Basic: replacement of CreateUnoDialog() by XDialogProvider.createDialog() The latter allows to run dialogs in non-modal mode. SF_UI.ShowProgressBar() and SF_Console() have been reviewed to incorporate the XSCRIPTCONTEXT shipped with Python Now the console and the progress bar are able to run in non-modal mode. Change-Id: I49b09aa41ee6f50e6d205f44fc329f91bce76beb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114296 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-15ScriptForge - (SFDocuments) Fix SF_Base.OpenFormDocument()Jean-Pierre Ledure
When a Base form is: 1. opened with OpenFormDocument(), then closed 2. Opened manually in Edit mode, then closed 3. Reopened with OpenFormDocument() in normal mode - it again gets opened in Edit mode - its closure is not executed, neither by program nor manually The OpenFormDocument() method is simplified: the invoked loadComponent method may be executed even when the form is already open. It simply activates the form which is exactly the expected bahaviour. Additionally: - the opening mode is checked after the open and, if not matching the expected DesignMode argument, reset. - the alive check of a form (IsStillAlive()) does not require a database connection anymore Change-Id: I5f55e45b246867d19e514e0d820f164790dec300 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114092 Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-11ScriptForge - (scriptforge.py) Database classJean-Pierre Ledure
New class to run from Python DDL + DML SQL commands on databases embedded in or connected to Base documents. GetRows() is hardcoded as an exception (cfr. bug #138155) in _PythonDispatcher() - SF_PythonHelper.xba to be able to return 2D arrays to Python. Fix returned empty arrays in the Basic-Python engine: the standard bridge ignores them and returns a null byte sequence instead of an empty tuple. Change-Id: I336ea0b585b759b998af0871d25bfd384a2e66ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113953 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-10ScriptForge - (scriptforge.py) FormControl classJean-Pierre Ledure
New class to manage controls in forms and subforms from Python, essentially thru the use of Properties Required a review of SF_FormControl.Getproperty() Indeed, the IDE debugger computes all the properties of a Basic object when expanded in the watch window. This can cause errors. This class makes use of default values for properties when irrelevant for the actual control type Error were detected on date/time conversions of date/timefield controls and corrected. SF_String etc shortcuts have been removed (see previous commit) because not applicable in every scenario. The only entry point to the API from a user Python script is via CreateScriptService(). Change-Id: Ia87c7281c3fcf39ab0c3528f00114c9b1e067bcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113920 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-08ScriptForge - (scriptforge.py) Base and Form classesJean-Pierre Ledure
Completion of the SFDocuments.SF_Base and addition of the SFDocuments.SF_Form classes Config of properties and methods Some methods require an hardcoded processing in _PythonDispatcher() - SF_PythonHelper.xba because they potentially may return arrays (cfr. bug #138155) Addition of SF_String etc shortcuts in Python for compatibility with Basic Change-Id: Id9852c214618e863b2fdf60aa5f80e36b3547a36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113739 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-08Fix typosAndrea Gelmini
Change-Id: I41f5c964a289a88b3f6fc637797fe77d17aaab38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113737 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-06Fix typosAndrea Gelmini
Change-Id: I64d32773984a3ab06e809fcaeff8f95b910e127b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113700 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-06ScriptForge - (scriptforge.py) Remove hardcoded method synonymsJean-Pierre Ledure
To make the access to services more close to Python habits and to better attract Basic users to Python, the convention for attributes naming has been defined as: - property names may be ProperCased, camelCased or lowercased - method names may be ProperCased, camelCased or lowercased Their arguments are always lowercased In documentation examples, the camelCased notation will be privileged Synonyms for properties and methods are computed with a generic function: SCriptForge.SetAttributeSynonyms() The generic getter and setter have been reviewed accordingly. Method synonyms are NOT HARDCODED anymore. Change-Id: I528820fe195d6b67e02035e589deee2b61c056ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113666 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-04-05Fix variable nameAndrea Gelmini
Change-Id: Ida5172f860303fa9493dd3477a970d29f87444de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113596 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
2021-04-04ScriptForge (scriptforge.py) UI, Document & Calc classesJean-Pierre Ledure
Changes in the Basic-Python engine: - arguments of methods may be 2D arrays - 1st argument of method may be a Basic object - properties starting with 'X' may contain UNO objects - GetProperty may contain 1 argument Calc class is a subclass of the Document class in Python (in Basic it is simulated) A CalcReference class is also created to contain Range and Sheet objects Many comments have been reviewed for consistency in SF_Calc, SF_Form and SF_FormControl.xba Conversion to DataArrays is improved to process input arrays of arrays. Date conversions are supported. Change-Id: Id6254d668ec981b00555e7e277c4d31982c00092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113568 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-26ScriptForge - (scriptforge.py) Session classJean-Pierre Ledure
Full support of the session class methods from Python The InvokeSimpleScript() python method has been extended to support broader scopes (extensions and user documents) and ParamArray arguments in Basic. Indeed the SF_Session.ExecuteBasicScript() and SF_Session.ExecuteCalcFunction() require a varying number of arguments. No regression found in unit tests Change-Id: I0899bc6535b00340ed82b46336d60a7bb23b2098 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113154 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-24ScriptForge - (scriptforge.py) String classJean-Pierre Ledure
Only a subset of the available methods is implemented: HashStr, IsADate, IsEmail, IsFileName, IsIBAN, IsIPv4, IsLike, IsSheetName, IsUrl, SplitNotQuoted, Wrap The other methods are better replaced by Python builtin functions. The flgDateArg flag has been introduced to distinguish a date argument passed as a string that does not require conversion from a date passed in iso-format that requires a conversion to a Basic variable of type Date Change-Id: I80f7e816dfeaee793862f3c3d35488da7c573c8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113002 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-20ScriptForge - (SF_String) Add new IsIBAN() methodJean-Pierre Ledure
SF_String.IsIBAN() returns True if the given string is a valid International Bank Account Number https: //en.wikipedia.org/wiki/International_Bank_Account_Number Change-Id: I7d1257c6a8f8728c523e578e9150fbffa424e5e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112815 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>