summaryrefslogtreecommitdiff
path: root/wizards
AgeCommit message (Collapse)AuthorFilesLines
2021-05-15ScriptForge - (scriptforge.py) None as default valueJean-Pierre Ledure1-2/+10
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 Ledure1-1/+8
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 Ledure5-8/+39
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 Ledure7-12/+50
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 Grandin1-2/+2
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 Ledure2-52/+101
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 Ledure1-2/+2
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 Ledure2-6/+5
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 Ledure1-12/+37
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 Gelmini1-2/+2
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 Ledure2-50/+79
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 Ledure1-19/+0
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 Ledure8-200/+413
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 Ledure2-16/+10
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 Ledure3-8/+67
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 Ledure5-68/+118
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 Ledure3-15/+113
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 Gelmini1-2/+2
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 formatHossein1-2/+4
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 Gelmini1-1/+1
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 Ledure1-167/+51
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 Gelmini1-1/+1
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 Ledure7-48/+479
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 Ledure2-14/+126
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 Ledure2-3/+66
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 READMEHossein1-0/+0
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 Ledure1-0/+76
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>
2021-03-18ScriptForge - (scritforge.py) SF_Basic: review of function signaturesJean-Pierre Ledure1-30/+33
The signatures of standard Basic built-in functions were derived from the Help documentation. They appeared to be inexact. They now comply with core/basic/source/runtime/stdobj.cxx Change-Id: I343fb553f5fad5236d75f6b72910714d47b6a289 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112669 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-17ScriptForge - (scriptforge.py) Array classJean-Pierre Ledure2-6/+55
The SF_Array (Basic) class is highly redundant with the Python tuple/list classes. Hence only 1 method is implemented in Python: ImportFromCSVFile() to have the same csv files imported identically in both environments. The returned value is a tuple of tuples. Restriction: dates are recognized but converted to their ISO format. Up to the user to interpret them correctly. Change-Id: I6611964a8083a9d7c6f9622b2aef64fe8b1491ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112585 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-16ScriptForge - (scriptforge.py) Exception classJean-Pierre Ledure4-6/+105
The SF_Exception class is not intended to replace or complement the builtin Python exception handling. Hence it implements only a subset of the corresponding Basic service. - no properties: they are fully related to Basic error trapping - next methods are available: Console, ConsoleClear, ConsoleToFile, DebugPrint and RaiseFatal (reserved for internal use) Restriction: Console() does not work in non-modal mode. DebugPrint formats its messages by using the repr() builtin method. DebugPrint outputs from Basic or from Python are mixed within the same console. The other methods call their Basic counterpart. A new method has been added both in Python and Basic: DebugDisplay It combines DebugPrint with a display in a message box of the arguments. Change-Id: Iba94ab951b95b409c881ac17560476d6e9bc2fc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112570 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-15ScriptForge - (scriptforge.py) Dictionary classJean-Pierre Ledure1-14/+116
The new SF_Dictionary class subclasses the dict native Python class and implements 2 methods: - ConvertToPropertyValues() - ImportFromPropertyValues() Usage: dico = dict(A = 1, B = 2, C = 3) myDict = CreateScriptService('Dictionary', dico) # Initialize myDict with the content of dico myDict['D'] = 4 print(myDict) # {'A': 1, 'B': 2, 'C': 3, 'D': 4} propval = myDict.ConvertToPropertyValues() or, alternatively: dico = dict(A = 1, B = 2, C = 3) myDict = CreateScriptService('Dictionary') # Initialize myDict as an empty dict object myDict.update(dico) # Load the values of dico into myDict myDict['D'] = 4 print(myDict) # {'A': 1, 'B': 2, 'C': 3, 'D': 4} propval = myDict.ConvertToPropertyValues() Change-Id: I932e899062c39f3fe8ab05dcf3cd02acf2f060a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112488 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-14Fix typosAndrea Gelmini1-1/+1
Change-Id: Ied3445430ffefbf27674f103c879a606909c9b3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112478 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-03-14ScriptForge - (scriptforge.py) enhance property and method namingJean-Pierre Ledure1-62/+159
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 enhanced: - 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 are managed with generic functions. The generic getter and setter has been reviewed accordingly. Method synonyms are hardcoded. The management of synonyms for servicenames have also been reviewed to be defined in each class i.o. centrally and hardcoded in CreateScriptService() Change-Id: Id8d3181118b1e61937e2412109bd0d1eedd6f5e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112470 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-13ScriptForge - (scriptforge.py) Platform classJean-Pierre Ledure1-2/+74
Addition of SF_Platform class Most properties are provided by a direct call to ScriptForgeHelper.py Others result from an interaction with the Basic-Python machinery Addition of STarDesktop() method in the SF_Basic class Change-Id: If1c03fe8e0ad36b6a665c8c44b477eca7cbc24bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112393 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-10ScriptForge - (scriptforge.py) L10N classJean-Pierre Ledure2-2/+29
Addition of SF_L10N class Correction in Languages() property: selection of file based on *.po filter i.o. ??-??.po Change-Id: I5c57d1973265f2aeb7a3cfb4f507ffd50a28785a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112211 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-09ScriptForge - (scriptforge.py) FileSystem and TextStream classesJean-Pierre Ledure5-33/+236
Addition of SF_FileSystem and SF_TextStream classes Machinery tuning: - freeze a predefined list of standard modules in the python persistent storage - error management reviewed to mimic Basic behaviour on wrong arguments Standard modules are predefined in scriptforge.py as well Both lists must be synchronized on a hardcoded entry number Basic has minor revisions: - complex boolean expressions return -1 and 0 to Python i.o. True and False => Add a CBool() function - [User]TemplatesFolder properties of FileSystem omitted the final "/" Change-Id: Ice138de956f5f87269557cdb3db023849081b99d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112199 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-07Fix typosAndrea Gelmini2-15/+15
Change-Id: I0a6b74356bd689b54883efc4608a06fb9446e828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112024 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Tested-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-05ScriptForge - (scriptforge.py) Python-Basic machineryJean-Pierre Ledure10-19/+1498
Python scripts can now invoke usual Basic builtin functions Example: from ScriptForge import CreateScriptService bas = CreateScriptService('Basic') bas.MsgBox('This is the text to be displayed', bas.MB_ICONEXCLAMATION) Python scripts can use most ScriptForge services written in Basic Example: from scriptforge import CreateScriptService FSO = CreateScriptService('FileSystem') a = FSO.BuildPath('/tmp', 'xyz') Syntax and semantic are as close as possible to the Basic syntax Implemented are a SFServices class and its subclasses representing each a ScriptForge service and where the interfaces are defined (properties, methods and arguments) Their execution goes through the "machinery", i.e. a set of python and basic routines that manage the call from the python process to the appropriate service in an as much agnostic and generic way Only a limited set of services are implemented so far: SF_FileSystem (partially) and SF_Timer: they served as prototypes and initial tests Change-Id: I0b383b59359c12710e7165139e498cca5a7856bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111971 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-21ScriptForge - (SF_Platform) new Locale and PythonVersion propertiesJean-Pierre Ledure2-1/+28
- 'Locale' returns a la-CO (language-COUNTRY) string derived from com.sun.star.lang.Locale - 'PythonVersion' returns Python major.minor.patchlevel supplied by ScriptForgeHelper.py platform class Change-Id: I2b8495c03253b17c5e4ba14765b1f359eee67813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111284 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-09ScriptForge - (SF_String) more severe check on the date validity of IsADate()Jean-Pierre Ledure1-5/+15
So far IsADate checked the format of the date only, not the validity vs. leap years, days in month, etc. Corrected with an error check on the DateSerial() builtin function Change-Id: I3fc53ea83e0a1472b2861f256266c4422cce2580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110590 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-09ScriptForge - (SF_Array) new Copy() methodJean-Pierre Ledure1-0/+52
Duplicate the array A simple assignment copies the reference, not the data In code like: Dim a, b a = Array(1, 2, 3) b = a a(2) = 30 MsgBox b(2) ' Displays 30 Replace by b = SF_Array.Copy(a) to get a real duplication of the initial array Change-Id: I62b931b92995c6607a3b354c60f0ebafb042b88a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110591 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-08ScriptForge - (SF_DialogControl) Fix list of propertiesJean-Pierre Ledure1-9/+11
List was incomplete: trre control properties were missing Additionally, comments wre reread thanks to writing of help files Typos or approximations were reviewed Change-Id: I799011f27d89d93278027f5f3cf9853d3d2371cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110575 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-07Fix typosAndrea Gelmini1-2/+2
Change-Id: I30743ea4caf9702f26005567d293f076ff7f78fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110517 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-02-06ScriptForge - (SF_FormControl) add SetFocus() methodJean-Pierre Ledure1-6/+31
The SetFocus() method simply applies the setFocus() UNO method for usual controls. However controls belonging to a table control require, to receive the focus, the columns to be scanned from left to right up to the targeted column. Change-Id: Idbb1ca4b4b29bff889daa83cfa895501c466bb26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110485 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-04ScriptForge - (SF_FormControl) Review error checkingJean-Pierre Ledure5-9/+50
- separate error message vs corresponding message for dialogs - more precision on form naming: form document.form name - add new error message in SF_Exception and SF_Root messages lists - add new message in po files Change-Id: I1f7f2dc7b5627d12a8c5ecf238e6cbd3aa1505fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110380 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-03Fix typosAndrea Gelmini1-3/+3
Change-Id: I322b1176c02b33336e4e393e565ad66f43eb42a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110343 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-03ScriptForge - (SF_Exception) fix DebugPrint accepts missing argumentsJean-Pierre Ledure1-0/+1
In statements like: DebugPrint(,a) the first missing argument gives an error 448 The error is now intercepted and replaced by a zero-length string in the console display Change-Id: Id41f2c786ef935e062815f8cf1e80b0a1fec5857 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110327 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-02ScriptForge - (new SF_FormControl): form control propertiesJean-Pierre Ledure5-11/+1915
The whole set of properties is created including - updatable OnXxx event properties - the Value property as a shortcut to the control content for all the control types Controls events management is included Access to the subcontrols of table controls is included as well Addition of the new file in the SFDocuments make file Change-Id: I6308a71e3dd499d729cee1565002b6a9d84f7743 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110289 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-01-26Access2Base - (Control.xba) FIX Get DefaultValue for DateField controlsJean-Pierre Ledure1-2/+2
The DefaultDate was read correctly but not returned to the calling program Change-Id: Ie15a48a6366c1575f4914a2b60c836890fe53a43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109921 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-01-17Fix typoAndrea Gelmini1-3/+3
Change-Id: I0ce46927730cef961bbefd12551b2d56e8fe357d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109240 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>