Commit Graph
8 Commits
Author SHA1 Message Date
Jean-Pierre Ledure c216a5fc49 ScriptForge (SF_FileSystem) IncludeSubfolders argument
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
2023-07-22 18:03:36 +02:00
Andrea Gelmini 1c22e2e656 Fix typo
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>
2023-07-15 21:19:54 +02:00
Jean-Pierre Ledure 44334328f7 ScriptForge (SF_FileSystem) support document(s internal file structure
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
2023-07-15 09:54:01 +02:00
Jean-Pierre Ledure 2a38a064df ScriptForge - Comments in code: pointers to help pages
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-17 14:40:49 +02:00
Jean-Pierre Ledure f38c39534f ScriptForge - (SF_TextStream)FIX raise error when end-of-file
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-04 16:14:10 +02:00
Jean-Pierre Ledure 055ba70145 ScriptForge - (scriptforge.py) FileSystem and TextStream classes
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-09 15:36:32 +01:00
Andrea Gelmini 05e6e8b452 Fix typos
Change-Id: Ied10667ec70293267b6a7010f0e40ed345b6cb9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105400
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-11-06 18:41:46 +01:00
Jean-Pierre Ledure 09c1bee1f9 ScriptForge - core library
Additional "LibreOffice Macros & Dialogs" library

Change-Id: I7380cf3f9ee56b73cfcf7b9e33d0cf50ecb40429
2020-11-05 15:55:39 +01:00