Age | Commit message (Collapse) | Author |
|
The algorithm used to shuffle a 1D array
prevented any item of the array to remain
in the same entry after the shuffle.
This has been fixed. The potential targeted entries
to receive an item include the actual entry.
This change might impact existing scripts that
have Randomize()d their sorts to always get the
same shuffle results. This should impact test
scripts only.
SF_Array.Shuffle() is available in Basic only.
No impact on help pages.
Change-Id: If56d901f4af68f8889a7352c306bae6e3443ae97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161987
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Used pyflakes to find unused imports from wizards module. Then, removed
those unused imports.
Change-Id: I27f1c38871eafb57a5f914f4de3f825889b4ac68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142522
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
|
|
Copyright years are also reviewed to include 2024.
Change-Id: I1f30443922a6dc3b35c6f05616a5c4e56de1e396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161277
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: Ic16b782d63e84581134f2238454aa9599819f146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160359
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
|
|
Suppression of linefeeds in excess
inside english error messages.
Change-Id: I38189e7dcf9d24055e477a5cb6cfeb42644ded39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160385
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
Two bugs are fixed with this commit:
1. when rows in a dataset are read in chunks,
one record is skipped errorneously between
every two successive chunks.
2. In updatable datasets, the updatable fields
need to be identified. This is done at
dataset creation.
Before: the IsDefinitelyWritable criterion was
used, valid for Firebird, not for HSQL
After: the IsWritable criterion is used,
valid for both.
The correction in Basic is valid as well for Python.
Documentation is unchanged.
Change-Id: I990c02aaa8a93123a7e669b1294605fa19780167
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160163
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I07a4d9fc05a49e17503d9fecd642bfe84466a408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159956
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Transactions are managed by next UNO properties:
XConnection.AutoCommit
XConnection.TransactionIsolation
(They seem very easy to use but, in practice,
are not easy at all)
Usually all transactions are in auto-commit mode,
that means, a commit takes place after each
single SQL command.
Switching auto-commit off means however that
the connection needs to be of type "ISOLATED"
and not of the default type "SHARED".
=> The usual shared connection must be closed.
As a consequence, all rowsets/resultsets linked
to the shared connection need to be closed as well.
=> Additionally the buffers must be emptied (flushed)
to make committed data visible in the Base user
interface.
All above aspects and constraints are managed in the
database.SetTransactionMode(transactionmode)
database.Commit()
database.Rollback()
methods transparently for the user scripts.
The [transactionmode] argument has as value one of
the TransactionIsolation constants.
Without argument, database.SetTransactionMode()
restores the automatic mode.
The manual transaction mode is available for both
Basic and Python scripts.
Its implementation will require an update of the
documentation about the Database service.
Change-Id: I214bd91a1744d6d24609bc5efc987152c6e946c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159867
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I5f6ddc80fb13f7c0b1841cab034539e500353511
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159346
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The
database.GetRows()
dataset.GetRows()
methods return an array of data collected
in a database table or query.
When a column has the type DATE, the transmission
of their values through the Basic-Python bridge
require them to be converted upfront to UNO
DateTime structures.
The later conversion from UNO DateTime to the python
datetime.datetime structure has been added with
this patch.
No impact on Basic scripts.
The documentation does not need to be changed.
Change-Id: I7a6533aff70d2d1402bfc3f057b65a4940148cc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159348
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
A dataset represents a set of tabular data
stored/produced by a database.
To use datasets, the database instance must exist
but the Base document may not be open.
A Dataset instance is create either with
- the (new) database.CreateDataset() method
- from an existing dataset with the (new)
dataset.CreateDataset() method.
The proposed API supports next main purposes:
- browse for- and backward thru the dataset to get its content
- update any record with new values
- create new records or delete some.
In summary, the AKA "CRUD" operations
(create, read, update, delete).
The originality of the proposed API is the use
of a dense syntax to make insertions and updates
easy and readable:
Example:
(BASIC)
Dim newID As Long
newID = dataset.Insert("LastName", "Doe", "FirstName", "John")
' ... is equivalent to:
Dim dict As Object, newID As Long
Set dict = CreateScriptService("ScriptForge.Dictionary")
dict.Add("LastName", "Doe")
dict.Add("FirstName", "John")
newID = dataset.Insert(dict)
(PYTHON) - next statements are equivalent
newid = dataset.Insert('LastName', 'Doe', 'FirstName', 'John')
newid = dataset.Insert({'LastName': 'Doe', 'FirstName': 'John'})
newid = dataset.Insert(dict(LastName = 'Doe', FirstName = 'John'))
newid = dataset.Insert(LastName = 'Doe', FirstName = 'John')
You will notice that the returned value is the AutoValue primery
key (when it exists) which makes it reuse as a foreign key
immediate.
The API is fully available both in Basic and Python user scripts.
The new service will require its inclusion in the user documentation.
Change-Id: I4f834c4234e5b96ec8fddfffbad791ecf31899df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159325
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
and annotate where necessary, mostly just suppressing the warnings
Change-Id: I8e39d797cde6c7c3f4e3e1bd93a128965ecec81d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159205
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
replace with Character.valueOf
Change-Id: I9938db0fce6490eba6f4900efc3c139a1b71d120
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158786
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
replace with Double.valueOf
Change-Id: If5be8e500e31ebf9d5fb20ea7dd474677d7c74ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158785
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
replace with Float.valueOf
Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I70b570b74c793418ec6e045d454d20107675b9a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157601
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I0ece1c462f3b493273cf70e32a78b718f0255ed7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157602
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Ib459277f1c535304a863d1061acf7b261e37aa7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157605
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I7bfff7c50e9b97fec7d2100a542849360bb48e90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157603
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I0b557b4bc7e6b5ba569b2fce7bf8aee5e407e4ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157604
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Introduction of new properties and methods:
- StyleFamilies
List of available style families
All document types except Base
- XStyle(family, stylename)
UNO representation of given style
All document types except Base
- Styles(family, [namepattern, used, userdefined,
parentstyle, category)
A list of styles matching the given criteria
All document types except Base
- DeleteStyles(family, styleslist)
Suppress the user-defined styles in the list
All document types except Base and FormDocument
- ImportStylesFromFile(filename, families, overwrite)
Load styles from a closed file
Calc and Writer only
Example: to delete unused styles:
a = doc.Styles("ParagraphStyles", used := False)
doc.DeleteStyles("ParagraphStyles", a)
All functionalities are available from Basic and
Python scripts.
Documentation has to be completed.
Change-Id: I2533c14912257b58feb42bb11ff9d151c7b9531a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157563
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
When the Recipient argument is absent when calling
session.SendMail(...)
or is not a string, an error message is raised,
as should, but its content is wrong.
The error message is now corrected.
Change-Id: I248b6ce55c85a4b956f834c8e1ea7d0df40ab233
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157488
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
Error occurs in SF_Base.IsLoaded(...)
"Object variable not set"
When user scripts run the method repeatedly from
nearly simultaneous events, it might happen
that the _FormDocuments private variable is
not initialized.
Simultaneous calls may be interpreted as internal
calls. Internal calls do not execute the "Check"
part of the published API.
Hence the failing initialization.
Solution: force the initialization of that specific
variable at each run.
Change-Id: I489cbaed7b8e57d6876b7af4b26f5be0beb3db69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157374
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I0e7ceeafcf4c5a802249125e6be44a71adb1456b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156480
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
The XDocumentSettings property returns a
com.sun.star.XXX.DocumentSettings
UNO object.
XXX = sheet, text, drawing or presentation
It gives access to a bunch of UNO internal
properties, specific to the document(s type.
The property is available in Basic and Python
user scripts.
An update of the SF_Document service help
page is required.
Change-Id: I9d6db473c91ac5b1814def9cd100e874aa5490cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156475
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: Ide2a33e282b575caf14374d7ae8034da41a6ed63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155942
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I05e93bd2c9ca3a270e07a4c0c7d09e4d3d6cea81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155941
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The incident occurs when a move (last(),
first(), next()) within the form's resultset
is done from a Basic script immediately
after the opening of the document
containing the form.
The insertion of a
Wait 1
statement prevents the occurrence of
the incident by interrupting very shortly
the Basic process.
Change-Id: I5e798db6e3f9ffaeeef38fb9badd008cbb190d1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155897
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Incremental changes had made the code in
SF_PythonHelper.xba
scriptforge.py
(which manage the protocol between the Python
user scripts and the ScriptForge services
implemented in Basic) less readable and efficient.
Next features have been reviewed:
- dict instances may be passed as arguments
and returned. Conversions are done on-th-fly.
- dates may be passed as arguments
and returned. Conversions are done on-th-fly.
The lists of hardcoded methods have been removed.
- 2D arrays in standard modules may be passed
as arguments and returned. Conversions are done
on-th-fly. The lists of hardcoded methods have
been removed.
- The hardcoded list of methods requiring a post-
processing has been reduced.
- Methods in standard modules, when not returning
an array, are also executed with CallByName().
- The unused 'localProperties' attribute in Python
services has been removed.
- Flags about arrays in standard modules have been
adapted in
filesystem.Files()
filesystem.SubFolders()
session.UnoMethods()
session.UnoProperties()
string.SplitNotQuoted()
string.Wrap()
ui.Documents()
- The platform.UserData property became a usual
property.
Dictionaries are admitted as arguments and return
values. As a consquence next functions are supported
in Python as well:
session.GetPDFExportOpetions()
session.SetPDFExportOptions()
document, calc, writer.CustomProperties
document, calc, writer.DocumentProperties
These changes require an update of the help pages.
Non-regression tests were run with success. All changes
are transparent for existing scripts.
Change-Id: Iae7a1f5090c590209cd3cb2314c919c44736eba9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155860
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
When not embedded, databases usually
require user and password to grant
access to scripts.
When the access was refused, so far the
execution was stopped brutally with an
error message provided by LO internal
code.
This was made visible during some tests
with a MySql database server.
The code to be reviewed is located in the
creation of the "database" service. This
service has the sungularity that it can
be called from several other service
instances.
As from this commit unsuccessful tentatives
to login to a database from code are
rejected with a clean SF error message.
The different scenarios to create a
database service have been (re)tested.
Change-Id: I695d108242872d27671688af76916784908aeebe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155507
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Fix error message when no attachment
passed to the method.
Execution continues now without trouble.
Change-Id: I447af45db97f086963027c131c6b5fb9dab93c7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155066
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I7ac33586a01a65e20143ec1e853c6720de453d35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155054
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The UserData property lists the content of the
"User Data" oage of the Options dialog.
The content is returned:
- in Basic: in a SF_Dictionary instance
- in Python: in a dict[] instance.
The list of the available keys is:
city, company, country, email, encryptionkey,
encrypttoself, fax, firstname, homephone,
initials, lastname, officephone, position,
postalcode, signingkey, state, street, title
Many are different from the UNO/priginal values
to make them more user understandable.
This commit will require an update of the SF_Platform
help page.
Both Basic and Python user scripts are supported.
Change-Id: If645579ee9109a1b8180da5a5f3a71979bb5ca59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155024
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Typos in comment lines
Change-Id: I5e92417af0c9fb1f6f4d240a5a7731c9efa5230d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154802
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I2a14c233aa09aec55b18dae2d4018a07c012ab52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154795
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Ia6252da165d734b752ea6cad96f8014556bb4bfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154796
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
In the FileSystem service, the
- SubFolders()
- Files()
methods receive an optional argument
IncludeSubfolders (Boolean).
That argument determines whether or not only
the given FolderName is explored or also its subfolders
up to the bottom of the folders structure.
The argument must be used with caution as the number
of returned folders or files may increase rapidly.
anThis could consume excessive process time.
This patch will require an update of the
help page about the filesystem service.
The new argument is available both for Basic and Python
user scripts.
Change-Id: Id2a96cd63cb51f8681f20a203a711b47a636fc3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154763
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I67075b3ae5e57b8924e12770d835a83513147da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154536
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
|
|
Change-Id: I4bbd4b05ca42ccde4b83eb55a1f1ae80ebca9680
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154592
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
|
|
Change-Id: I04d3440d121e6305b3435964b88d221bf4bce221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154486
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: If33699080b8f56998416b87db1e75e91b0ed18ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154485
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I62c3e5394e52591df08e2f6acd826718dc1a0cbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154484
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I5e1093f05a9916991304a178a73d81c073883479
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154483
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I7a1afd67e976abe504f859f0f5561ac5ebc6df98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154482
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: If692d47efd95e3383734b91ea72d4d665503b3d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154481
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
1. The SF_Document services (document, base, calc,
formdocument, writer) receive a new FileSystem
property that returns the "root" of the
component's file structure under the format:
"vnd.sun.star.tdoc:/XXX"
XXX being the document's identifier.
The implementation does not use the RuntimeUID
(UNO property of the OfficeDocument service) which
is optional and, f.i. not present for Base documents.
Instead the
css.frame.TransientDocumentsDocumentContentFactory
service is used.
2. The SF_FileSystem and SF_TextStream modules have been
reviewed to support the new context.
Next restrictions have been met:
- The FileNaming property is always cnsidered as 'URL'
- CompareFiles() is not applicable
- GetFileLen() always returns zero
- HashFile() is not applicable
- Normalize() always returns the input string unchanged
- PickFile() is not applicable
- PickFolder() is not applicable
Additionally,
- CreatetextFile()
- OpenTextFile() in write or append modes
copy or initialize the file in a temporary storage
and write it back in the document when it is being closed.
The process is transparent for the user.
3. The GetTempName() method accepts an option
Extension
argument, for better convenience.
The new functionalities are available in Basic and Python.
Changes require an update of the help documentation.
Change-Id: Ibf8dd9983656923cf6ab43d9f48398dc4d1e6307
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154443
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: If127e00bab20839021afe82df555083bbae72ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154384
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I07db487d94c2d0a8f2ec5955f6e94b00911d25c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154214
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
|
|
Change-Id: I1049c2bec21caa751a37708023338a1449dc5539
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153953
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
|
|
Change-Id: Id0d9335df80539877d1ee27e57e98b0a6aae75db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152337
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|