core.git: wizards/source
wizards/source/scriptforge/SF_Session.xba | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) New commits: commit e110974bc1c2a0b253d27cf3ad2643aa5208e2cd Author: Jean-Pierre Ledure AuthorDate: Sat Mar 23 17:41:49 2024 +0100 Commit: Jean-Pierre Ledure CommitDate: Sun Mar 24 17:35:49 2024 +0100 ScriptForge (session).RunApplication() redesign The RunApplication() method uses - either the Shell() Basic built-in function (only in asynchronous mode) - or the com.sun.star.system.SystemShellExecute() service in this order. The second is tried in case of failure of the first one. Benefits: - the method can start batch files or scripts - broader than Shell(): giving a user file as argument opens its application first based on the file suffix - more robust error handling Read discussion in tdf#160222. This change could require a light revisit of the sf_session help page. Change-Id: I1fb4717db4b971bd62885ad0e38b7c08a8e6f434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165218 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index 307fb7a8f4bf..cc6e576e1c5f 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -563,9 +563,12 @@ Public Function RunApplication(Optional ByVal Command As Variant _ The method does not validate the given parameters, but only passes them to the specified command Returns: True if success + Exceptions: + UNKNOWNFILEERRORCommand could not be identified as a valid file Examples: session.RunApplication(Notepad.exe) session.RunApplication(C:\myFolder\myDocument.odt) + session.RunApplication(kate) (Linux) session.RunApplication(kate, /home/me/install.txt)(Linux) Dim bReturn As Boolean Returned value @@ -585,9 +588,23 @@ Check: End If Try: - Set oShell = SF_Utils._GetUNOService(SystemShellExecute) - sCommand = SF_FileSystem._ConvertToUrl(Command) - oShell.execute(sCommand, Parameters, com.sun.star.system.SystemShellExecuteFlags.DEFAULTS) + Cfr. discussion tdf#160222 + 1) Try Shell(), always in not synchronized mode + 2) If failure - check command existence as a valid file + - try com.sun.star.system.SystemShellExecute + sCommand = SF_FileSystem._ConvertFromUrl(Command) + On Local Error GoTo Step2 + Shell(sCommand, , Parameters, False) + Step2: + If Err 0 Then + On Error GoTo 0 Reset error status + If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch + If Not SF_FileSystem.FileExists(Command) Then GoTo CatchNotExists + Set oShell = SF_Utils._GetUNOService(SystemShellExecute) + sCommand = SF_FileSystem._ConvertToUrl(Command) + oShell.execute(sCommand, Parameters, com.sun.star.system.SystemShellExecuteFlags.DEFAULTS) + End If + bReturn = True Finally: @@ -596,6 +613,9 @@ Finally: Exit Function Catch: GoTo Finally +CatchNotExists: + SF_Exception.RaiseFatal(UNKNOWNFILEERROR, Command, Command) + GoTo Finally End Function ScriptForge.SF_Session.RunApplication REM -
core.git: wizards/source
wizards/source/scriptforge/SF_Session.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 065fa9d77e5bd550600e8985d7e7aac8e10745c4 Author: Jean-Pierre Ledure AuthorDate: Thu Mar 21 15:54:55 2024 +0100 Commit: Jean-Pierre Ledure CommitDate: Fri Mar 22 09:54:47 2024 +0100 ScriptForge (session).RunApplication() crash fix tdf#160222 Use com.sun.star.system.SystemShellExecuteFlags.DEFAULTS i.o. com.sun.star.system.SystemShellExecuteFlags.URIS_ONLY as argument of com.sun.star.system.SystemShellExecute.execute() Change-Id: I3919777cf9442387aec6ed694a2883519e4a7910 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165105 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index aeca1133e346..307fb7a8f4bf 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -587,7 +587,7 @@ Check: Try: Set oShell = SF_Utils._GetUNOService(SystemShellExecute) sCommand = SF_FileSystem._ConvertToUrl(Command) - oShell.execute(sCommand, Parameters, com.sun.star.system.SystemShellExecuteFlags.URIS_ONLY) + oShell.execute(sCommand, Parameters, com.sun.star.system.SystemShellExecuteFlags.DEFAULTS) bReturn = True Finally:
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 55bf8a21d06c47760976f4d0051248797be47a61 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:07:37 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:51:03 2024 +0100 Fix typo Change-Id: I67c1591af46b530c3cbf46b0871d863a5c0aec24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164907 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 5efe74036760..4bfabb381414 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -1684,7 +1684,7 @@ class SFScriptForge: """ Gets the offset between GMT and the given timezone and locale, in minutes. Args -``imezone``: the timezone for which the offset to the GMT will be calculated. +``timezone``: the timezone for which the offset to the GMT will be calculated. ``locale``: the locale specifying the country for which the offset will be calculated, given either in "la-CO" or "CO" formats.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 08750535c5c88dced2e46710506efc06d8312c0f Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:05:28 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:50:47 2024 +0100 Fix typo Change-Id: Ie04b3b3a96b2d4651b6dc477215f29a48c1be4c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164901 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index e3f4c3a2fecd..5efe74036760 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -3440,7 +3440,7 @@ class SFDialogs: accuracy: int = ... ) -> Optional[DIALOGCONTROL]: """ -Create a new control of type ``CurrenyField`` in the actual dialog. +Create a new control of type ``CurrencyField`` in the actual dialog. Args ``controlname``: the name of the new control. It must not exist yet.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a0d5d8d16595dd9e9b2adcdd1817650b25569554 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:05:46 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:50:27 2024 +0100 Fix typo Change-Id: I1264c4594bbedf7398816552795e33c489ef2863 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164902 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 8a2a3f050be1..e3f4c3a2fecd 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -769,7 +769,7 @@ class SFScriptForge: Use the console when the Python shell is not available, for example in ``Calc`` user defined functions (UDF) or during events processing. -Use the ``DebugPrint()`` and ``DebuDisplay()`` methods to log any relevant information, events and data +Use the ``DebugPrint()`` and ``DebugDisplay()`` methods to log any relevant information, events and data of any type to the console. Console entries can be dumped to a text file or visualized in a dialogue.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3764ae10f86f4b40f98b0e69e61268604c331c27 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:10:47 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:49:54 2024 +0100 Fix typo Change-Id: I8c5c281897c53afb456b63c5f3838059bd1887d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164912 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 251e24184ca8..8a2a3f050be1 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -2749,7 +2749,7 @@ class SFDatabases: ``sqlcommand``: a table name, a query name or a ``SELECT SQL`` statement. ``directsql``: when ``True``, no syntax conversion is done by LibreOffice. -Ignored when ``sqlommand`` is a table or a query name. Defaults to ``False``. +Ignored when ``sqlcommand`` is a table or a query name. Defaults to ``False``. ``header``: when ``True``, a header row is inserted on the top of the list with the column names. Defaults to ``False``. @@ -4441,7 +4441,7 @@ class SFDocuments: IsWriter: bool """ ``True`` when type of document = ``Writer``.""" Keywords: str -""" Get/set the ``Keywords`` property of the document as a comma-seprated list of keywords. +""" Get/set the ``Keywords`` property of the document as a comma-separated list of keywords. This property is not applicable to ``Base`` documents. """ Readonly: bool """ ``True`` if the document is actually in read-only mode.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 42a01a525b325bf381cb5e08bc74416d1d4d64a5 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:08:33 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:49:23 2024 +0100 Fix typo Change-Id: Iac27e35e92ec8f481d0d6ba71c87f72e10a99ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164910 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index f47592d1888a..251e24184ca8 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -977,7 +977,7 @@ class SFScriptForge: def CreateFolder(self, foldername: FILE) -> bool: """ -Creates the specified ``olderame``. +Creates the specified ``foldername``. If the specified folder has a parent folder that does not exist, it is created. Args foldername: a string representing the folder to create. It must not exist.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5569de72d7e8c4db34df5ffa10e0f46234cff1e7 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:11:12 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:48:44 2024 +0100 Fix typo Change-Id: I07c180c9b659950fa0ecc4bf8ca26f2d133a393c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164913 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 6cc54616e70d..f47592d1888a 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -2843,7 +2843,7 @@ class SFDatabases: call the ``Commit()`` method to apply the changes to the database. Args -``tranactionmode``: specifies the transaction mode. +``transactionmode``: specifies the transaction mode. This argument must be one of the constants defined in ``com.sun.star.sdbc.TransactionIsolation`` (Default = ``NONE``) Returns
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 66567a0bcd9374fcc99813315c02b64b2c5a2066 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:03:22 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:47:17 2024 +0100 Fix typo Change-Id: I3620d218898a91293d57611d4dcf062f75045892 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164897 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index dbbf38da8391..41d10c27f2b3 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -6686,7 +6686,7 @@ class SFDocuments: ``printoddpages``: print the right pages when ``True`` (default). -``printimages``: print the graphic objects when ``True`` (defauly). +``printimages``: print the graphic objects when ``True`` (default). Returns ``True`` when successful. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c1215a2e085395a38fb83ad1a854d698c0e9cf31 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:08:08 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:46:56 2024 +0100 Fix typo Change-Id: I0a68811af1f5b9d32f453592ec357fa694747d35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164909 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 5ef926d44fe2..dbbf38da8391 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -6569,7 +6569,7 @@ class SFDocuments: Returns a Database service instance (service = ``SFDatabases.Database``) giving access to the execution of SQL commands on the database linked with the actual form document. Args -``user``, ``oassword``: the login parameters. +``user``, ``password``: the login parameters. """ ...
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b360a2b64f4c6937f92fc01614d21faeeca42bf2 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:03:07 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:46:34 2024 +0100 Fix typo Change-Id: Ibb07cca05ef733932326ceb29aa3fd1cd1e969d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164896 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index f70e3490ce6d..5ef926d44fe2 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -6601,7 +6601,7 @@ class SFDocuments: ``printoddpages``: print the right pages when ``True`` (default). -``printimages``: print the graphic objects when ``True`` (defauly). +``printimages``: print the graphic objects when ``True`` (default). Returns ``True`` when successful. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3f9a557813633f95ff7191241955fa343093be21 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:07:03 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:46:08 2024 +0100 Fix typo Change-Id: Id099d4e9471415d572f7eac56e70d20cbae8e577 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164906 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 4ae1e93dfdde..f70e3490ce6d 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -608,7 +608,7 @@ class SFScriptForge: ``title``: String expression displayed in the title bar of the dialog box. -``default``: String expression displayed in the text box as default ifno other input is given. +``default``: String expression displayed in the text box as default if no other input is given. ``xpostwips``: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7abfe574e2c5ef026ea31d5ae2e76315fa842569 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:06:47 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:45:46 2024 +0100 Fix typo Change-Id: I42521b965da582e00e4fa9186bb5de3ea3defd4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164905 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index c9ab46376efb..4ae1e93dfdde 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -7000,7 +7000,7 @@ class SFWidgets: """ Displays the popup menu and waits for a user action. Args -``returnid``: if ``True`` (default), the numeric identfier of the selected item is returned. +``returnid``: if ``True`` (default), the numeric identifier of the selected item is returned. If ``False``, the method returns the item's name. Returns The item clicked by the user.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d7d37ac32c5c7828d376fd71e4a3f5fbc359a22f Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:09:53 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:45:20 2024 +0100 Fix typo Change-Id: I2e38b46435d927fe4fe8d656c92e7a75a5771ba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164911 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index b3e88e901081..c9ab46376efb 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -130,7 +130,7 @@ SCRIPT_URI = TypeVar('SCRIPT_URI', str, str) """ SQL_SELECT = TypeVar('SQL_SELECT', str, str) """ A SQL command containing a SELECT statement, a tablename or a queryname. -In a SELECT statement, table-, qyery- and field names may be surrounded by square brackets. """ +In a SELECT statement, table-, query- and field names may be surrounded by square brackets. """ SQL_ACTION = TypeVar('SQL_ACTION', str, str) """ A SQL command containing an action statement (CREATE TABLE, INSERT, DELETE, ...). Table- and field names may be surrounded by square brackets. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7e0a186d18b1fabe85816d9656925dce9b552dd0 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:07:55 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:44:56 2024 +0100 Fix typo Change-Id: I3f6f98e2781dd6ca37483ca4224b76f7b474a909 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164908 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index b39777162f79..b3e88e901081 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -3912,7 +3912,7 @@ class SFDialogs: ``border``: "3D" (default), "FLAT" or "NONE". -``mintome``: the smallest time that can be entered in the control. Default = 0h. +``mintime``: the smallest time that can be entered in the control. Default = 0h. ``maxtime``: the largest time that can be entered in the control. Default = 24h. Returns
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 36f6aea73fcac19d14d5362476e9de6887d92612 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:12:36 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:44:32 2024 +0100 Fix typo Change-Id: I5b5182b56259808e7c4c351f24510806bf79c9fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164916 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 371d7b8c22c1..b39777162f79 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -6975,7 +6975,7 @@ class SFWidgets: tooltip: str = ..., ) -> int: """ -Inserts a radio btton in the menu. +Inserts a radio button in the menu. Args ``menuitem``: defines the text to be displayed in the menu. This argument also defines the hierarchy of the item inside the menu by using the submenu
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5640b1b0d340301e0b90506952eef2d67e0b8ad1 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:04:55 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:44:11 2024 +0100 Fix typo Change-Id: I58ae1ae35bef53a79dfb60ac17b485e7e22a8d87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164900 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index f823d713ff58..371d7b8c22c1 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -4835,7 +4835,7 @@ class SFDocuments: def IsLoaded(self, formdocument: str) -> bool: """ -Return ``True`` if the given form Ddcument is currently open. +Return ``True`` if the given form Document is currently open. Args ``formdocument``: A valid hierarchical form document name as a case-sensitive string. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c68303fb07ad061fc55e978064fe8bb959a3a6fe Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:14:06 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:43:42 2024 +0100 Fix typo Change-Id: I6e332fc1366cf6cc20f7d4bbb546996bcfcfc6f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164919 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index a1b244e111de..f823d713ff58 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -4108,7 +4108,7 @@ class SFDialogs: Format: Literal["Standard (short)", "Standard (short YY)", "Standard (short )", "Standard (long)", "DD/MM/YY", "MM/DD/YY", "YY/MM/DD", "DD/MM/", "MM/DD/", "/MM/DD", "YY-MM-DD", "-MM-DD", "24h short", "24h long", "12h short", "12h long"] -""" Get/set the format used to display dates and times. Applicable to ``DateField, TimeFiels, FormattedField`` +""" Get/set the format used to display dates and times. Applicable to ``DateField, TimeField, FormattedField`` controls. """ Height: int """ Get/set the height of the control. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7c42fca202ae6aeecbb85b18e9166bab050a48f9 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:13:28 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:42:52 2024 +0100 Fix typo Change-Id: I5c2075d5c3e87fe5e4f56d884bf7bcfb7371498b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164917 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index e339ada06d63..c01d40b57fe0 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -41,7 +41,7 @@ The scriptforge.pyi module - provides the static type checking of all the visible interfaces of the ScriptForge API. - when the user uses an IDE like PyCharm or VSCode, (s)he might benefit from the typing - hints provided by them thanks to the twin scriptforhe.pyi module. + hints provided by them thanks to the twin scriptforge.pyi module. Usage:
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 26785eed7615fb9467892d59f6b9a525e388980f Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:15:14 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:42:08 2024 +0100 Fix typo Change-Id: Ib1f5fdc8c44c62619325f6d21d834459905fab44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164921 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index c08c618373cf..a1b244e111de 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -1578,7 +1578,7 @@ class SFScriptForge: def Language(self, region: str = ...) -> str: """ -Gets tthe name of the language, in English, of the specified region. +Gets the name of the language, in English, of the specified region. Args ``region``: formatted as "la-CO" or "la". """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5b7e83ddb004c1e97ccaba3ef6967f152c44e7f5 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:14:16 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:41:44 2024 +0100 Fix typo Change-Id: I54dff81d7dffda684f3e39a5ebf1dda06959b9dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164920 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 143e93ab865d..c08c618373cf 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -6389,7 +6389,7 @@ class SFDocuments: Format: Literal["Standard (short)", "Standard (short YY)", "Standard (short )", "Standard (long)", "DD/MM/YY", "MM/DD/YY", "YY/MM/DD", "DD/MM/", "MM/DD/", "/MM/DD", "YY-MM-DD", "-MM-DD", "24h short", "24h long", "12h short", "12h long"] -""" Get/set the format used to display dates and times. Applicable to ``DateField, TimeFiels, FormattedField`` +""" Get/set the format used to display dates and times. Applicable to ``DateField, TimeField, FormattedField`` controls. """ ListCount: int """ Get the number of rows in the control. Applicable to ``ComboBox, ListBox`` controls. """
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 85eb0d1394f1c867e932671192fecc815c5915eb Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:16:25 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:38:12 2024 +0100 Fix typo Change-Id: I965793a29a92eedbb541a22b5be0350c6b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164923 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 7b2cd2fc9b77..143e93ab865d 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -5605,7 +5605,7 @@ class SFDocuments: ``sheetname``: the name of the new sheet. ``beforesheet``: the name (string) or index (numeric, starting from 1) of the sheet -efore which to insert the new sheet. This argument is optional and the default behavior +before which to insert the new sheet. This argument is optional and the default behavior is to insert the sheet at the last position. Returns ``True`` if the sheet could be inserted successfully.
core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.pyi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit da56c68f5a3ff0c7f310224e83b7a60cb8b38632 Author: Andrea Gelmini AuthorDate: Sat Mar 16 10:12:12 2024 +0100 Commit: Julien Nabet CommitDate: Sat Mar 16 19:37:42 2024 +0100 Fix typo Change-Id: I493fece1547f15d1e428146928e34807a96636a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164914 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 0f0e77d98cfd..7b2cd2fc9b77 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -5697,7 +5697,7 @@ class SFDocuments: When ``False`` range selection is allowed. ``closeafterselect``: when ``True`` (default) the dialog is closed immediately after -the selection is made. wWhen ``False`` the user can change the selection as many times +the selection is made. When ``False`` the user can change the selection as many times as needed. Dialog closure is manual. Returns The selected range as a string, or the empty string when the user cancelled the request.
core.git: wizards/source
wizards/source/scriptforge/SF_Array.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ca9168b8ad842c86b2168e12bb98087b9f8139bd Author: Jean-Pierre Ledure AuthorDate: Fri Jan 12 22:30:06 2024 +0100 Commit: Jean-Pierre Ledure CommitDate: Sat Jan 13 11:20:08 2024 +0100 ScriptForge (SF_Array) fix tdf#158976 Shuffle() 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Array.xba b/wizards/source/scriptforge/SF_Array.xba index 54110cde9352..1b5ae92df523 100644 --- a/wizards/source/scriptforge/SF_Array.xba +++ b/wizards/source/scriptforge/SF_Array.xba @@ -1767,7 +1767,7 @@ Try: Next i Now ... shuffle ! Do While lCurrentIndex lMin - lRandomIndex = Int(Rnd * (lCurrentIndex - lMin)) + lMin + lRandomIndex = Int(Rnd * (lCurrentIndex - lMin + 1)) + lMin vSwapValue = vShuffle(lCurrentIndex) vShuffle(lCurrentIndex) = vShuffle(lRandomIndex) vShuffle(lRandomIndex) = vSwapValue
core.git: wizards/source
wizards/source/scriptforge/SF_Utils.xba |2 +- wizards/source/scriptforge/__License.xba |2 +- wizards/source/scriptforge/po/ScriptForge.pot|4 ++-- wizards/source/scriptforge/po/en.po |4 ++-- wizards/source/scriptforge/python/scriptforge.py |4 ++-- wizards/source/sfdatabases/__License.xba |2 +- wizards/source/sfdialogs/__License.xba |2 +- wizards/source/sfdocuments/__License.xba |2 +- wizards/source/sfunittests/__License.xba |2 +- wizards/source/sfwidgets/__License.xba |2 +- 10 files changed, 13 insertions(+), 13 deletions(-) New commits: commit 5fc9908b956fbc87b8b0933a1c8c6bb956e38bbc Author: Jean-Pierre Ledure AuthorDate: Mon Dec 25 13:10:46 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Mon Dec 25 14:10:36 2023 +0100 ScriptForge - Upgrade to version 24.8 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index 5ebdd58ce9ab..eac0cb282b27 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -21,7 +21,7 @@ REM = GLOBAL Global _SF_As VariantSF_Root (Basic) object) ScriptForge version -Const SF_Version = 24.2 +Const SF_Version = 24.8 Standard symbolic names for VarTypes V_EMPTY = 0 diff --git a/wizards/source/scriptforge/__License.xba b/wizards/source/scriptforge/__License.xba index a817525250ef..f08c294d4431 100644 --- a/wizards/source/scriptforge/__License.xba +++ b/wizards/source/scriptforge/__License.xba @@ -1,7 +1,7 @@ http://openoffice.org/2000/script; script:name="__License" script:language="StarBasic" script:moduleType="normal"> - Copyright 2019-2022 Jean-Pierre LEDURE, Rafael LIMA, Alain ROMEDENNE + Copyright 2019-2024 Jean-Pierre LEDURE, Rafael LIMA, Alain ROMEDENNE REM === REM ===The ScriptForge library and its associated libraries are part of the LibreOffice project. === diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot index 5bf1aa6a008e..430e61d4e884 100644 --- a/wizards/source/scriptforge/po/ScriptForge.pot +++ b/wizards/source/scriptforge/po/ScriptForge.pot @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 24.2 +# ScriptForge Release 24.8 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION " "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI " -"POT-Creation-Date: 2023-12-04 16:36:35 " +"POT-Creation-Date: 2023-12-25 12:02:38 " "PO-Revision-Date: -MM-DD HH:MM:SS " "Last-Translator: FULL NAME " "Language-Team: LANGUAGE " diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po index 5bf1aa6a008e..430e61d4e884 100644 --- a/wizards/source/scriptforge/po/en.po +++ b/wizards/source/scriptforge/po/en.po @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 24.2 +# ScriptForge Release 24.8 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION " "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI " -"POT-Creation-Date: 2023-12-04 16:36:35 " +"POT-Creation-Date: 2023-12-25 12:02:38 " "PO-Revision-Date: -MM-DD HH:MM:SS " "Last-Translator: FULL NAME " "Language-Team: LANGUAGE " diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 998d57d066a8..de590875c961 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2020-2022 Jean-Pierre LEDURE, Rafael LIMA, Alain ROMEDENNE +# Copyright 2020-2024 Jean-Pierre LEDURE, Rafael LIMA, Alain ROMEDENNE # = # === The ScriptForge library and its associated libraries are part of the LibreOffice project. === @@ -108,7 +108,7 @@ class
core.git: wizards/source
wizards/source/scriptforge/po/pt.po | 103 +--- 1 file changed, 96 insertions(+), 7 deletions(-) New commits: commit b5526d4e95a465bee9fc810794570023f2a76ca5 Author: Rafael Lima AuthorDate: Wed Dec 6 15:11:24 2023 +0100 Commit: Rafael Lima CommitDate: Sun Dec 10 19:06:41 2023 +0100 Update Portuguese translation of ScriptForge Change-Id: Ic16b782d63e84581134f2238454aa9599819f146 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160359 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/wizards/source/scriptforge/po/pt.po b/wizards/source/scriptforge/po/pt.po index f1d7ae9f0e57..aa4f5d5cfac6 100644 --- a/wizards/source/scriptforge/po/pt.po +++ b/wizards/source/scriptforge/po/pt.po @@ -7,7 +7,7 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.6 +# ScriptForge Release 24.2 # --- # msgid "" @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?; "product=LibreOffice_status=UNCONFIRMED=UI\n" -"POT-Creation-Date: 2021-06-19 16:57:15\n" -"PO-Revision-Date: 2022-08-03 18:30-0300\n" +"POT-Creation-Date: 2023-09-03 13:05:04\n" +"PO-Revision-Date: 2023-12-06 11:18-0300\n" "Language-Team: pt-BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1226,13 +1226,11 @@ msgctxt "DUPLICATECONTROL" msgid "" "A control with the same name exists already in the dialog '%3'.\n" "\n" -"« %1 » = %2\n" -"" +"« %1 » = %2" msgstr "" "Um controle com o mesmo nome já existe na caixa de diálogo '%3'.\n" "\n" -"« %1 » = %2\n" -"" +"« %1 » = %2" #. SF_Database when running update SQL statement #. %1: The concerned method @@ -1262,6 +1260,97 @@ msgstr "" "\n" "Instrução SQL : « %1 »" +#. SF_Database can't interpret SQL statement +#. %1: The statement +#. %2: a WHERE clause +#. %3: a ORDER BY clause +#, kde-format +msgctxt "SQLSYNTAX2" +msgid "" +"An SQL statement could not be interpreted or executed by the " +"database system.\n" +"Check its syntax, table and/or field names, ...\n" +"\n" +"SQL Statement : « %1 »\n" +"combined with\n" +"« %2 »\n" +"« %3 »" +msgstr "" +"Uma instrução SQL não pôde ser interpretada ou executada pelo " +"sistema de banco de dados.\n" +"Verifique a sintaxe, nomes de tabelas e/ou nomes dos campos, ...\n" +"\n" +"Instrução SQL : « %1 »\n" +"combinada com\n" +"« %2 »\n" +"« %3 »" + +#. SF_Dataset can't read field values or store field updates +msgctxt "NOCURRENTRECORD" +msgid "" +"A database record could not be retrieved, inserted or updated by the " +"database system.\n" +"The current record could not be determined." +msgstr "" +"Um registro do banco de dados não pôde ser recuperado, inserido ou " +"atualizado pelo sistema de banco de dados.\n" +"O registro atual não pôde ser determinado." + +#. SF_Database can't store field updates +#. %1: The field name +#. %2: the value to store in the field +#, kde-format +msgctxt "RECORDUPDATE" +msgid "" +"A database record could not be inserted or updated by the database " +"system.\n" +"Possible reasons:\n" +"- the field is not updatable\n" +"- a [NULL] value is provided which is forbidden for the field\n" +"- the type of value and the type of field are incompatible\n" +"- the input binary file does not exist or is empty\n" +"- the field type is not supported\n" +"\n" +"Field name : « %1 »\n" +"Field value : « %2 »\n" +"Field type : « %3 »" +msgstr "" +"Um registro do banco de dados não pôde ser inserido ou atualizado " +"pelo sistema de banco de dados.\n" +"Possíveis motivos:\n" +"- o campo não é atualizável\n" +"- um valor [NULL] foi fornecido, mas não é permitido para o campo\n" +"- o tipo do valor e o tipo do campo não são compatíveis\n" +"- o arquivo binário de entrada não existe ou está vazio\n" +"- o tipo do campo não é suportado\n" +"\n" +"Nome do campo : « %1 »\n" +"Valor do campo : « %2 »\n" +"Tipo do campo : « %3 »" + +#. SF_Dataset.ExportToFile error message +#. %1: An identifier +#. %2: A file name +#. %3: An identifier +#. %4: True or False +#. +#, kde-format +msgctxt "FIELDEXPORT" +msgid "" +"The database field could not be exported.\n" +"Either the destination file must not be overwritten, or it has a " +"read-only attribute set.\n" +"\n" +"%1 = '%2'\n" +"%3 = %4" +msgstr "" +"O campo do banco de dados não pôde ser exportado.\n" +"O arquivo de destino não pode ser sobrescrito, ou o arquivo está " +"definido como somente leitura.\n" +"\n" +"%1 = '%2'\n" +"%3 = %4" + #. SF_Exception.PythonShell error messageAPSO: to leave unchanged msgctxt "PYTHONSHELL" msgid ""
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Root.xba|4 ++-- wizards/source/scriptforge/po/ScriptForge.pot |8 +++- wizards/source/scriptforge/po/en.po |8 +++- 3 files changed, 8 insertions(+), 12 deletions(-) New commits: commit e8ac98c6569f8c462e754a3142aeb9f433588ec8 Author: Jean-Pierre Ledure AuthorDate: Wed Dec 6 12:02:49 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Wed Dec 6 17:55:57 2023 +0100 ScriptForge (SF_Root) Fix typos 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 diff --git a/wizards/source/scriptforge/SF_Root.xba b/wizards/source/scriptforge/SF_Root.xba index dc1bfa32a49c..69e0ee25ec42 100644 --- a/wizards/source/scriptforge/SF_Root.xba +++ b/wizards/source/scriptforge/SF_Root.xba @@ -1022,7 +1022,7 @@ Try: SF_Dialog.CreateControl .AddText( Context := DUPLICATECONTROL _ , MsgId := A control with the same name exists already in the dialog %3.\n\n _ - « %1 » = %2\n _ + « %1 » = %2 _ , Comment :=SF_Dialog CreateControl\n _ %1: An identifier\n _ %2: A string\n _ @@ -1059,7 +1059,7 @@ Try: SF_Dataset.Update/Insert/Delete/GetValue .AddText( Context := NOCURRENTRECORD _ , MsgId := A database record could not be retrieved, inserted or updated by the database system.\n _ - The current record could not be determined.\n _ + The current record could not be determined. _ , Comment := SF_Dataset cant read field values or store field updates _ ) SF_Dataset._SetColumnValue diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot index 814f75ec041f..5bf1aa6a008e 100644 --- a/wizards/source/scriptforge/po/ScriptForge.pot +++ b/wizards/source/scriptforge/po/ScriptForge.pot @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2023-11-11 15:24:14\n" +"POT-Creation-Date: 2023-12-04 16:36:35\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -965,8 +965,7 @@ msgctxt "DUPLICATECONTROL" msgid "" "A control with the same name exists already in the dialog '%3'.\n" "\n" -"« %1 » = %2\n" -"" +"« %1 » = %2" msgstr "" #. SF_Database when running update SQL statement @@ -1012,8 +1011,7 @@ msgctxt "NOCURRENTRECORD" msgid "" "A database record could not be retrieved, inserted or updated by the " "database system.\n" -"The current record could not be determined.\n" -"" +"The current record could not be determined." msgstr "" #. SF_Database can't store field updates diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po index 814f75ec041f..5bf1aa6a008e 100644 --- a/wizards/source/scriptforge/po/en.po +++ b/wizards/source/scriptforge/po/en.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2023-11-11 15:24:14\n" +"POT-Creation-Date: 2023-12-04 16:36:35\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -965,8 +965,7 @@ msgctxt "DUPLICATECONTROL" msgid "" "A control with the same name exists already in the dialog '%3'.\n" "\n" -"« %1 » = %2\n" -"" +"« %1 » = %2" msgstr "" #. SF_Database when running update SQL statement @@ -1012,8 +1011,7 @@ msgctxt "NOCURRENTRECORD" msgid "" "A database record could not be retrieved, inserted or updated by the " "database system.\n" -"The current record could not be determined.\n" -"" +"The current record could not be determined." msgstr "" #. SF_Database can't store field updates
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |2 +- wizards/source/sfdatabases/SF_Dataset.xba |7 --- 2 files changed, 5 insertions(+), 4 deletions(-) New commits: commit 07036eea5089feae511145412d7105cb76c1955a Author: Jean-Pierre Ledure AuthorDate: Thu Nov 30 17:11:13 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Fri Dec 1 13:43:45 2023 +0100 ScriptForge (SF_Dataset) fix GetRows() in chunks 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 Tested-by: Jenkins diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index fa5d0778b873..ff0eafc5b783 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -28,7 +28,7 @@ Option Explicit Transaction handling Changes to data remain reversible until the moment the running script instructs the database to commit them. The implicit (default) behaviour is that commit takes place after the execution of every single SQL statement. - The choice can be made (SetTranactionMode()) to take commitments manually. + The choice can be made (SetTransactionMode()) to take commitments manually. The Commit() and Rollback() statements delimit transactions. Service invocation and usage: diff --git a/wizards/source/sfdatabases/SF_Dataset.xba b/wizards/source/sfdatabases/SF_Dataset.xba index e9eb050d93f0..02b3d35affd9 100644 --- a/wizards/source/sfdatabases/SF_Dataset.xba +++ b/wizards/source/sfdatabases/SF_Dataset.xba @@ -585,6 +585,7 @@ Check: If Not ScriptForge.SF_Utils._Validate(Header, Header, ScriptForge.V_BOOLEAN) Then GoTo Finally If Not ScriptForge.SF_Utils._Validate(MaxRows, MaxRows, ScriptForge.V_NUMERIC) Then GoTo Finally End If + If MaxRows 0 Then MaxRows = 1 Try: With _RowSet @@ -608,7 +609,7 @@ Try: End If Load data - Do While bRead And (MaxRows = 0 Or lRows MaxRows - 1) + Do While bRead lRows = lRows + 1 If lRows = 0 Then ReDim vResult(0 To lRows, 0 To lCols) @@ -618,7 +619,7 @@ Try: For i = 0 To lCols vResult(lRows, i) = _ParentDatabase._GetColumnValue(_RowSet, i + 1) Next i - bRead = .next() + If MaxRows = 0 Or lRows MaxRows - 1 Then bRead = .next() Else bRead = False Loop Else @@ -1343,7 +1344,7 @@ Try: Field names sFields = sFields , .Name Updatable field names - If Not _ReadOnly And .isDefinitelyWritable And Not .IsAutoIncrement Then sUpdatableFields = sUpdatableFields , .Name + If Not _ReadOnly And .IsWritable And Not .IsAutoIncrement Then sUpdatableFields = sUpdatableFields , .Name Default values _DefaultValues(i) = _ConvertDefaultValue(oColumn) AutoValue
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 572c33ac7b48b52f81b0d1aee3d0b4feac1335c7 Author: Andrea Gelmini AuthorDate: Sat Nov 25 21:20:14 2023 +0100 Commit: Julien Nabet CommitDate: Sun Nov 26 13:15:03 2023 +0100 Fix typo Change-Id: I07a4d9fc05a49e17503d9fecd642bfe84466a408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159956 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index 141a5bade393..fa5d0778b873 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -25,7 +25,7 @@ Option Explicit The provided interfaces include simple tables, queries and fields lists, and access to database metadata. - Tranaction handling + Transaction handling Changes to data remain reversible until the moment the running script instructs the database to commit them. The implicit (default) behaviour is that commit takes place after the execution of every single SQL statement. The choice can be made (SetTranactionMode()) to take commitments manually.
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |9 wizards/source/sfdatabases/SF_Database.xba | 332 +-- wizards/source/sfdatabases/SF_Dataset.xba| 11 wizards/source/sfdatabases/SF_Register.xba |2 4 files changed, 337 insertions(+), 17 deletions(-) New commits: commit 9b5b313a2f2980f9a10295aabdd696f58af03302 Author: Jean-Pierre Ledure AuthorDate: Thu Nov 23 17:59:33 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Fri Nov 24 09:54:59 2023 +0100 ScriptForge (SF_Database) manage transactions 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 77e0119809da..998d57d066a8 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1794,6 +1794,9 @@ class SFDatabases: def CloseDatabase(self): return self.ExecMethod(self.vbMethod, 'CloseDatabase') +def Commit(self): +return self.ExecMethod(self.vbMethod, 'Commit') + def CreateDataset(self, sqlcommand, directsql = False, filter = '', orderby = ''): return self.ExecMethod(self.vbMethod, 'CreateDataset', sqlcommand, directsql, filter, orderby) @@ -1831,9 +1834,15 @@ class SFDatabases: def OpenTable(self, tablename): return self.ExecMethod(self.vbMethod, 'OpenTable', tablename) +def Rollback(self): +return self.ExecMethod(self.vbMethod, 'Rollback') + def RunSql(self, sqlcommand, directsql = False): return self.ExecMethod(self.vbMethod, 'RunSql', sqlcommand, directsql) +def SetTransactionMode(self, transactionmode = 0): +return self.ExecMethod(self.vbMethod, 'SetTransactionMode', transactionmode) + # # # SF_Dataset CLASS # # diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index cf970ea980fc..141a5bade393 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -25,6 +25,12 @@ Option Explicit The provided interfaces include simple tables, queries and fields lists, and access to database metadata. + Tranaction handling + Changes to data remain reversible until the moment the running script instructs the database to commit them. + The implicit (default) behaviour is that commit takes place after the execution of every single SQL statement. + The choice can be made (SetTranactionMode()) to take commitments manually. + The Commit() and Rollback() statements delimit transactions. + Service invocation and usage: 1) To access any database at anytime Dim myDatabase As Object @@ -67,6 +73,9 @@ Private _URLAs StringText on status bar Private _Location As String File name Private _ReadOnly As Boolean Private_MetaData As Object com.sun.star.sdbc.XDatabaseMetaData +Private _User
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |4 ++-- wizards/source/sfdatabases/SF_Dataset.xba | 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 150cd96bc9c68416a5654a9fcef12e3e9b68ba10 Author: Andrea Gelmini AuthorDate: Mon Nov 13 04:39:57 2023 +0100 Commit: Julien Nabet CommitDate: Mon Nov 13 08:54:37 2023 +0100 Fix typos Change-Id: I5f6ddc80fb13f7c0b1841cab034539e500353511 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159346 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index 50d2e2e41cd3..cf970ea980fc 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -164,7 +164,7 @@ Public Function CreateDataset(Optional ByVal SQLCommand As Variant _ or an SQL SELECT statement. Args: SQLCommand: as a case-sensitive string, a table name, a query name - or a valid SQL SELECT statement. Identifiers may be srrounded + or a valid SQL SELECT statement. Identifiers may be surrounded with square brackets DirectSql: when True, the statement is processed by the targeted RDBMS Filter: an additional condition that records must match, expressed @@ -1170,4 +1170,4 @@ Private Function _Repr() As String End Function SFDatabases.SF_Database._Repr REM END OF SFDATABASES.SF_DATABASE - \ No newline at end of file + diff --git a/wizards/source/sfdatabases/SF_Dataset.xba b/wizards/source/sfdatabases/SF_Dataset.xba index e25f714f6ddf..28091d9368b8 100644 --- a/wizards/source/sfdatabases/SF_Dataset.xba +++ b/wizards/source/sfdatabases/SF_Dataset.xba @@ -24,7 +24,7 @@ Option Explicit - any SELECT SQL statement may define the dataset. The proposed API supports next main purposes: - - browse for- and backward thru the dataset to get its content + - browse for- and backward through the dataset to get its content - update any record with new values - create new records or delete some. So-called CRUD operations (create, read, update, delete). @@ -32,7 +32,7 @@ Option Explicit Service invocation: A dataset is characterized by - the parent database - - a table/query name or an SQL SELECT statemnt + - a table/query name or an SQL SELECT statement - the DirectSQL option to bypass the processing of SQL by LibreOffice - an optional filter - an optional sorting order @@ -58,7 +58,7 @@ Option Explicit Updates performance: This module provides methods to update data stored in database tables. - Note that the proposed Update() and Insert() methods wil always be + Note that the proposed Update() and Insert() methods will always be SLOWER or MUCH SLOWER than equivalent SQL statements. Always privilege SQL when considering massive updates. @@ -691,7 +691,7 @@ Public Function Insert(ParamArray pvArgs As Variant) As Long Returns: When the primary key is an AutoValue field: the autovalue of the new record (to facilitate the use of the new primary key in foreign keys) - Otherwise: 0 (= successful), -1 (= not sucessful) + Otherwise: 0 (= successful), -1 (= not successful) Exceptions: DBREADONLYERROR The actual method cannot be executed RECORDUPDATEERROR When value to store does not fit the type of the field @@ -1661,4 +1661,4 @@ CatchError: End Function SFDatabases.SF_Dataset._SetColumnValue REM END OF SFDATABASES.SF_DATASET - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) New commits: commit 5dac0fe157a5c35824cab2c27e391ff7a0d1d421 Author: Jean-Pierre Ledure AuthorDate: Sun Nov 12 16:33:02 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Sun Nov 12 17:44:55 2023 +0100 ScriptForge (SFDatabases) fix dates processing in GetRows 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index bcaff12f5cc5..77e0119809da 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -348,8 +348,8 @@ class ScriptForge(object, metaclass = _Singleton): # A Basic object to be mapped onto a new Python class instance # A UNO object # A set of property values to be returned as a dict() -# An array, tuple or tuple of tuples -# A scalar or Nothing +# An array, tuple or tuple of tuples - manage dates inside +# A scalar, Nothing, a date returnvalue = returntuple[cstValue] if returntuple[cstVarType] == ScriptForge.V_OBJECT and len(returntuple) > cstClass: # Skip Nothing if returntuple[cstClass] == ScriptForge.objUNO: @@ -372,6 +372,16 @@ class ScriptForge(object, metaclass = _Singleton): # Intercept empty array if isinstance(returnvalue, uno.ByteSequence): return () +if flags & SFServices.flgDateRet == SFServices.flgDateRet: # Bits comparison +# Intercept all UNO dates in the 1D or 2D array +if isinstance(returnvalue[0], tuple): # tuple of tuples +arr = [] +for i in range(len(returnvalue)): +row = tuple(map(SFScriptForge.SF_Basic.CDateFromUnoDateTime, returnvalue[i])) +arr.append(row) +returnvalue = tuple(arr) +else: # 1D tuple +returnvalue = tuple(map(SFScriptForge.SF_Basic.CDateFromUnoDateTime, returnvalue)) elif returntuple[cstVarType] == ScriptForge.V_DATE: dat = SFScriptForge.SF_Basic.CDateFromUnoDateTime(returnvalue) return dat @@ -1806,7 +1816,8 @@ class SFDatabases: return self.ExecMethod(self.vbMethod, 'DSum', expression, tablename, criteria) def GetRows(self, sqlcommand, directsql = False, header = False, maxrows = 0): -return self.ExecMethod(self.vbMethod + self.flgArrayRet, 'GetRows', sqlcommand, directsql, header, maxrows) +return self.ExecMethod(self.vbMethod + self.flgArrayRet + self.flgDateRet, 'GetRows', sqlcommand, + directsql, header, maxrows) def OpenFormDocument(self, formdocument): return self.ExecMethod(self.vbMethod, 'OpenFormDocument', formdocument) @@ -1870,7 +1881,7 @@ class SFDatabases: return self.ExecMethod(self.vbMethod, 'ExportValueToFile', fieldname, filename, overwrite) def GetRows(self, header = False, maxrows = 0): -return self.ExecMethod(self.vbMethod + self.flgArrayRet, 'GetRows', header, maxrows) +return self.ExecMethod(self.vbMethod + self.flgArrayRet + self.flgDateRet, 'GetRows', header, maxrows) def GetValue(self, fieldname): return self.ExecMethod(self.vbMethod, 'GetValue', fieldname)
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Document.xba |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit e1f630cd762eb99be23045107d3751e1ab91f410 Author: Andrea Gelmini AuthorDate: Thu Oct 5 21:25:44 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 10:05:11 2023 +0200 Fix typos Change-Id: I70b570b74c793418ec6e045d454d20107675b9a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157601 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index b69ce10515e8..6382b7c62827 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -1504,7 +1504,7 @@ Public Function Styles(Optional ByVal Family As Variant _ vStyles = doc.Styles(ParagraphStyles, Used := False, UserDefined := True) All user-defined styles that are not used vStyles = doc.Styles(ParagraphStyles, ParentStyle := Standard) - All styles dervived from the Default Paragraph Style + All styles derived from the Default Paragraph Style Dim vStyles As Variant Return value Dim sStyle As String A single style name @@ -1777,7 +1777,7 @@ Dim i As Integer Const cstCAT0 = TEXT is applied to styles that are used for common text Const cstCAT1 = CHAPTER is applied to styles that are used as headings -Const cstCAT2 = LIST is applied to styles that used in numberings and lists +Const cstCAT2 = LIST is applied to styles that are used in numberings and lists Const cstCAT3 = INDEXis applied to styles that are used in indexes Const cstCAT4 = EXTRAis applied to styles that are used in special regions like headers, footers, and footnote text Const cstCAT5 = HTML is applied to styles that are used to support HTML @@ -1875,7 +1875,7 @@ Public Sub _ImportStylesFromFile(Optional FileName As Variant _ The file is presumed to be of the same document type as the actual document Families: one of the style families present in the actual document, as a case-sensitive string or an array of such strings. Default = all families - Overwrite: when True, the actual styles may be overwritten. Defailt = False + Overwrite: when True, the actual styles may be overwritten. Default = False Returns: Exceptions: UNKNOWNFILEERRORThe given file name does not exist @@ -2138,4 +2138,4 @@ Private Function _Repr() As String End Function SFDocuments.SF_Document._Repr REM END OF SFDOCUMENTS.SF_DOCUMENT - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Document.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a86e015c469142f6cd9089e310699814dd0bd14a Author: Andrea Gelmini AuthorDate: Thu Oct 5 21:26:07 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 10:04:23 2023 +0200 Fix typo Change-Id: I0ece1c462f3b493273cf70e32a78b718f0255ed7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157602 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index ebfa7a405860..b69ce10515e8 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -1878,7 +1878,7 @@ Public Sub _ImportStylesFromFile(Optional FileName As Variant _ Overwrite: when True, the actual styles may be overwritten. Defailt = False Returns: Exceptions: - UNKNOWNFILEERRORThe fiven file name does not exist + UNKNOWNFILEERRORThe given file name does not exist Example: oDoc.ImportStylesFromFile(C:\...\abc.odt, Families := ParagraphStyles, Overwrite := True)
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Document.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d86f1ec88a59b38b8f6533154551e708380b2ce7 Author: Andrea Gelmini AuthorDate: Thu Oct 5 21:29:36 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 10:03:29 2023 +0200 Fix typo Change-Id: Ib459277f1c535304a863d1061acf7b261e37aa7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157605 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index eaf547c256e7..ebfa7a405860 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -1787,7 +1787,7 @@ Const cstCAT = cstCAT0 , cstCAT1 , Set oStyleDescriptor = Nothing Check: - If IsNull(poFamily) Then GoTo Vatch + If IsNull(poFamily) Then GoTo Catch If IsMissing(pvDisplayName) Or IsEmpty(pvDisplayName) Then pvDisplayName = If IsMissing(pvStyleIndex) Or IsEmpty(pvStyleIndex) Then pvStyleIndex = -1 Try:
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Document.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7bdc10dbb6621848d62e29601bd379e4895818e6 Author: Andrea Gelmini AuthorDate: Thu Oct 5 21:27:03 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 10:03:04 2023 +0200 Fix typo in code Change-Id: I7bfff7c50e9b97fec7d2100a542849360bb48e90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157603 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index 30f575cb3048..eaf547c256e7 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -1787,7 +1787,7 @@ Const cstCAT = cstCAT0 , cstCAT1 , Set oStyleDescriptor = Nothing Check: - If IsNull(poFamily) Then HoTo Vatch + If IsNull(poFamily) Then GoTo Vatch If IsMissing(pvDisplayName) Or IsEmpty(pvDisplayName) Then pvDisplayName = If IsMissing(pvStyleIndex) Or IsEmpty(pvStyleIndex) Then pvStyleIndex = -1 Try:
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Document.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9a9836714e80fbb75bfc99e43fa54f66dff0e5f8 Author: Andrea Gelmini AuthorDate: Thu Oct 5 21:28:29 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 10:00:48 2023 +0200 Fix typo Change-Id: I0b557b4bc7e6b5ba569b2fce7bf8aee5e407e4ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157604 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index 917dd1ea58a9..30f575cb3048 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -601,7 +601,7 @@ Public Sub DeleteStyles(Optional ByVal Family As Variant _ The StylesList is typically the output of the execution of a Styles() method. Returns: Examples: - Remove all inised styles + Remove all unused styles Const family = ParagraphStyles doc.DeleteStyles(family, doc.Styles(family, Used := False, UserDefined := True))
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_PythonHelper.xba |8 wizards/source/scriptforge/python/ScriptForgeHelper.py |2 wizards/source/scriptforge/python/scriptforge.py | 49 + wizards/source/sfdocuments/SF_Calc.xba | 39 + wizards/source/sfdocuments/SF_Document.xba | 457 + wizards/source/sfdocuments/SF_FormDocument.xba | 25 wizards/source/sfdocuments/SF_Writer.xba | 39 + 7 files changed, 611 insertions(+), 8 deletions(-) New commits: commit a29841ccbdf1e71b9a7c943c5c430d1a1b96234b Author: Jean-Pierre Ledure AuthorDate: Wed Oct 4 16:59:53 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Wed Oct 4 18:50:16 2023 +0200 ScriptForge (SFDocuments) Styles management 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_PythonHelper.xba b/wizards/source/scriptforge/SF_PythonHelper.xba index b611dbfd0d7e..8ad0dfa7c06c 100644 --- a/wizards/source/scriptforge/SF_PythonHelper.xba +++ b/wizards/source/scriptforge/SF_PythonHelper.xba @@ -783,6 +783,7 @@ Try: Case SFDocuments.Document Select Case Script Case Forms : vReturn = vBasicObject.Forms(vArgs(0)) + Case Styles : vReturn = vBasicObject.Styles(vArgs(0), vArgs(1), vArgs(2), vArgs(3), vArgs(4), vArgs(5)) Case Toolbars : vReturn = vBasicObject.Toolbars(vArgs(0)) End Select Case SFDocuments.Base @@ -800,6 +801,7 @@ Try: Case SetArray : vReturn = vBasicObject.SetArray(vArgs(0), vArgs(1)) Case SetFormula : vReturn = vBasicObject.SetFormula(vArgs(0), vArgs(1)) Case SetValue : vReturn = vBasicObject.SetValue(vArgs(0), vArgs(1)) + Case Styles : vReturn = vBasicObject.Styles(vArgs(0), vArgs(1), vArgs(2), vArgs(3), vArgs(4), vArgs(5)) Case Toolbars : vReturn = vBasicObject.Toolbars(vArgs(0)) End Select Case SFDocuments.Form @@ -814,6 +816,12 @@ Try: Case Forms : vReturn = vBasicObject.Forms(vArgs(0)) Case Toolbars : vReturn = vBasicObject.Toolbars(vArgs(0)) End Select + Case SFDocuments.Writer + Select Case Script + Case Forms : vReturn = vBasicObject.Forms(vArgs(0)) + Case Styles : vReturn = vBasicObject.Styles(vArgs(0), vArgs(1), vArgs(2), vArgs(3), vArgs(4), vArgs(5)) + Case Toolbars : vReturn =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Session.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d97b5849f3cfcecbdd929dca7bd7ac2c4fa31f8b Author: Jean-Pierre Ledure AuthorDate: Mon Oct 2 14:14:42 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Mon Oct 2 18:18:40 2023 +0200 ScriptForge (SF_Session) validate Recipient arg of SendMail 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 diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index 2bde313194b1..aeca1133e346 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -649,7 +649,7 @@ Check: If IsMissing(EditMessage) Or IsEmpty(EditMessage) Then EditMessage = True If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then - If Not SF_Utils._Validate(Cc, Recipient, V_STRING) Then GoTo Finally + If Not SF_Utils._Validate(Recipient, Recipient, V_STRING) Then GoTo Finally If Not SF_Utils._Validate(Cc, Cc, V_STRING) Then GoTo Finally If Not SF_Utils._Validate(Bcc, Bcc, V_STRING) Then GoTo Finally If Not SF_Utils._Validate(Subject, Subject, V_STRING) Then GoTo Finally
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Base.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bbe4d3498c2f994342b4d213f0ae874e7b0b7775 Author: Jean-Pierre Ledure AuthorDate: Thu Sep 28 15:03:32 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Thu Sep 28 16:16:38 2023 +0200 ScriptForge (SF_Base) tdf#156599 Error message when loading a form 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 Tested-by: Jenkins diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba index f96ddfd22e46..b6497b9b4f12 100644 --- a/wizards/source/sfdocuments/SF_Base.xba +++ b/wizards/source/sfdocuments/SF_Base.xba @@ -415,10 +415,10 @@ Const cstSubArgs = FormDocument bLoaded = False Check: + If IsNull(_FormDocuments) Then Set _FormDocuments = _Component.getFormDocuments() If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then If Not _IsStillAlive() Then GoTo Finally Build list of available FormDocuments recursively with _CollectFormDocuments - If IsNull(_FormDocuments) Then Set _FormDocuments = _Component.getFormDocuments() vFormNames = Split(_CollectFormDocuments(_FormDocuments), cstToken) If Not ScriptForge.SF_Utils._Validate(FormDocument, FormDocument, V_STRING, vFormNames) Then GoTo Finally End If
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Utils.xba |2 +- wizards/source/scriptforge/po/ScriptForge.pot|4 ++-- wizards/source/scriptforge/po/en.po |4 ++-- wizards/source/scriptforge/python/scriptforge.py |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) New commits: commit f9c4973ac604ae091de08484ee2f5599db90a3a3 Author: Jean-Pierre Ledure AuthorDate: Sun Sep 3 13:16:05 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Sep 3 14:49:17 2023 +0200 ScriptForge - Upgrade version number (7.6 => 24.2) Change-Id: I0e7ceeafcf4c5a802249125e6be44a71adb1456b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156480 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index 608a2e8422ca..5ebdd58ce9ab 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -21,7 +21,7 @@ REM = GLOBAL Global _SF_As VariantSF_Root (Basic) object) ScriptForge version -Const SF_Version = 7.6 +Const SF_Version = 24.2 Standard symbolic names for VarTypes V_EMPTY = 0 diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot index 1f18806679ac..644399bbbd15 100644 --- a/wizards/source/scriptforge/po/ScriptForge.pot +++ b/wizards/source/scriptforge/po/ScriptForge.pot @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.6 +# ScriptForge Release 24.2 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2023-07-14 16:26:26\n" +"POT-Creation-Date: 2023-09-03 13:05:04\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po index 1f18806679ac..644399bbbd15 100644 --- a/wizards/source/scriptforge/po/en.po +++ b/wizards/source/scriptforge/po/en.po @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.6 +# ScriptForge Release 24.2 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2023-07-14 16:26:26\n" +"POT-Creation-Date: 2023-09-03 13:05:04\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 01da93cf6c28..060c57208de7 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -108,7 +108,7 @@ class ScriptForge(object, metaclass = _Singleton): # Class constants # # library = 'ScriptForge' -Version = '7.6' # Actual version number +Version = '24.2' # Actual version number # # Basic dispatcher for Python scripts (@scope#library.module.function) basicdispatcher = '@application#ScriptForge.SF_PythonHelper._PythonDispatcher'
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |8 +++ wizards/source/sfdocuments/SF_Base.xba |2 - wizards/source/sfdocuments/SF_Calc.xba |6 + wizards/source/sfdocuments/SF_Document.xba | 24 +++ wizards/source/sfdocuments/SF_FormDocument.xba |6 + wizards/source/sfdocuments/SF_Writer.xba |6 + 6 files changed, 47 insertions(+), 5 deletions(-) New commits: commit b3278aa41d036a7fd9f3a8ce9aa683397e87e6a8 Author: Jean-Pierre Ledure AuthorDate: Sat Sep 2 17:57:24 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Sep 3 11:00:26 2023 +0200 ScriptForge (SF_Document) new XDocumentSettings property 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index b235a791f87d..01da93cf6c28 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -2165,7 +2165,7 @@ class SFDocuments: DocumentType = False, ExportFilters = False, FileSystem = False, ImportFilters = False, IsBase = False, IsCalc = False, IsDraw = False, IsFormDocument = False, IsImpress = False, IsMath = False, IsWriter = False, Keywords = True, Readonly = False, - Subject = True, Title = True, XComponent = False) + Subject = True, Title = True, XComponent = False, XDocumentSettings = False) # Force for each property to get its value from Basic - due to intense interactivity with user forceGetProperty = True @@ -2292,7 +2292,7 @@ class SFDocuments: FileSystem = False, ImportFilters = False, IsBase = False, IsCalc = False, IsDraw = False, IsFormDocument = False, IsImpress = False, IsMath = False, IsWriter = False, Keywords = True, Readonly = False, Sheets = False, Subject = True, - Title = True, XComponent = False) + Title = True, XComponent = False, XDocumentSettings = False) # Force for each property to get its value from Basic - due to intense interactivity with user forceGetProperty = True @@ -2648,7 +2648,7 @@ class SFDocuments: servicesynonyms = ('formdocument', 'sfdocuments.formdocument') serviceproperties = dict(DocumentType = False, FileSystem = False, IsBase = False, IsCalc = False, IsDraw = False, IsFormDocument = False, IsImpress = False, IsMath = False, - IsWriter = False, Readonly = False, XComponent = False) + IsWriter = False, Readonly = False, XComponent = False, XDocumentSettings = False) @classmethod def ReviewServiceArgs(cls, windowname = ''): @@ -2687,7 +2687,7 @@ class SFDocuments: DocumentType = False, ExportFilters = False, FileSystem = False, ImportFilters = False, IsBase = False, IsCalc = False, IsDraw = False, IsFormDocument = False, IsImpress = False, IsMath = False, IsWriter = False, Keywords = True, Readonly = False, - Subject = True, Title = True, XComponent = False) + Subject = True, Title = True, XComponent = False, XDocumentSettings = False) # Force for each property to get its value from Basic - due to intense interactivity with user forceGetProperty = True diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba index 67e4663b0748..f96ddfd22e46 100644 --- a/wizards/source/sfdocuments/SF_Base.xba +++ b/wizards/source/sfdocuments/SF_Base.xba @@ -1125,4 +1125,4 @@ Private Function _Repr() As String End Function SFDocuments.SF_Base._Repr REM END OF SFDOCUMENTS.SF_BASE - + \ No newline at end of file diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index a78762056fb0..941f23834230 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Base.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e1352a2d7a5fcd4451e039f6ef8c454fd46f1851 Author: Andrea Gelmini AuthorDate: Tue Aug 22 11:43:18 2023 +0200 Commit: Julien Nabet CommitDate: Tue Aug 22 14:16:41 2023 +0200 Fix typo Change-Id: Ide2a33e282b575caf14374d7ae8034da41a6ed63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155942 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba index af1ebc1e4930..67e4663b0748 100644 --- a/wizards/source/sfdocuments/SF_Base.xba +++ b/wizards/source/sfdocuments/SF_Base.xba @@ -505,7 +505,7 @@ Try: Set oOpen = ScriptForge.SF_Services.CreateScriptService(SFDocuments.FormDocument, oNewForm) - Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836 + Prevent desynchronization when using .last(), .next() etc immediately after component loading. Bug #156836 Wait 1 Finally: @@ -1125,4 +1125,4 @@ Private Function _Repr() As String End Function SFDocuments.SF_Base._Repr REM END OF SFDOCUMENTS.SF_BASE - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 88ade32040e522e6d3aff0c5d1ebee4a92e6136c Author: Andrea Gelmini AuthorDate: Tue Aug 22 11:43:05 2023 +0200 Commit: Julien Nabet CommitDate: Tue Aug 22 14:15:48 2023 +0200 Fix typo Change-Id: I05e93bd2c9ca3a270e07a4c0c7d09e4d3d6cea81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155941 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index 109d4c57d909..f280762d8146 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -455,7 +455,7 @@ Try: Set oOpen = ScriptForge.SF_Services.CreateScriptService(SFDocuments.FormDocument, oNewForm) - Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836 + Prevent desynchronization when using .last(), .next() etc immediately after component loading. Bug #156836 Wait 1 Finally: @@ -1088,4 +1088,4 @@ Private Function _Repr() As String End Function SFDatabases.SF_Database._Repr REM END OF SFDATABASES.SF_DATABASE - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |3 +++ wizards/source/sfdocuments/SF_Base.xba |3 +++ 2 files changed, 6 insertions(+) New commits: commit 84bc3ffcf5c570f044843125552589456b07f5a1 Author: Jean-Pierre Ledure AuthorDate: Mon Aug 21 15:01:53 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Mon Aug 21 17:33:29 2023 +0200 ScriptForge - fix tdf#156836 Abort on MoveFirst() 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 Tested-by: Jenkins diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index f93cf55d74c0..109d4c57d909 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -455,6 +455,9 @@ Try: Set oOpen = ScriptForge.SF_Services.CreateScriptService(SFDocuments.FormDocument, oNewForm) + Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836 + Wait 1 + Finally: Set OpenFormDocument = oOpen ScriptForge.SF_Utils._ExitFunction(cstThisSub) diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba index efc8bfeb148c..af1ebc1e4930 100644 --- a/wizards/source/sfdocuments/SF_Base.xba +++ b/wizards/source/sfdocuments/SF_Base.xba @@ -505,6 +505,9 @@ Try: Set oOpen = ScriptForge.SF_Services.CreateScriptService(SFDocuments.FormDocument, oNewForm) + Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836 + Wait 1 + Finally: Set OpenFormDocument = oOpen ScriptForge.SF_Utils._ExitFunction(cstThisSub)
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Array.xba |8 wizards/source/scriptforge/SF_PythonHelper.xba | 118 - wizards/source/scriptforge/python/scriptforge.py | 279 +-- 3 files changed, 224 insertions(+), 181 deletions(-) New commits: commit 0bbe5b4f2a7797bfd05fdbde316857fceaf84d77 Author: Jean-Pierre Ledure AuthorDate: Sat Aug 19 17:30:25 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Aug 20 10:48:48 2023 +0200 ScriptForge - Refactor Python <=> Basic protocol 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Array.xba b/wizards/source/scriptforge/SF_Array.xba index 49bdab14770a..54110cde9352 100644 --- a/wizards/source/scriptforge/SF_Array.xba +++ b/wizards/source/scriptforge/SF_Array.xba @@ -849,7 +849,6 @@ REM Public Function ImportFromCSVFile(Optional ByRef FileName As Variant _ , Optional ByVal Delimiter As Variant _ , Optional ByVal DateFormat As Variant _ - , Optional ByVal _IsoDate As Variant _ ) As Variant Import the data contained in a comma-separated values (CSV) file The comma may be replaced by any character @@ -866,7 +865,6 @@ Public Function ImportFromCSVFile(Optional ByRef FileName As Variant _ The dash (-) may be replaced by a dot (.), a slash (/) or a space Other date formats will be ignored If (default), dates will be considered as strings - _IsoDate: when True, the execution is initiated from Python, do not convert dates to Date variables. Internal use only Returns: A 2D-array with each row corresponding with a single record read in the file and each column corresponding with a field of the record @@ -892,7 +890,9 @@ Dim vItem As Variant Individual item in the output array Dim iPosition As Integer Date position in individual item Dim iYear As Integer, iMonth As Integer, iDay As Integer Date components +Dim bIsoDate As Boolean When True, do not convert dates to Date variables Dim i As Long + Const cstItemsLimit = 25 Maximum number of admitted items Const cstThisSub = Array.ImportFromCSVFile Const cstSubArgs = FileName, [Delimiter=,], [DateFormat=] @@ -903,7 +903,6 @@ Const cstSubArgs = FileName, [Delimiter=,], [DateF Check: If IsMissing(Delimiter) Or IsEmpty(Delimiter) Then Delimiter = , If IsMissing(DateFormat) Or IsEmpty(DateFormat) Then DateFormat = - If IsMissing(_IsoDate) Or IsEmpty(_IsoDate) Then _IsoDate =
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Register.xba | 20 ++-- wizards/source/sfdocuments/SF_Form.xba |3 +++ wizards/source/sfdocuments/SF_FormDocument.xba |5 - 3 files changed, 21 insertions(+), 7 deletions(-) New commits: commit d2c1a4fa508572cc2908787deeebc5baa9d6e0c3 Author: Jean-Pierre Ledure AuthorDate: Wed Aug 9 12:33:39 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Wed Aug 9 14:45:23 2023 +0200 SCriptForge (SFDatabases) manage database credentials 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 Tested-by: Jenkins diff --git a/wizards/source/sfdatabases/SF_Register.xba b/wizards/source/sfdatabases/SF_Register.xba index 04c76ff59e94..cee09f94f3f3 100644 --- a/wizards/source/sfdatabases/SF_Register.xba +++ b/wizards/source/sfdatabases/SF_Register.xba @@ -25,6 +25,7 @@ Option Explicit REM == EXCEPTIONS Private Const BASEDOCUMENTOPENERROR= BASEDOCUMENTOPENERROR +Private Const DBCONNECTERROR = DBCONNECTERROR REM == PUBLIC METHODS @@ -65,7 +66,8 @@ Public Function _NewDatabase(Optional ByVal pvArgs As Variant) As Object Returns: The instance or Nothing Exceptions: - BASEDOCUMENTOPENERROR The database file could not be opened or connected + BASEDOCUMENTOPENERROR The database file could not be opened + DBCONNECTERROR The database could not be connected, credentials are probably wrong Dim oDatabase As Object Return value Dim vFileName As Variant alias of pvArgs(0) @@ -116,7 +118,9 @@ Try: Set .[Me] = oDatabase ._Location = ConvertToUrl(vFileName) Set ._DataSource = oDBContext.getByName(._Location) + If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo CatchConnect Set ._Connection = ._DataSource.getConnection(vUser, vPassword) + If IsNull(._Connection) Then GoTo CatchConnect ._ReadOnly = vReadOnly Set ._MetaData = ._Connection.MetaData ._URL = ._MetaData.URL @@ -130,20 +134,23 @@ Catch: CatchError: ScriptForge.SF_Exception.RaiseFatal(BASEDOCUMENTOPENERROR, FileName, vFileName, RegistrationName, vRegistration) GoTo Finally +CatchConnect: + ScriptForge.SF_Exception.RaiseFatal(DBCONNECTERROR, User, vUser, Password, vPassword, vFileName) + GoTo Finally End Function SFDatabases.SF_Register._NewDatabase REM - Public Function _NewDatabaseFromSource(Optional ByVal pvArgs As Variant) As Object - ByRef poDataSource As Object _ - , ByVal psUser As String _ - , ByVal psPassword As String _ + ByRef oDataSource As Object _ + , ByVal sUser As String _ + , ByVal sPassword As String _ ) As Object Create a new instance of the SF_Database class from the given datasource established in the SFDocuments.Base service THIS SERVICE MUST NOT BE CALLED FROM A USER SCRIPT Args: - DataSource: com.sun.star.sdbc.XDataSource - User, Password : connection parameters + oDataSource:com.sun.star.sdbc.XDataSource + sUser, sPassword : connection parameters Returns: The instance or
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Session.xba |2 ++ 1 file changed, 2 insertions(+) New commits: commit bd640d338b6c8a1a4915c4b88b52ac1cc48f7dd0 Author: Jean-Pierre Ledure AuthorDate: Sun Jul 30 15:03:15 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Jul 30 18:28:48 2023 +0200 ScriptForge (SF_Session) fix SendMail() w/o attachment 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index b4292f36ea83..2bde313194b1 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -679,6 +679,8 @@ Check: If Not SF_FileSystem.FileExists(sFile) Then GoTo CatchNotExists vFileNames(i) = ConvertToUrl(sFile) Next i + Else + vFileNames = Array() End If Try:
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Platform.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 49fc6598426fb4552904c66702cddc6534124227 Author: Andrea Gelmini AuthorDate: Sun Jul 30 00:18:43 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jul 30 09:32:01 2023 +0200 Fix typo Change-Id: I7ac33586a01a65e20143ec1e853c6720de453d35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155054 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_Platform.xba b/wizards/source/scriptforge/SF_Platform.xba index 8e8aa5330a9d..742d138de9ce 100644 --- a/wizards/source/scriptforge/SF_Platform.xba +++ b/wizards/source/scriptforge/SF_Platform.xba @@ -464,7 +464,7 @@ Const cstSubArgs = ) Get the UserData page from the Options database vUserDataOptions = SF_Utils._GetRegistryKeyContent(org.openoffice.UserProfile/Data) - Create and feed the ouput dictionary + Create and feed the output dictionary vUserData = CreateScriptService(ScriptForge.Dictionary) For i = 0 To UBound(vUserDataExternal) vUserData.Add(vUserDataExternal(i), vUserDataOptions.getByName(vUserDataInternal(i)))
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Platform.xba | 32 +++ wizards/source/scriptforge/SF_PythonHelper.xba |2 + wizards/source/scriptforge/python/scriptforge.py | 12 +++- 3 files changed, 45 insertions(+), 1 deletion(-) New commits: commit 0f43960ec87229f15f9138d83072bb1f510fa9b2 Author: Jean-Pierre Ledure AuthorDate: Fri Jul 28 16:47:10 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sat Jul 29 12:39:34 2023 +0200 ScriptForge (SF_Platform) new UserData property 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Platform.xba b/wizards/source/scriptforge/SF_Platform.xba index 8403866fffe8..8e8aa5330a9d 100644 --- a/wizards/source/scriptforge/SF_Platform.xba +++ b/wizards/source/scriptforge/SF_Platform.xba @@ -217,6 +217,14 @@ Property Get SystemLocale() As String SystemLocale = _PropertyGet(SystemLocale) End Property ScriptForge.SF_Platform.SystemLocale (get) +REM - +Property Get UserData() As Variant + Returns a dictionary of all Options + User Data values + Example: + MsgBox platform.UserData + UserData = _PropertyGet(UserData) +End Property ScriptForge.SF_Platform.UserData (get) + REM = METHODS REM - @@ -285,6 +293,7 @@ Public Function Properties() As Variant , Processor _ , PythonVersion _ , SystemLocale _ + , UserData _ ) End Function ScriptForge.SF_Platform.Properties @@ -374,6 +383,10 @@ Dim sFont As String A single font name Dim vExtensionsList As Variant Array of extension descriptors Dim sExtensions As StringComma separated list of extensions Dim sExtension As String A single extension name +Dim vUserDataInternal As Variant The internal names of the supported user data items +Dim vUserDataExternal As Variant The external names of the supported user data items +Dim vUserData As Variant A SF_Dictionary instance linking user data external names and values +Dim vUserDataOptions As Variant configmgr.RootAccess Dim i As Long Const cstPyHelper = $ _SF_Platform @@ -438,6 +451,25 @@ Const cstSubArgs = Case SystemLocale, Locale Set oLocale = SF_Utils._GetUNOService(SystemLocale) _PropertyGet = oLocale.Language - oLocale.Country + Case UserData + vUserDataExternal = Array( _ + city, company, country, email, encryptionkey, encrypttoself, fax _ + , firstname, homephone, initials, lastname, officephone, position _ + , postalcode, signingkey, state, street, title _ + ) + vUserDataInternal = Array( _ + l, o, c, mail, encryptionkey, encrypttoself, facsimiletelephonenumber _ + , givenname, homephone, initials, sn, telephonenumber, position _ + , postalcode, signingkey, st, street, title _ + ) + Get the UserData page from the Options database + vUserDataOptions = SF_Utils._GetRegistryKeyContent(org.openoffice.UserProfile/Data) + Create and feed the ouput dictionary + vUserData = CreateScriptService(ScriptForge.Dictionary) + For i = 0 To UBound(vUserDataExternal) + vUserData.Add(vUserDataExternal(i), vUserDataOptions.getByName(vUserDataInternal(i))) + Next i + _PropertyGet =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit d5e1e4103b2ee77140d4866c4b4f482cb0ee184f Author: Jean-Pierre Ledure AuthorDate: Sun Jul 23 10:53:24 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Jul 23 16:10:06 2023 +0200 ScriptForge (SF_FileSystem) Fix typos Typos in comment lines Change-Id: I5e92417af0c9fb1f6f4d240a5a7731c9efa5230d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154802 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index d7b8ba926442..e37d4d3dcec6 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -967,7 +967,7 @@ Public Function GetFileLen(Optional ByVal FileName As Variant) As Currency File size if FileName exists 0 when FileName belongs to a documents internal file systems. Exceptions: - UNKNOWNFILEERRORThe file does not exist of is a folder + UNKNOWNFILEERRORThe file does not exist or is a folder Example: Print SF_FileSystem.GetFileLen(C:\pagefile.sys) @@ -1018,7 +1018,7 @@ Public Function GetFileModified(Optional ByVal FileName As Variant) As Variant Returns: The modification date and time as a Basic Date Exceptions: - UNKNOWNFILEERRORThe file does not exist of is a folder + UNKNOWNFILEERRORThe file does not exist or is a folder FILESYSTEMERROR The method is not applicable on documents file systems Example: Dim a As Date @@ -1248,7 +1248,7 @@ Public Function HashFile(Optional ByVal FileName As Variant _ The requested checksum as a string. Hexadecimal digits are lower-cased A zero-length string when an error occurred Exceptions: - UNKNOWNFILEERRORThe file does not exist of is a folder + UNKNOWNFILEERRORThe file does not exist or is a folder FILESYSTEMERROR The method is not applicable on documents file systems Example: Print SF_FileSystem.HashFile(C:\pagefile.sys, MD5) @@ -2370,4 +2370,4 @@ Dim sFolder As String Folder End Function ScriptForge.SF_FileSystem._SFInstallFolder REM END OF SCRIPTFORGE.SF_FileSystem - + \ No newline at end of file
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 56edc523a4aa2a99ce15c66d42a8c7ba55bf1580 Author: Andrea Gelmini AuthorDate: Sat Jul 22 23:18:14 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jul 23 10:05:28 2023 +0200 Fix typo Change-Id: I2a14c233aa09aec55b18dae2d4018a07c012ab52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154795 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 5ece60af8be7..d7b8ba926442 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -2245,7 +2245,7 @@ Private Sub _ScanFolder(ByVal piTarget As Integer _ Dim vSubFolders As Variant Array of subfolders 1st level in URL notation Dim vFiles As VariantArray of files present in psFolderName in FileNaming notation Dim lFiles As Long Number of files found passing the filter -Dim sFolderName As StringURL lias for psFolderName +Dim sFolderName As StringURL alias for psFolderName Dim sItem As String Single folder or single file in FileNaming notation Dim sItemName As String Base name of sItem Dim bFolder As Boolean When True, the considered string points to a folder, not a file @@ -2370,4 +2370,4 @@ Dim sFolder As String Folder End Function ScriptForge.SF_FileSystem._SFInstallFolder REM END OF SCRIPTFORGE.SF_FileSystem - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 1d0adde905fa5353fdb38f743dce9d50e8a53ef7 Author: Andrea Gelmini AuthorDate: Sat Jul 22 23:28:07 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jul 23 10:05:10 2023 +0200 Fix typo Change-Id: Ia6252da165d734b752ea6cad96f8014556bb4bfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154796 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 2364ec4206b1..5ece60af8be7 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -1012,7 +1012,7 @@ End Function ScriptForge.SF_FileSystem.GetFileLen REM - Public Function GetFileModified(Optional ByVal FileName As Variant) As Variant Returns the last modified date for the given file - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: FileName: a string representing an existing file Returns: @@ -1240,7 +1240,7 @@ Public Function HashFile(Optional ByVal FileName As Variant _ ) As String Return an hexadecimal string representing a checksum of the given file Next algorithms are supported: MD5, SHA1, SHA224, SHA256, SHA384 and SHA512 - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: FileName: a string representing a file Algorithm: The hashing algorithm to use @@ -1589,7 +1589,7 @@ Public Function PickFile(Optional ByVal DefaultFile As Variant _ The mode, OPEN or SAVE, and the filter may be preset If mode = SAVE and the picked file exists, a warning message will be displayed Modified from Andrew Pitonyaks Base Macro Programming §10.4 - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: DefaultFile:Folder part: the FolderName from which to start. Default = the last selected folder File part: the default file to open or save @@ -1686,7 +1686,7 @@ Public Function PickFolder(Optional ByVal DefaultFolder As Variant _ , Optional ByVal FreeText As Variant _ ) As String Display a FolderPicker dialog box - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: DefaultFolder: the FolderName from which to start. Default = the last selected folder FreeText: text to display in the dialog. Default =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba | 202 --- wizards/source/scriptforge/SF_TextStream.xba |2 wizards/source/scriptforge/python/scriptforge.py |8 3 files changed, 151 insertions(+), 61 deletions(-) New commits: commit c216a5fc499dd3cd4324c30aa69df415ecf22113 Author: Jean-Pierre Ledure AuthorDate: Sat Jul 22 16:10:14 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sat Jul 22 18:03:36 2023 +0200 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index bb611d69b59a..2364ec4206b1 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -84,6 +84,11 @@ Const cstForAppending= 8 Document file system Const DOCFILESYSTEM= vnd.sun.star.tdoc:/ + Folders and files scanning +Const cstSEPARATOR = //; Separates folders or files in the accumulators +Const cstFILES = 1 Caler = Files() +Const cstFOLDERS = 2 Caller = SubFolders() + REM = CONSTRUCTOR/DESTRUCTOR REM - @@ -762,11 +767,15 @@ End Function ScriptForge.SF_FileSystem.FileExists REM - Public Function Files(Optional ByVal FolderName As Variant _ , Optional ByVal Filter As Variant _ + , Optional ByVal IncludeSubfolders As Variant _ ) As Variant Return an array of the FileNames stored in the given folder. The folder must exist + Subfolders may be optionally explored too. + If the number of files exceeds a reasonable amount ( 1000 ?), the process time may become long. Args: FolderName: the folder to explore Filter: contains wildcards (? and *) to limit the list to the relevant files (default = ) + IncludeSubfolders: when True (default = False), subfolders are explored too. Returns: An array of strings, each entry is the FileName of an existing file Exceptions: @@ -775,58 +784,36 @@ Public Function Files(Optional ByVal FolderName As Variant _ Example: Dim a As Variant FSO.FileNaming = SYS - a = FSO.Files(C:\Windows\) + a = FSO.Files(C:\Windows\, IncludeSubfolders := True) Dim vFiles As VariantReturn value Dim oSfa As Object com.sun.star.ucb.SimpleFileAccess -Dim sFolderName As StringURL lias for FolderName -Dim sFile As String Single file -Dim bDocFileSystem As BooleanWhen True, a document file system is being explored +Dim sFilesColl As String cstSEPARATOR delimited string of list of files (FileNaming notation) Dim i As Long Const cstThisSub = FileSystem.Files -Const cstSubArgs = FolderName, [Filter=] +Const cstSubArgs = FolderName, [Filter=], [IncludeSubfolders=False] If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch vFiles = Array() Check: If IsMissing(Filter) Or IsEmpty(Filter) Then Filter = + If IsMissing(IncludeSubfolders) Or IsEmpty(IncludeSubfolders) Then IncludeSubfolders = False If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then If Not SF_Utils._ValidateFile(FolderName, FolderName) Then GoTo Finally If Not SF_Utils._Validate(Filter, Filter, V_STRING) Then GoTo Finally + If Not SF_Utils._Validate(IncludeSubfolders, IncludeSubfolders, V_BOOLEAN) Then GoTo Finally End If - sFolderName =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/po/pt.po | 151 +--- 1 file changed, 105 insertions(+), 46 deletions(-) New commits: commit 7d93c79aaf1cf8b6f55c3e61bb0254eef8b8c260 Author: Rafael Lima AuthorDate: Mon Jul 17 20:49:04 2023 +0200 Commit: Rafael Lima CommitDate: Fri Jul 21 13:55:31 2023 +0200 Sync ScriptForge pt.po translation Change-Id: I67075b3ae5e57b8924e12770d835a83513147da3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154536 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/wizards/source/scriptforge/po/pt.po b/wizards/source/scriptforge/po/pt.po index 316956c431c4..f1d7ae9f0e57 100644 --- a/wizards/source/scriptforge/po/pt.po +++ b/wizards/source/scriptforge/po/pt.po @@ -68,6 +68,7 @@ msgid "" "\n" "More details : \n" "\n" +"" msgstr "" "A biblioteca ScriptForge encontrou um erro grave. A razão é desconhecida.\n" "Talvez seja um bug que pode ser relatado em\n" @@ -75,6 +76,7 @@ msgstr "" "\n" "Mais detalhes: \n" "\n" +"" #. SF_Utils._Validate error message #. %1: probably ScriptForge @@ -214,8 +216,8 @@ msgstr "" #, kde-format msgctxt "VALIDATEFILEURL" msgid "" -"« %1 » must be a valid file or folder name expressed in the portable " -"URL notation." +"« %1 » must be a valid file or folder name expressed in the " +"portable URL notation." msgstr "" "« %1 » deve ser um nome válido de arquivo ou pasta expresso usando a " "notação portável URL." @@ -233,8 +235,8 @@ msgstr "« %1 » deve ser um nome válido de arquivo ou pasta." #, kde-format msgctxt "VALIDATEWILDCARD" msgid "" -"« %1 » may contain one or more wildcard characters (?, *) in its " -"last path component only." +"« %1 » may contain one or more wildcard characters (?, *) in " +"its last path component only." msgstr "" "« %1 » deve conter um ou mais caracteres coringa (?,*) apenas no " "último componente do caminho." @@ -334,8 +336,8 @@ msgstr "" #, kde-format msgctxt "DUPLICATEKEY" msgid "" -"The insertion of a new key into a dictionary failed because the key already " -"exists.\n" +"The insertion of a new key into a dictionary failed because the key " +"already exists.\n" "Note that the comparison between keys is NOT case-sensitive.\n" "\n" "« %1 » = %2" @@ -362,8 +364,8 @@ msgstr "" #. msgctxt "INVALIDKEY" msgid "" -"The insertion or the update of an entry into a dictionary failed because the " -"given key contains only spaces." +"The insertion or the update of an entry into a dictionary failed " +"because the given key contains only spaces." msgstr "" "A inserção ou atualização de uma entrada em um dicionário falhou porque a " "chave fornecido contém apenas espaços." @@ -432,8 +434,8 @@ msgstr "" #, kde-format msgctxt "OVERWRITE" msgid "" -"You tried to create a new file which already exists. Overwriting it has been " -"rejected.\n" +"You tried to create a new file which already exists. Overwriting it " +"has been rejected.\n" "\n" "« %1 » = %2" msgstr "" @@ -448,8 +450,8 @@ msgstr "" #, kde-format msgctxt "READONLY" msgid "" -"Copying or moving a file to a destination which has its read-only attribute " -"set, or deleting such a file or folder is forbidden.\n" +"Copying or moving a file to a destination which has its read-only " +"attribute set, or deleting such a file or folder is forbidden.\n" "\n" "« %1 » = %2" msgstr "" @@ -464,8 +466,8 @@ msgstr "" #, kde-format msgctxt "NOFILEMATCH" msgid "" -"When « %1 » contains wildcards. at least one file or folder must match the " -"given filter. Otherwise the operation is rejected.\n" +"When « %1 » contains wildcards. at least one file or folder must " +"match the given filter. Otherwise the operation is rejected.\n" "\n" "« %1 » = %2" msgstr "" @@ -481,8 +483,8 @@ msgstr "" #, kde-format msgctxt "FOLDERCREATION" msgid "" -"« %1 » contains the name of an existing file or an existing folder. The " -"operation is rejected.\n" +"« %1 » contains the name of an existing file or an existing folder. " +"The operation is rejected.\n" "\n" "« %1 » = %2" msgstr "" @@ -491,6 +493,23 @@ msgstr "" "\n" "« %1 » = %2" +#. SF_FileSystem not supported method error message +#. %1: A method name +#. %2: An identifier +#. %3: A file or folder name +#, kde-format +msgctxt "FILESYSTEM" +msgid "" +"The method « %2 » is not applicable on a document's internal file " +"system.\n" +"\n" +"« %1 » = '%3'" +msgstr "" +"O método « %2 » não é aplicável ao sistema de arquivos interno " +"do documento.\n" +"\n" +"« %1 » = '%3'" + #. SF_Services.CreateScriptService error message #. %1: An identifier #. %2: A string @@ -516,8 +535,8 @@ msgctxt "SERVICESNOTLOADED" msgid "" "The library '%3' and its services could not been loaded.\n" "The reason is unknown.\n" -"However, checking the '%3.SF_Services.RegisterScriptServices()' function and " -"its return value can be a good starting point.\n" +"However, checking the
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_FormDocument.xba |1 - 1 file changed, 1 deletion(-) New commits: commit 3480cfdb1e153ff489dcbd3790c3f120fdde13a0 Author: Jean-Pierre Ledure AuthorDate: Tue Jul 18 16:31:10 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Wed Jul 19 15:08:38 2023 +0200 ScriptForge (FormDocument) fix tdf#156356 Variable not defined Change-Id: I4bbd4b05ca42ccde4b83eb55a1f1ae80ebca9680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154592 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure diff --git a/wizards/source/sfdocuments/SF_FormDocument.xba b/wizards/source/sfdocuments/SF_FormDocument.xba index ca2f8e70..4270c08e2907 100644 --- a/wizards/source/sfdocuments/SF_FormDocument.xba +++ b/wizards/source/sfdocuments/SF_FormDocument.xba @@ -103,7 +103,6 @@ Private Sub Class_Initialize() Set _BaseComponent = Nothing Set _FormDocument = Nothing Set _DataSource = Nothing - Set _Database = Nothing _PersistentName = _HierarchicalName = End Sub SFDocuments.SF_FormDocument Constructor
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 83a169d04aca94f6f2a5b6ef9fdfba3c0fc4ede3 Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:27:02 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:20:17 2023 +0200 Fix typo Change-Id: I04d3440d121e6305b3435964b88d221bf4bce221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154486 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 3bb177708f3f..bb611d69b59a 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -307,7 +307,7 @@ Public Function CompareFiles(Optional ByVal FileName1 As Variant _ Compare 2 files and return True if they seem identical The comparison may be based on the file attributes, like modification time, or on their contents. - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: FileName1: The 1st file to compare FileName2: The 2nd file to compare @@ -1025,7 +1025,7 @@ End Function ScriptForge.SF_FileSystem.GetFileLen REM - Public Function GetFileModified(Optional ByVal FileName As Variant) As Variant Returns the last modified date for the given file - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: FileName: a string representing an existing file Returns: @@ -1253,7 +1253,7 @@ Public Function HashFile(Optional ByVal FileName As Variant _ ) As String Return an hexadecimal string representing a checksum of the given file Next algorithms are supported: MD5, SHA1, SHA224, SHA256, SHA384 and SHA512 - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: FileName: a string representing a file Algorithm: The hashing algorithm to use @@ -1602,7 +1602,7 @@ Public Function PickFile(Optional ByVal DefaultFile As Variant _ The mode, OPEN or SAVE, and the filter may be preset If mode = SAVE and the picked file exists, a warning message will be displayed Modified from Andrew Pitonyaks Base Macro Programming §10.4 - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: DefaultFile:Folder part: the FolderName from which to start. Default = the last selected folder File part: the default file to open or save @@ -1699,7 +1699,7 @@ Public Function PickFolder(Optional ByVal DefaultFolder As Variant _ , Optional ByVal FreeText As Variant _ ) As String Display a FolderPicker dialog box - The method is not supporte for documents internal file systems. + The method is not supported for documents internal file systems. Args: DefaultFolder: the FolderName from which to start. Default = the last selected folder FreeText: text to display in the dialog. Default =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_TextStream.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 1c22e2e6561a23a6a19b54c3c986d3ef040575f0 Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:26:04 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:19:54 2023 +0200 Fix typo Change-Id: If33699080b8f56998416b87db1e75e91b0ed18ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154485 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_TextStream.xba b/wizards/source/scriptforge/SF_TextStream.xba index 3da9a773f08e..a5c1b09129de 100644 --- a/wizards/source/scriptforge/SF_TextStream.xba +++ b/wizards/source/scriptforge/SF_TextStream.xba @@ -31,7 +31,7 @@ Option Explicit https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1io_1_1XTextInputStream.html https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1io_1_1XTextOutputStream.html - Disk file sstems and documents internal file systems + Disk file systems and documents internal file systems All methods and properties are applicable without restrictions on both file systems. However, when updates are operated on text files embedded in a document, (with the WriteXXX() methods), the updates are first done on a copy of the original file. When the file is closed, the copy @@ -722,4 +722,4 @@ Private Function _Repr() As String End Function ScriptForge.SF_TextStream._Repr REM END OF SCRIPTFORGE.SF_TextStream - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 38b7754d5ead0b43443acd9ef2cd956b94dad88b Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:25:49 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:19:34 2023 +0200 Fix typo Change-Id: I62c3e5394e52591df08e2f6acd826718dc1a0cbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154484 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 87197e6a589a..3bb177708f3f 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -37,7 +37,7 @@ Option Explicit Admitted wildcards are: the ? represents any single character the * represents zero, one, or multiple characters - Disk file sstems and documents internal file systems + Disk file systems and documents internal file systems All the implemented properties and methods are applicable on usual disk file systems. Root is usually something like C:\ or / or their URL equivalents Now, Libreoffice documents have an internal file system as well. Many of the proposed methods
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eb6da4a089ee58e1237a3b764d1e05c00b9f9f9b Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:25:18 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:19:10 2023 +0200 Fix typo Change-Id: I5e1093f05a9916991304a178a73d81c073883479 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154483 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 7cf290f9302c..87197e6a589a 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -2233,7 +2233,7 @@ End Function ScriptForge.FileSystem._GetConfigFolder REM - Public Function _IsDocFileSystem(psFile As String) As Boolean - ReturnsTrue when the argument designates a documents internal file system + Returns True when the argument designates a documents internal file system _IsDocFileSystem = SF_String.StartsWith(psFile, DOCFILESYSTEM, CaseSensitive := True)
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9e332f41250e21d692e9b5464206a67e2267d0c7 Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:24:35 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:18:41 2023 +0200 Fix typo Change-Id: I7a1afd67e976abe504f859f0f5561ac5ebc6df98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154482 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 2fd8e8984636..7cf290f9302c 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -43,7 +43,7 @@ Option Explicit Now, Libreoffice documents have an internal file system as well. Many of the proposed methods support documents file systems too, however, for some of them, with restrictions. Read the comments in the individual methods below. - It makes browing folders and files, adding, replacing files possible. Updates will be + It makes browsing folders and files, adding, replacing files possible. Updates will be saved with the document. VERY POWERFUL but KNOW WHAT YOURE DOING !! The root of a documents file system is obtained from the FileSystem property of a document instance, like in:
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 47a0a8d87023b6cf4e98eb3a5b1989d6d28153d6 Author: Andrea Gelmini AuthorDate: Sat Jul 15 20:24:14 2023 +0200 Commit: Julien Nabet CommitDate: Sat Jul 15 21:18:17 2023 +0200 Fix typo Change-Id: If692d47efd95e3383734b91ea72d4d665503b3d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154481 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index aeeafc4dc73d..2fd8e8984636 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -805,7 +805,7 @@ Check: Try: Get files Set oSfa = SF_Utils._GetUnoService(FileAccess) - vFiles = oSfa.getFolderContents(sFolderName, False) NB: The False argumentis ignored in document file systems + vFiles = oSfa.getFolderContents(sFolderName, False) NB: The False argument is ignored in document file systems Adjust notations For i = 0 To UBound(vFiles) sFile = SF_FileSystem._ConvertFromUrl(vFiles(i)) @@ -2280,4 +2280,4 @@ Dim sFolder As String Folder End Function ScriptForge.SF_FileSystem._SFInstallFolder REM END OF SCRIPTFORGE.SF_FileSystem - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Exception.xba |5 wizards/source/scriptforge/SF_FileSystem.xba | 177 ++- wizards/source/scriptforge/SF_Region.xba |2 wizards/source/scriptforge/SF_Root.xba | 15 + wizards/source/scriptforge/SF_TextStream.xba | 27 +++ wizards/source/scriptforge/SF_Utils.xba |7 wizards/source/scriptforge/po/ScriptForge.pot| 15 + wizards/source/scriptforge/po/en.po | 15 + wizards/source/scriptforge/python/scriptforge.py | 42 ++--- wizards/source/sfdocuments/SF_Base.xba |6 wizards/source/sfdocuments/SF_Calc.xba |6 wizards/source/sfdocuments/SF_Document.xba | 23 ++ wizards/source/sfdocuments/SF_FormDocument.xba |6 wizards/source/sfdocuments/SF_Writer.xba |6 14 files changed, 290 insertions(+), 62 deletions(-) New commits: commit 44334328f75dd0023122a4cb446ccba0d507720c Author: Jean-Pierre Ledure AuthorDate: Fri Jul 14 17:11:14 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sat Jul 15 09:54:01 2023 +0200 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 Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba index 6add0b158990..38e5b2ef24e0 100644 --- a/wizards/source/scriptforge/SF_Exception.xba +++ b/wizards/source/scriptforge/SF_Exception.xba @@ -72,6 +72,7 @@ Const OVERWRITEERROR = OVERWRITEERROR Const READONLYERROR= READONLYERROR Const NOFILEMATCHERROR = NOFILEMATCHFOUND Const FOLDERCREATIONERROR = FOLDERCREATIONERROR +Const FILESYSTEMERROR = FILESYSTEMERROR SF_Services Const UNKNOWNSERVICEERROR = UNKNOWNSERVICEERROR @@ -884,6 +885,10 @@ Try: sMessage = sLocation _ \n \n \n .GetText(VALIDATEERROR, pvArgs(0)) _ \n \n .GetText(FOLDERCREATION, pvArgs(0), pvArgs(1)) + Case FILESYSTEMERROR SF_FileSystem.---(ArgName, MethodName, ArgValue) + pvArgs(0) = _RightCase(pvArgs(0)) + sMessage = sLocation _ +\n \n .GetText(FILESYSTEM, pvArgs(0), pvArgs(1), pvArgs(2)) Case UNKNOWNSERVICEERROR SF_Services.CreateScriptService(ArgName, Value, Library, Service) pvArgs(0) = _RightCase(pvArgs(0)) sMessage = sLocation _ diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index b09f980429f4..aeeafc4dc73d 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -27,7 +27,7 @@ Option Explicit File and folder names may be expressed either in the (preferable because portable) URL form or in the more usual operating system notation (e.g. C:\... for Windows) The notation, both for
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Region.xba |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit b9addab4426745fa484f0012814699e31d5239b3 Author: Andrea Gelmini AuthorDate: Thu Jul 13 12:50:09 2023 +0200 Commit: Julien Nabet CommitDate: Thu Jul 13 22:59:54 2023 +0200 Fix typo Change-Id: If127e00bab20839021afe82df555083bbae72ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154384 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_Region.xba b/wizards/source/scriptforge/SF_Region.xba index d3eacfae0982..9ceccbbc94a6 100644 --- a/wizards/source/scriptforge/SF_Region.xba +++ b/wizards/source/scriptforge/SF_Region.xba @@ -549,7 +549,7 @@ Public Function UTCDateTime(Optional ByVal LocalDateTime As Variant _ Return: The local time converted to the corresponding UTC date and time as a Date If the returned value is before 1900, it is likely that the Locale is not recognized - If the returned value matches the local time, it is likely that the the timezone is not recognized + If the returned value matches the local time, it is likely that the timezone is not recognized Examples: regio.UTCDateTime(DateSerial(2022, 3, 20) + TimeSerial(17, 58, 17), Europe/Brussels, fr-BE) 2022-03-20 16:58:17 @@ -601,7 +601,7 @@ Public Function UTCNow(Optional ByVal TimeZone As Variant _ Return: The actual UTC date and time as a Date If the returned value is before 1900, it is likely that the Locale is not recognized - If the returned value matches the local time, it is likely that the the timezone is not recognized + If the returned value matches the local time, it is likely that the timezone is not recognized Examples: regio.UTCNow(Europe/Brussels, fr-BE) 2022-03-20 16:58:17 @@ -858,4 +858,4 @@ Finally: End Function ScriptForge.SF_Region._PropertyGet REM END OF SCRIPTFORGE.SF_REGION - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Calc.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b16861f667673560cf57d28bdd16bb592e6e3c22 Author: Jean-Pierre Ledure AuthorDate: Sat Jul 8 17:35:44 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sat Jul 8 22:46:25 2023 +0200 ScriptForge - (SF_Calc) fix typo in CopyToRange() method Change-Id: I07db487d94c2d0a8f2ec5955f6e94b00911d25c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154214 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index fe71b69e6a82..0138730c11f3 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -1085,7 +1085,7 @@ Const cstSubArgs = SourceRange, DestinationRange If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo Catch sCopy = -Check:string +Check: If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then If Not _IsStillAlive(True) Then GoTo Finally If Not ScriptForge.SF_Utils._Validate(SourceRange, SourceRange, Array(V_STRING, ScriptForge.V_OBJECT), , , CALCREFERENCE) Then GoTo Finally
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit 5d439a07b60d505ac1a9fafad90849aa13f0c2aa Author: Andrea Gelmini AuthorDate: Tue Jul 4 11:39:09 2023 +0200 Commit: Julien Nabet CommitDate: Tue Jul 4 14:24:29 2023 +0200 Fix typos Change-Id: I1049c2bec21caa751a37708023338a1449dc5539 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153953 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index f08a6ad7b45d..bbbeddd111d1 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -858,8 +858,8 @@ Public Function CreateCurrencyField(Optional ByVal ControlName As Variant _ Specific args: Border: 3D (default) or FLAT or NONE SpinButton:: when True (default = False), a spin button is present - MinValue: the smallest value that can be entered in the control. Dafault = -100 - MaxValue: the largest value that can be entered in the control. Dafault = +100 + MinValue: the smallest value that can be entered in the control. Default = -100 + MaxValue: the largest value that can be entered in the control. Default = +100 Increment: the step when the spin button is pressed. Default = 1 Accuracy: specifies the decimal accuracy. Default = 2 decimal digits Returns: @@ -920,8 +920,8 @@ Public Function CreateDateField(Optional ByVal ControlName As Variant _ Specific args: Border: 3D (default) or FLAT or NONE Dropdown:: when True (default = False), a dropdown button is shown - MinDate: the smallest date that can be entered in the control. Dafault = 1900-01-01 - MaxDate: the largest Date that can be entered in the control. Dafault = 2200-12-31 + MinDate: the smallest date that can be entered in the control. Default = 1900-01-01 + MaxDate: the largest Date that can be entered in the control. Default = 2200-12-31 Returns: an instance of the SF_DialogControl class or Nothing Example: @@ -1133,8 +1133,8 @@ Public Function CreateFormattedField(Optional ByVal ControlName As Variant _ Specific args: Border: 3D (default) or FLAT or NONE SpinButton:: when True (default = False), a spin button is present - MinValue: the smallest value that can be entered in the control. Dafault = -100 - MaxValue: the largest value that can be entered in the control. Dafault = +100 + MinValue: the smallest value that can be entered in the control. Default = -100 + MaxValue: the largest value that can be entered in the control. Default = +100 Returns: an instance of the SF_DialogControl class or Nothing Example: @@ -1407,8 +1407,8 @@ Public Function CreateNumericField(Optional ByVal ControlName As Variant _ Specific args: Border: 3D (default) or FLAT or NONE SpinButton:: when True (default = False), a spin button is present - MinValue: the smallest value that can be entered in the control. Dafault = -100 - MaxValue: the largest value that can be entered in the control. Dafault = +100 + MinValue: the smallest value that can be entered in the control. Default = -100 + MaxValue: the largest value that can be entered in the control. Default = +100 Increment: the step when the spin button is pressed. Default = 1 Accuracy: specifies the decimal accuracy. Default = 2 decimal digits Returns: @@ -1614,8 +1614,8 @@ Public Function CreateScrollBar(Optional ByVal ControlName As Variant _ Specific args: Orientation: H[orizontal] or V[ertical] Border: 3D (default) or FLAT or NONE - MinValue: the smallest value that can be entered in the control. Dafault = 0 - MaxValue: the largest value that can be entered in the control. Dafault = 100 + MinValue: the smallest value that can be entered in the control. Default = 0 + MaxValue: the largest value that can be entered in the control. Default = 100 Returns: an instance of the SF_DialogControl class or Nothing Example: @@ -1794,8 +1794,8 @@ Public Function CreateTimeField(Optional ByVal ControlName As Variant _ Create a new control of type TimeField in the actual dialog. Specific args: Border: 3D (default) or FLAT or NONE - MinTime: the smallest time that can be entered in the control. Dafault = 0 - MaxTime: the largest time that can be entered in the control. Dafault = 24h +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e1f1f2b85379faa79e2b52ee221089b1d01646f7 Author: Andrea Gelmini AuthorDate: Sat May 27 07:21:44 2023 +0200 Commit: Julien Nabet CommitDate: Sat May 27 13:50:12 2023 +0200 Fix typo Change-Id: Id0d9335df80539877d1ee27e57e98b0a6aae75db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152337 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index a81e83494dc5..f08a6ad7b45d 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -2581,7 +2581,7 @@ Try: Set dimension and position With oControlModel If IsArray(Place) Then - Ignore width and height when new control is cloed from an existing one + Ignore width and height when new control is cloned from an existing one If UBound(Place) = 1 Then .PositionX = Place(0) .PositionY = Place(1) @@ -3119,4 +3119,4 @@ Private Function _Repr() As String End Function SFDialogs.SF_Dialog._Repr REM END OF SFDIALOGS.SF_DIALOG - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 42df2445f3bc34cf006f9b4433671e21a179ff5c Author: Andrea Gelmini AuthorDate: Sat May 27 07:22:06 2023 +0200 Commit: Julien Nabet CommitDate: Sat May 27 12:34:14 2023 +0200 Fix typo Change-Id: I989d9a915c61186b4fd9132f70b916b3dfd7f202 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152338 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 21e307b5..a81e83494dc5 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -2570,7 +2570,7 @@ Check: If IsMissing(ArgValues) Or IsEmpty(ArgValues) Then ArgValues = Array() Try: - When rhe model is a string, create a new (empty) model instance + When the model is a string, create a new (empty) model instance Select Case VarType(pvModel) Case V_STRING : Set oControlModel = _DialogModel.createInstance(com.sun.star.awt. pvModel) Case ScriptForge.V_OBJECT : Set oControlModel = pvModel
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |3 wizards/source/sfdialogs/SF_Dialog.xba | 93 +++ 2 files changed, 81 insertions(+), 15 deletions(-) New commits: commit a83643dea9f5922d4706c9e1d8b9f53f71eb01d9 Author: Jean-Pierre Ledure AuthorDate: Fri May 26 17:13:04 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Fri May 26 19:06:07 2023 +0200 ScriptForge (SF_Dialog) new CloneControl() method Duplicate an existing control of any type in the actual dialog. The duplicated control is left unchanged. The new control can be relocated. Args: SourceName: the name of the control to duplicate ControlName: the name of the new control. It must not exist yet. Left, Top: the coordinates of the new control expressed in "Map AppFont" units. Returns: an instance of the SF_DialogControl class or Nothing The method is available from Basic and Python user scripts This change will require an update of the SF_Dialog help page. Change-Id: I5c2a5404a14ad60b2d4df2ac7eabbf0ddd843170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152333 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 76845c71e75d..96474e4eb4de 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1866,6 +1866,9 @@ class SFDialogs: parentobj = parent.objectreference if isinstance(parent, parentclasses) else parent return self.ExecMethod(self.vbMethod + self.flgObject + self.flgHardCode, 'Center', parentobj) +def CloneControl(self, sourcename, controlname, left = 1, top = 1): +return self.ExecMethod(self.vbMethod, 'CloneControl', sourcename, controlname, left, top) + def Controls(self, controlname = ''): return self.ExecMethod(self.vbMethod + self.flgArrayRet + self.flgHardCode, 'Controls', controlname) diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index cf32bf92629b..21e307b5 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -571,6 +571,58 @@ Catch: GoTo Finally End Function SF_Documents.SF_Dialog.Center +REM - +Public Function CloneControl(Optional ByVal SourceName As Variant _ + , Optional ByVal ControlName As Variant _ + , Optional ByVal Left As Variant _ + , Optional ByVal Top As Variant _ + ) As Object + Duplicate an existing control of any type in the actual dialog. + The duplicated control is left unchanged. The new control can be relocated. + Specific args: + SourceName: the name of the control to duplicate + ControlName: the name of the new control. It must not exist yet + Left, Top: the coordinates of the new control expressed in Map AppFont units + Returns: + an instance of the SF_DialogControl class or Nothing + Example: + Set myButton2 = dialog.CloneControl(Button1, Button2, 30, 30) + +Dim oControl As Object Return value +Dim oSourceModel As Object com.sun.star.awt.XControlModel of the source +Dim oControlModel As Object com.sun.star.awt.XControlModel of the new control +Const cstThisSub = SFDialogs.Dialog.CloneControl +Const cstSubArgs = SourceName, ControlName, [Left=1], [Top=1] + +Check: + Set oControl = Nothing + + If IsMissing(Left) Or IsEmpty(Left) Then Left = 1 + If IsMissing(Top) Or IsEmpty(Top) Then Top = 1 + + If Not _CheckNewControl(cstThisSub, cstSubArgs, ControlName, Place := Null) Then GoTo Finally + + If Not ScriptForge.SF_Utils._Validate(SourceName, SourceName, V_String, _DialogModel.getElementNames()) Then GoTo Finally + If Not ScriptForge.SF_Utils._Validate(Left, Left, ScriptForge.V_NUMERIC) Then GoTo Finally + If Not ScriptForge.SF_Utils._Validate(Top, Top, ScriptForge.V_NUMERIC) Then GoTo Finally + +Try: + All control types are presumes cloneable + Set oSourceModel = _DialogModel.getByName(SourceName) + Set oControlModel = oSourceModel.createClone() + oControlModel.Name = ControlName + + Create the control + Set oControl = _CreateNewControl(oControlModel, ControlName, Array(Left, Top)) + +Finally: + Set CloneControl = oControl + ScriptForge.SF_Utils._ExitFunction(cstThisSub) + Exit Function +Catch: + GoTo Finally
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |3 wizards/source/sfdialogs/SF_Dialog.xba | 87 ++- wizards/source/sfdialogs/SF_DialogControl.xba|3 wizards/source/sfdialogs/SF_Register.xba |2 4 files changed, 91 insertions(+), 4 deletions(-) New commits: commit e7c4a883624745ef858d0e281e87c0483a66b791 Author: Jean-Pierre Ledure AuthorDate: Tue May 23 16:19:50 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Wed May 24 11:20:48 2023 +0200 ScripForge (SF_Dialog) new OrderTabs() method Set the tabulation index f a series of controls. The sequence of controls are given as an array of control names from the first to the last. Next controls will not be accessible (anymore ?) via the TAB key if >=1 of next conditions is met: - if they are not in the given list - if their type is FixedLine, GroupBox or ProgressBar - if the control is disabled Args: TabsList: an array of valid control names in the order of tabulation. Start: the tab index to be assigned to the 1st control in the list. Default = 1. Increment: the difference between 2 successive tab indexes. Default = 1. Returns: True when successful. The method is available from Basic and Python user scripts This change will require an update of the SF_Dialog help page. Change-Id: Ie854227691c4e182b49a521b1285deaa4de3d1ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152166 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 66d69238a16c..76845c71e75d 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1977,6 +1977,9 @@ class SFDialogs: l10nobj = l10n.objectreference if isinstance(l10n, SFScriptForge.SF_L10N) else l10n return self.ExecMethod(self.vbMethod + self.flgObject, 'GetTextsFromL10N', l10nobj) +def OrderTabs(self, tabslist, start = 1, increment = 1): +return self.ExecMethod(self.vbMethod, 'OrderTabs', tabslist, start, increment) + def Resize(self, left = -9, top = -9, width = -1, height = -1): return self.ExecMethod(self.vbMethod + self.flgHardCode, 'Resize', left, top, width, height) diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 9eb72d1a2d94..cf32bf92629b 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -2095,6 +2095,7 @@ Public Function Methods() As Variant , EndExecute _ , Execute _ , GetTextsFromL10N _ + , OrderTabs _ , Resize _ , SetPageManager _ , Terminate _ @@ -2102,6 +2103,90 @@ Public Function Methods() As Variant End Function SFDialogs.SF_Dialog.Methods +REM - +Public Function OrderTabs(ByRef Optional TabsList As Variant _ + , ByVal Optional Start As Variant _ + , ByVal Optional Increment As Variant _ + ) As Boolean + Set the tabulation index f a series of controls. + The sequence of controls are given as an array of control names from the first to the last. + Next controls will not be accessible (anymore ?) via the TAB key if =1 of next conditions is met: + - if they are not in the given list + - if their type is FixedLine, GroupBox or ProgressBar + - if the control is disabled + Args: + TabsList: an array of valid control names in the order of tabulation + Start: the tab index to be assigned to the 1st control in the list. Default = 1 + Increment: the difference between 2 successive tab indexes. Default = 1 + Returns: + True when successful + Example: + dialog.OredrTabs(Array(myListBox, myTextField, myNumericField), Start := 10) + +Dim bOrder As BooleanReturn value +Dim vControlNames As Variant List of control names in the dialog +Dim oControl As Object A SF_DialogControl instance +Dim bValid As BooleanWhen True, the considered control deserves a tab stop +Dim iTabIndex As Integer The tab index to be set +Dim vWrongTypes As Variant List of rejected control types +Dim i As Long + +Const cstThisSub =
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 60489faa6c4dff83abcf63d615a16c71a412b856 Author: Andrea Gelmini AuthorDate: Mon May 22 17:50:03 2023 +0200 Commit: Julien Nabet CommitDate: Mon May 22 20:45:22 2023 +0200 Fix typo Change-Id: Ic3f79113f09be10f6ff33183b09f80e269f77f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152122 Reviewed-by: Jean-Pierre Ledure Tested-by: Julien Nabet diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 8b3a67fe2f60..66d69238a16c 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1993,7 +1993,7 @@ class SFDialogs: class SF_NewDialog(SFServices): """ Pseudo service never returned from the Basic world. A SF_Dialog instance is returned instead. -Main purpose: manage the arguments of CreateScritService() for the creation of a dialog from scratch +Main purpose: manage the arguments of CreateScriptService() for the creation of a dialog from scratch """ # Mandatory class properties for service registration serviceimplementation = 'basic'
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit fba847a7fc515b271b60c1a3fe54254cc4424423 Author: Andrea Gelmini AuthorDate: Mon May 22 17:49:14 2023 +0200 Commit: Julien Nabet CommitDate: Mon May 22 20:44:05 2023 +0200 Fix typo Change-Id: I6fab6b5c40eb9668df72ea01a2d158eabdc99f86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152121 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 4979fa82a681..9eb72d1a2d94 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -14,7 +14,7 @@ Option Explicit SF_Dialog = - Management of dialogs. They may bedefined with the Basic IDE or built from scratch + Management of dialogs. They may be defined with the Basic IDE or built from scratch Each instance of the current class represents a single dialog box displayed to the user A dialog box can be displayed in modal or in non-modal modes @@ -2971,4 +2971,4 @@ Private Function _Repr() As String End Function SFDialogs.SF_Dialog._Repr REM END OF SFDIALOGS.SF_DIALOG - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Services.xba |3 wizards/source/scriptforge/python/scriptforge.py | 26 + wizards/source/sfdialogs/SF_Dialog.xba | 46 +++- wizards/source/sfdialogs/SF_Register.xba | 118 +-- 4 files changed, 177 insertions(+), 16 deletions(-) New commits: commit 0a1022b04c90d36e16dee121923ca4111386585b Author: Jean-Pierre Ledure AuthorDate: Sun May 21 17:06:05 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Mon May 22 14:08:20 2023 +0200 ScriptForge (SFDialogs: create dialogs on-the-fly A dialog service is returned by next statement dialog = CreateScriptService("newdialog", dialogname, place) All properties and methods applicable to predefined dialogs are available for such new dialogs. In particular the series of CreateXXX() methods for the addition of ne dialog controls. The functionality is available from Basic and Python user scripts. An update of the SFDialogs.SF_Dialog help page is required. A display rendering unstability (flickerings, delays, ..) has been observed when (all conditions must be met) - the user script is run from Python - from inside the LibreOffice process - the dialog is non-modal Change-Id: Id3f311cd04497fd79712ce712bdb2724b5caa861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152071 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure diff --git a/wizards/source/scriptforge/SF_Services.xba b/wizards/source/scriptforge/SF_Services.xba index f5e0545546e6..f00ad9e94b21 100644 --- a/wizards/source/scriptforge/SF_Services.xba +++ b/wizards/source/scriptforge/SF_Services.xba @@ -128,7 +128,8 @@ Try: Select Case LCase(sService) Case document, calc, writer, base, formdocument, documentevent, formevent sLibrary = SFDocuments - Case dialog, dialogevent : sLibrary = SFDialogs + Case dialog, dialogevent, newdialog + sLibrary = SFDialogs Case database, datasheet : sLibrary = SFDatabases Case unittest : sLibrary = SFUnitTests Case menu, popupmenu, toolbar, toolbarbutton diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 1b094c4711be..8b3a67fe2f60 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1987,6 +1987,32 @@ class SFDialogs: def Terminate(self): return self.ExecMethod(self.vbMethod, 'Terminate') +# # +# SF_NewDialog CLASS +# # +class SF_NewDialog(SFServices): +""" +Pseudo service never returned from the Basic world. A SF_Dialog instance is returned instead. +Main purpose: manage the arguments of CreateScritService() for the creation of a dialog from scratch +""" +# Mandatory class properties for service registration +serviceimplementation = 'basic' +servicename = 'SFDialogs.NewDialog' +servicesynonyms = ('newdialog', 'sfdialogs.newdialog') +serviceproperties = dict() + +@classmethod +def ReviewServiceArgs(cls, dialogname = '', place = (0, 0, 0, 0)): +""" +Transform positional and keyword arguments into positional only +Add the XComponentContext as last argument +""" +outsideprocess = len(ScriptForge.hostname) > 0 and ScriptForge.port > 0 +if outsideprocess: +return dialogname, place, ScriptForge.componentcontext +else: +return dialogname, place + # # # SF_DialogControl CLASS # # diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 20f1e81dc650..4979fa82a681 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -14,18 +14,22 @@ Option Explicit SF_Dialog = - Management of dialogs defined with the Basic IDE + Management of dialogs. They may bedefined with the Basic IDE or built from scratch Each instance of the current
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 24ba2cdaedb616c091f51cdec7e77c9930c83162 Author: Andrea Gelmini AuthorDate: Thu May 18 12:19:35 2023 +0200 Commit: Julien Nabet CommitDate: Thu May 18 12:39:17 2023 +0200 Fix typo Change-Id: Ia737462375311bb8642a9326a2980111e3ef7064 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151953 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 03d74ebcd68d..b50e22aebeb3 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -1528,8 +1528,8 @@ Public Function CreateTableControl(Optional ByVal ControlName As Variant _ To fill the table with data, use the SetTableData() method Specific args: Border: 3D (default) or FLAT or NONE - RowHeaders: when True (default), the row Headerss are shown - ColumnHeaders: when True (default), the column Headerss are shown + RowHeaders: when True (default), the row Headers are shown + ColumnHeaders: when True (default), the column Headers are shown ScrollBars: H[orizontal] or V[ertical] or B[oth] or N[one] (default) Note that scrollbars always appear dynamically when they are needed GridLines: when True (default = False) horizontal and vertical lines are painted between the grid cells
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogControl.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3fdaed2ebbc6ada5c179b3d7eccd89fac8cde1e3 Author: Andrea Gelmini AuthorDate: Thu May 18 12:18:31 2023 +0200 Commit: Julien Nabet CommitDate: Thu May 18 12:38:24 2023 +0200 Fix typo Change-Id: I1a18149550cdfbaf7537213bdf41734751503598 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151950 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index cc4f6ca7dd13..e4e8fe929309 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -1342,7 +1342,7 @@ Dim dWidth As DoubleA single item of Widths Dim dRelativeWidth As Double Sum of Widths up to the number of columns Dim dWidthFactor As Double Factor to apply to relative widths to get absolute column widths Dim lHeaderWidth As Long Row header width when row header present, otherwise = 0 -Dim lAverageWidth As LongWidth to apply when columns spead evenly across table +Dim lAverageWidth As LongWidth to apply when columns spread evenly across table Dim vDataRow As Variant A single row content in the tablecontrol Dim vDataItem As Variant A single DataArray item Dim sAlign As String Columns horizontal alignments (single chars: L, C, R, space) @@ -2512,4 +2512,4 @@ Private Function _Repr() As String End Function SFDialogs.SF_DialogControl._Repr REM END OF SFDIALOGS.SF_DIALOGCONTROL - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7d7740aeca1aa50d8ecdffedee51365f3a9e3d4d Author: Andrea Gelmini AuthorDate: Thu May 18 12:16:31 2023 +0200 Commit: Julien Nabet CommitDate: Thu May 18 12:37:10 2023 +0200 Fix typo Change-Id: I4a9abe0683f6dfd116fa15a6e1202d5a69328553 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151945 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index d06b685053d6..e297bf296026 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -1995,7 +1995,7 @@ Public Function Methods() As Variant , CreatePatternField _ , CreateProgressBar _ , CreateRadioButton _ - , CfeateScrollBar _ + , CreateScrollBar _ , CreateTableControl _ , CreateTextField _ , CreateTimeField _
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 13c3376b01770db981cdf2c63ef4072ebe0d4d21 Author: Andrea Gelmini AuthorDate: Thu May 18 12:16:05 2023 +0200 Commit: Julien Nabet CommitDate: Thu May 18 12:36:50 2023 +0200 Fix typo Change-Id: Ifbda8492c1b7c6cef1616a6183e2d04aee1b9bde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151944 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 7ce10d21f7b2..d06b685053d6 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -634,7 +634,7 @@ Public Function CreateButton(Optional ByVal ControlName As Variant _ Create a new control of type Button in the actual dialog. Specific args: Toggle: when True a Toggle button is created. Default = False - Push: OK, CANCE or (default) + Push: OK, CANCEL or (default) Returns: an instance of the SF_DialogControl class or Nothing Example: @@ -2878,4 +2878,4 @@ Private Function _Repr() As String End Function SFDialogs.SF_Dialog._Repr REM END OF SFDIALOGS.SF_DIALOG - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Exception.xba |6 wizards/source/scriptforge/SF_Root.xba |9 wizards/source/scriptforge/po/ScriptForge.pot| 15 wizards/source/scriptforge/po/en.po | 15 wizards/source/scriptforge/python/scriptforge.py | 104 + wizards/source/sfdialogs/SF_Dialog.xba | 1286 ++- wizards/source/sfdialogs/SF_DialogControl.xba| 178 ++- wizards/source/sfdialogs/SF_DialogUtils.xba | 69 + 8 files changed, 1614 insertions(+), 68 deletions(-) New commits: commit 66a3b09fc3b2927f1333f4fd54426fc5918d89cb Author: Jean-Pierre Ledure AuthorDate: Wed May 17 17:52:53 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Thu May 18 10:30:45 2023 +0200 ScriptForge (SFDialogs) create controls dynamically The dialog service hosts now a bunch of methods to create new controls dynamically in an existing dialog predefined in the Basic IDE. In other words, a dialog is initialized with controls in the Basic IDE. New controls can be added at run-time before or after the Execute() statement. All the new methods have in common their first 2 arguments: ControlName Place: an (X, Y, Width, Height) array or a com.sun.star.awt.Rectangle New methods: CreateButton(..., toggle, push) CreateCheckBox(..., multiline) CreateComboBox(..., border, dropdown, linecount) CreateCurrencyField(..., border, spinbutton, minvalue, maxvalue, increment, accuracy) CreateDateField(..., border, dropdown, mindate, maxdate) CreateFileControl(..., border) CreateFixedLine(..., orientation) CreateFixedText(..., border, multiline, align, verticalalign) CreateFormattedField(..., border, spinbutton, minvalue, maxvalue) CreateGroupBox(...) CreateImageControl(..., border, scale) CreateListBox(..., border, dropdown, linecount, multiselect) CreateNumericField(..., border, spinbutton, minvalue, maxvalue, increment, accuracy) CreatePatternField(..., border, editmask, literalmask) CreateProgressBar(..., border, minvalue, maxvalue) CreateRadioButton(..., multiline) CreateScrollBar(..., orientation, border, minvalue, maxvalue) CreateTableControl(..., border, rowheaders, columnheaders, scrollbars, gridlines) CreateTextField(..., border, multiline, maximumlength, passwordcharacter) CreateTimeField(..., border, mintime, maxtime) CreateTreeControl(..., border) All the methods return a SF_DialogControl instance. The arguments have bben chosen based on functionality rather than on layout. After the creatio of the control, most properties and methods relevant to SF_DialogControl objects are applicable. Also the XControlModel property might contribute to layout refinements. Other changes: - The SF_DialogControl class receives next updatable properties: Border and TabIndex - The dialogcontrol.SetTableData() receives an additional argument: rowheaderwidth - The dialogcontrol.Resize() method without arguments resizes the control to its "preferred size", a size adjusted depending on its actual content All the new functionalities are callable from both Basic and Python user scripts. Described changes will require a serios review of the Dialog and DialogControl help pages. Change-Id: I654eeae5456527bf14b1f4b43f04d176bbd830b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151896 Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba index f752e054f2b5..6add0b158990 100644 --- a/wizards/source/scriptforge/SF_Exception.xba +++ b/wizards/source/scriptforge/SF_Exception.xba @@ -126,6 +126,7 @@ Const DIALOGDEADERROR = DIALOGDEADERROR Const CONTROLTYPEERROR = CONTROLTYPEERROR Const TEXTFIELDERROR = TEXTFIELDERROR Const PAGEMANAGERERROR = PAGEMANAGERERROR +Const DUPLICATECONTROLERROR= DUPLICATECONTROLERROR SF_Database Const DBREADONLYERROR = DBREADONLYERROR @@ -1024,6 +1025,11 @@ Try: Case PAGEMANAGERERROR SF_Dialog.SetPageManager(PilotsList, TabsList, WizardsList) sMessage = sLocation _ \n \n .GetText(PAGEMANAGER, pvArgs(0), pvArgs(1), pvArgs(2), pvArgs(3), pvArgs(4), pvArgs(5)) + Case DUPLICATECONTROLERROR SF_Dialog.CreateControl(ControlName, DialogName) + pvArgs(0) = _RightCase(pvArgs(0)) + sMessage = sLocation _ +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdatabases/SF_Database.xba |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit d07cc6706ef3b382fa16a104c97b69bc2d2365e5 Author: Jean-Pierre Ledure AuthorDate: Tue May 16 17:00:20 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Wed May 17 08:53:58 2023 +0200 ScriptForge - database.GetRows() tdf#155204 error when no data The complete expected bheviour is: when there is no data returned by the query, - either GetRows() returns an empty array, (Header := False) - or GetRows() returns an array with a single row containing the column names only (Header := True) In the example given in the bug report, GetRows() gives an unexpected error. Actually the "end-of-file" status is tested with the isAfterLast() indicator. It seems better to rely on the Boolean value returned by the first() and next() methods applied on the resultset. Change-Id: Ibe97dbbcb03d45ebb9184fab2733abe4e04963a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151844 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba index de891935be69..f93cf55d74c0 100644 --- a/wizards/source/sfdatabases/SF_Database.xba +++ b/wizards/source/sfdatabases/SF_Database.xba @@ -312,7 +312,8 @@ Dim sSql As StringSQL statement Dim bDirect Alias of DirectSQL Dim lCols As LongNumber of columns Dim lRows As LongNumber of rows -Dim oColumns As Object +Dim oColumns As Object Collection of com.sun.star.sdb.ODataColumn +Dim bRead As Boolean When True, next record has been read successfully Dim i As Long Const cstThisSub = SFDatabases.Database.GetRows Const cstSubArgs = SQLCommand, [DirectSQL=False], [Header=False], [MaxRows=0] @@ -367,8 +368,8 @@ Try: End If Load data - .first() - Do While Not .isAfterLast() And (MaxRows = 0 Or lRows MaxRows - 1) + bRead = .first() + Do While bRead And (MaxRows = 0 Or lRows MaxRows - 1) lRows = lRows + 1 If lRows = 0 Then ReDim vResult(0 To lRows, 0 To lCols) @@ -378,7 +379,7 @@ Try: For i = 0 To lCols vResult(lRows, i) = _GetColumnValue(oResult, i + 1) Next i - .next() + bRead = .next() Loop End With
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |6 +- wizards/source/sfdialogs/SF_DialogControl.xba| 47 ++- wizards/source/sfdialogs/SF_DialogUtils.xba |2 3 files changed, 41 insertions(+), 14 deletions(-) New commits: commit a58017d99c3cea52fe7b37f2379c5306bfa59807 Author: Jean-Pierre Ledure AuthorDate: Sun Apr 23 12:57:11 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Sun Apr 23 14:54:49 2023 +0200 ScriptForge (SFDialogs) support hyperlink control types Controls designated in english as "Hyperlink controls" in the Basic IDE are from now on accepted as instances of the SF_DialogControl service. All generic properties are accepted. The supported specific properties are: - Caption (the text that appears in the dialog box) - URL (the URL to activate when clicked) The new control type is supported in Basic and Python user scripts. The SFDialogs.DialogControl help page needs to be updated. Change-Id: I4827834ad8ef336c084ee51b5285b85745ceb1b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150824 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 09d796aa161c..ff5a3ef8b6ee 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1913,9 +1913,9 @@ class SFDialogs: OnMouseReleased = True, OnNodeExpanded = True, OnNodeSelected = True, OnTextChanged = True, Page = True, Parent = False, Picture = True, RootNode = False, RowSource = True, Text = False, TipText = True, - TripleState = True, Value = True, Visible = True, Width = True, X = True, Y = True, - XControlModel = False, XControlView = False, XGridColumnModel = False, - XGridDataModel = False, XTreeDataModel = False) + TripleState = True, URL = True, Value = True, Visible = True, Width = True, + X = True, Y = True, XControlModel = False, XControlView = False, + XGridColumnModel = False, XGridDataModel = False, XTreeDataModel = False) # Root related properties do not start with X and, nevertheless, return a UNO object @property diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index e7c415f0ba52..ddcd7f4aab99 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -142,6 +142,7 @@ Private Const CTLFIXEDLINE = FixedLine Private Const CTLFIXEDTEXT = FixedText Private Const CTLFORMATTEDFIELD= FormattedField Private Const CTLGROUPBOX = GroupBox +Private Const CTLHYPERLINK = Hyperlink Private Const CTLIMAGECONTROL = ImageControl Private Const CTLLISTBOX = ListBox Private Const CTLNUMERICFIELD = NumericField @@ -648,6 +649,18 @@ Property Let TripleState(Optional ByVal pvTripleState As Variant) _PropertySet(TripleState, pvTripleState) End Property SFDialogs.SF_DialogControl.TripleState (let) +REM - +Property Get URL() As Variant + The URL property refers to the URL to open when the control is clicked + URL = _PropertyGet(URL, ) +End Property SFDialogs.SF_DialogControl.URL (get) + +REM - +Property Let URL(Optional ByVal pvURL As Variant) + Set the updatable property URL + _PropertySet(URL, pvURL) +End Property SFDialogs.SF_DialogControl.URL (let) + REM - Property Get Value() As Variant The Value property specifies the data contained in the control @@ -1132,6 +1145,7 @@ Public Function Properties() As Variant , Text _ , TipText _ , TripleState _ + , URL _ , Value _ , Visible _ , Width _ @@ -1673,7 +1687,6 @@ Public Sub _Initialize() Dim vServiceName As Variant Split service name Dim sType As String Last component of service name -Dim oPosSize As Object com.sun.star.awt.Rectangle Try: _ImplementationName = _ControlModel.getImplementationName() @@ -1685,6 +1698,8 @@
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogControl.xba | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 8e89ca42f3748e31fb600e6d69f96a6451e8240e Author: Andrea Gelmini AuthorDate: Fri Apr 21 17:35:18 2023 +0200 Commit: Julien Nabet CommitDate: Sat Apr 22 12:42:13 2023 +0200 Fix typo in code Change-Id: Iba5e188204fafa4cd88282d001eea31f277fcc4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150768 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index 106c4f687687..e7c415f0ba52 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -2024,19 +2024,19 @@ Const cstSubArgs = _PropertyGet = SF_DialogUtils._ConvertToAppFont(_ControlView, False).Width Else If oSession.HasUNOProperty(_ControlModel, Width) Then _PropertyGet = _ControlModel.Width - End If + End If Case UCase(X) If [_parent]._Displayed Then Convert PosSize view property from pixels to APPFONT units _PropertyGet = SF_DialogUtils._ConvertToAppFont(_ControlView, True).X Else - If oSession.HasUNOProperty(_ControlModel, PoistionX) Then _PropertyGet = _ControlModel.PositionX - End If + If oSession.HasUNOProperty(_ControlModel, PositionX) Then _PropertyGet = _ControlModel.PositionX + End If Case UCase(Y) If [_parent]._Displayed Then Convert PosSize view property from piYels to APPFONT units _PropertyGet = SF_DialogUtils._ConvertToAppFont(_ControlView, True).Y Else - If oSession.HasUNOProperty(_ControlModel, PoistionY) Then _PropertyGet = _ControlModel.PositionY - End If + If oSession.HasUNOProperty(_ControlModel, PositionY) Then _PropertyGet = _ControlModel.PositionY + End If Case UCase(XControlModel) Set _PropertyGet = _ControlModel Case UCase(XControlView) @@ -2415,4 +2415,4 @@ Private Function _Repr() As String End Function SFDialogs.SF_DialogControl._Repr REM END OF SFDIALOGS.SF_DIALOGCONTROL - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogUtils.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dabe502c362f528a529e14a90abcc79d95d393be Author: Andrea Gelmini AuthorDate: Fri Apr 21 17:34:07 2023 +0200 Commit: Julien Nabet CommitDate: Sat Apr 22 10:44:06 2023 +0200 Fix typo Change-Id: I59aea5a7b71d6ddf14d4d7d22b61bdc8ab01ae3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150767 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogUtils.xba b/wizards/source/sfdialogs/SF_DialogUtils.xba index d8dc1b56e2a1..b5f83632fe45 100644 --- a/wizards/source/sfdialogs/SF_DialogUtils.xba +++ b/wizards/source/sfdialogs/SF_DialogUtils.xba @@ -164,7 +164,7 @@ Public Function _Resize(ByRef Control As Object _ , Optional ByVal Width As Variant _ , Optional ByVal Height As Variant _ ) As Boolean - Move the top-left corner of a dialog or a diaog control to new coordinates and/or modify its dimensions + Move the top-left corner of a dialog or a dialog control to new coordinates and/or modify its dimensions Without arguments, the method resets the initial dimensions Attributes denoting the position and size of a dialog are expressed in Map AppFont units. Map AppFont units are device and resolution independent.
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogUtils.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 5c47997694adbaedfed5c20f861e493b4e07c134 Author: Andrea Gelmini AuthorDate: Fri Apr 21 17:31:29 2023 +0200 Commit: Julien Nabet CommitDate: Sat Apr 22 10:43:42 2023 +0200 Fix typo Change-Id: I943dbf7dd8c6ac138ab9fc16638a06b07dcace93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150766 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogUtils.xba b/wizards/source/sfdialogs/SF_DialogUtils.xba index 0dc706be60d0..d8dc1b56e2a1 100644 --- a/wizards/source/sfdialogs/SF_DialogUtils.xba +++ b/wizards/source/sfdialogs/SF_DialogUtils.xba @@ -15,7 +15,7 @@ Option Private Module FOR INTERNAL USE ONLY Groups private functions that are common to the SF_Dialog and SF_DialogControl class modules - Topics where SF_DiaogUtils matters: + Topics where SF_DialogUtils matters: - resizing dialog and dialog controls @@ -272,4 +272,4 @@ End Function SFDialogss.SF_DialogUtils._Resize REM = END OF SFDIALOGS.SF_DIALOGUTILS - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_FileSystem.xba |4 wizards/source/scriptforge/SF_Utils.xba |4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 9c60996fc2a536803d016d6f60f879f8a1e49a54 Author: Jean-Pierre Ledure AuthorDate: Tue Apr 11 17:21:48 2023 +0200 Commit: Jean-Pierre Ledure CommitDate: Tue Apr 11 18:59:39 2023 +0200 ScriptForge - (SF_FileSystem) tdf#154462 2nd call of PickFile() fails Error happens in gen and gtk3 modes. Does not happen in kf5 mode. Linux only. Windows OK. Change-Id: Ia5dd21f6879c1a732d291d15d6fb9f4bf20c76e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150238 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 21464c708fe5..b09f980429f4 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -1588,6 +1588,10 @@ Try: Get selected file iAccept = .Execute() If iAccept = com.sun.star.ui.dialogs.ExecutableDialogResults.OK Then sFile = .getSelectedFiles()(0) + + Do not reuse a FilePicker, side effects observed (a.o. TDF#154462) + .dispose() + End With Finally: diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index c19f815587ce..11753704c461 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -370,9 +370,7 @@ Dim oDefaultContext As Object End If Set _GetUNOService = .FileAccess Case FilePicker - If IsEmpty(.FilePicker) Or IsNull(.FilePicker) Then - Set .FilePicker = CreateUnoService(com.sun.star.ui.dialogs.FilePicker) - End If + Set .FilePicker = CreateUnoService(com.sun.star.ui.dialogs.FilePicker) Do not reuse an existing FilePicker: TDF#154462 Set _GetUNOService = .FilePicker Case FilterFactory If IsEmpty(.FilterFactory) Or IsNull(.FilterFactory) Then
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |7 wizards/source/sfdialogs/SF_Dialog.xba | 22 +-- wizards/source/sfdialogs/SF_DialogControl.xba| 165 +++ wizards/source/sfdialogs/SF_DialogListener.xba |4 4 files changed, 183 insertions(+), 15 deletions(-) New commits: commit 3d94a43d28813b42c11a66fa88724aae53d5780e Author: Jean-Pierre Ledure AuthorDate: Mon Mar 20 16:48:55 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Tue Mar 21 06:35:19 2023 + ScriptForge - (SF_DialogControl) new Resize() method Addition of method control.Resize(X, Y, Width, Height) to selectively (arguments are applicable only when present) update the position and/or the size of any dialog control. Addition of updatable properties: Height Width X Y for the same purpose. All measures are expressed in PIXELS. The measures for dialogs are also as from now expressed in pixels. Changes are applicable to Basic and Python user scripts. Documentation should be updated. Change-Id: I03a6c819efa6a2a67c88403f1ae644d94eb7f2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149174 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 531b0da1e6be..f61da2e3885b 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1904,7 +1904,7 @@ class SFDialogs: servicename = 'SFDialogs.DialogControl' servicesynonyms = () serviceproperties = dict(Cancel = True, Caption = True, ControlType = False, CurrentNode = True, - Default = True, Enabled = True, Format = True, ListCount = False, + Default = True, Enabled = True, Format = True, Height = True, ListCount = False, ListIndex = True, Locked = True, MultiSelect = True, Name = False, OnActionPerformed = True, OnAdjustmentValueChanged = True, OnFocusGained = True, OnFocusLost = True, OnItemStateChanged = True, OnKeyPressed = True, @@ -1913,7 +1913,7 @@ class SFDialogs: OnMouseReleased = True, OnNodeExpanded = True, OnNodeSelected = True, OnTextChanged = True, Page = True, Parent = False, Picture = True, RootNode = False, RowSource = True, Text = False, TipText = True, - TripleState = True, Value = True, Visible = True, + TripleState = True, Value = True, Visible = True, Width = True, X = True, Y = True, XControlModel = False, XControlView = False, XGridColumnModel = False, XGridDataModel = False, XTreeDataModel = False) @@ -1938,6 +1938,9 @@ class SFDialogs: def FindNode(self, displayvalue, datavalue = ScriptForge.cstSymEmpty, casesensitive = False): return self.ExecMethod(self.vbMethod + self.flgUno, 'FindNode', displayvalue, datavalue, casesensitive) +def Resize(self, left = -1, top = -1, width = -1, height = -1): +return self.ExecMethod(self.vbMethod, 'Resize', left, top, width, height) + def SetFocus(self): return self.ExecMethod(self.vbMethod, 'SetFocus') diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 430b29d20b57..01c6d83cf982 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -74,7 +74,7 @@ Private _DialogModel As Object com.sun.star.awt.XControlModel - stardiv Private _Displayed As Boolean True after Execute() Private _Modal As Boolean Set by Execute() - Dialog position and dimensions + Dialog position and dimensions in pixels Private _Left As Long Private _Top As Long Private _Width As Long @@ -885,7 +885,7 @@ Public Function Resize(Optional ByVal Left As Variant _ , Optional ByVal Height As Variant _ ) As Boolean Move the top-left corner of a dialog to new coordinates and/or modify its dimensions - All distances are expressed in 1/100 mm. + All distances are expressed in pixels. Without arguments, the method resets the initial dimensions Args: Left : the horizontal distance from the top-left corner @@ -932,10 +932,10 @@ Try:
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogControl.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bb739dbcfc4e9b6467d09fc624ab618a4279cffe Author: Andrea Gelmini AuthorDate: Tue Mar 14 14:20:10 2023 +0100 Commit: Julien Nabet CommitDate: Tue Mar 14 15:20:01 2023 + Fix typo Change-Id: Ie7b0692c5f79eb4e8022ac1bcedfe01b3f7b75f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148878 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index d7fd10ebd5ea..d1417eb2a652 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -87,7 +87,7 @@ Private _ActionListener As Object com.sun.star.awt.XActionListener Private _OnActionPerformed As StringScript to invoke when action triggered Private _ActionCounter As Integer Counts the number of events set on the listener --- -Private _AdjustmentListenerAs Strung com.sun.star.awt.XAdjustmentListener +Private _AdjustmentListenerAs Object com.sun.star.awt.XAdjustmentListener Private _OnAdjustmentValueChanged As String Script to invoke when scrollbar value has changed Private _AdjustmentCounter As Integer Counts the number of events set on the listener ---
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogControl.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8eed6f0bea900368e7e2468990504b8b3eaeb60c Author: Andrea Gelmini AuthorDate: Tue Mar 14 14:19:24 2023 +0100 Commit: Julien Nabet CommitDate: Tue Mar 14 14:04:01 2023 + Fix typo Change-Id: I3c7b644de7b6e6bf46161a33f56eb89df662777c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148876 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index 081885301bf7..d7fd10ebd5ea 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -1238,7 +1238,7 @@ Try: _GridColumnModel.removeColumn(i) Next i - LBounds, UBounds - Basic or Pytho + LBounds, UBounds - Basic or Python iDims = ScriptForge.SF_Array.CountDims(DataArray) Select Case iDims Case -1, 0 : GoTo Catch
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_DialogListener.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 048f08e7086f74883e83d24628085690c2305df9 Author: Andrea Gelmini AuthorDate: Tue Mar 14 14:19:45 2023 +0100 Commit: Julien Nabet CommitDate: Tue Mar 14 14:03:14 2023 + Fix typo Change-Id: I9a46298fe53880cd84aa1cb9713e576eece3d2f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148877 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdialogs/SF_DialogListener.xba b/wizards/source/sfdialogs/SF_DialogListener.xba index e2c62236a22b..77e7f45ba4dc 100644 --- a/wizards/source/sfdialogs/SF_DialogListener.xba +++ b/wizards/source/sfdialogs/SF_DialogListener.xba @@ -48,7 +48,7 @@ REM Public Sub _SFEXP_requestChildNodes(Optional ByRef poEvent As Object) Triggered by the OnNodeExpanded event of a tree control The event is triggered thru a com.sun.star.view.XTreeExpansionListener - The argument is passed to a user routine sstored in the SF_DialogControl instance + The argument is passed to a user routine stored in the SF_DialogControl instance as a scripting framework URI Dim oControl As Object The SF_DialogControl object having triggered the event
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_UI.xba |2 wizards/source/scriptforge/python/scriptforge.py | 20 - wizards/source/sfdialogs/SF_Dialog.xba | 160 +++- wizards/source/sfdialogs/SF_DialogControl.xba| 198 ++ wizards/source/sfdialogs/SF_DialogListener.xba | 446 ++- wizards/source/sfwidgets/SF_Toolbar.xba |4 6 files changed, 798 insertions(+), 32 deletions(-) New commits: commit 0483b0a4bbd41f026a53ff35ab3162b57bee1a91 Author: Jean-Pierre Ledure AuthorDate: Mon Mar 13 18:22:26 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Tue Mar 14 10:46:15 2023 + ScriptForge (SFDialogs) make On properties editable A dialog box and its controls may be associated with scripts triggered by events (mouse moved, key pressed, ...). The link is usually preset in the Basic IDE when the dialog is designed. So far, ScriptForge did not offer the setting of a link event-script by code. The actual commit removes this limitation: every On-property related to either a dialog or a dialog control is now editbale. With the important precision that such a property may be updated ONLY IF it was NOT PRESET in the Basic IDE. Static (IDE) and dynamic (by code) definition of a specific On property on a specific dialog or on a specific dialog control are mutually exclusive. The new capacity may be used both in Basic and Python scripts. A short update of the help texts (dialog and dialogcontrol) is needed with mention of above restriction. Change-Id: Ia078aaab317ced7ade7ce69694504013f8e768a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148800 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_UI.xba b/wizards/source/scriptforge/SF_UI.xba index 392eeb29a64d..3bde6c22e4ac 100644 --- a/wizards/source/scriptforge/SF_UI.xba +++ b/wizards/source/scriptforge/SF_UI.xba @@ -1506,4 +1506,4 @@ Private Function _Repr() As String End Function ScriptForge.SF_UI._Repr REM END OF SCRIPTFORGE.SF_UI - + \ No newline at end of file diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 7208ff81cda6..531b0da1e6be 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1840,10 +1840,10 @@ class SFDialogs: servicename = 'SFDialogs.Dialog' servicesynonyms = ('dialog', 'sfdialogs.dialog') serviceproperties = dict(Caption = True, Height = True, Modal = False, Name = False, - OnFocusGained = False, OnFocusLost = False, OnKeyPressed = False, - OnKeyReleased = False, OnMouseDragged = False, OnMouseEntered = False, - OnMouseExited = False, OnMouseMoved = False, OnMousePressed = False, - OnMouseReleased = False, + OnFocusGained = True, OnFocusLost = True, OnKeyPressed = True, + OnKeyReleased = True, OnMouseDragged = True, OnMouseEntered = True, + OnMouseExited = True, OnMouseMoved = True, OnMousePressed = True, + OnMouseReleased = True, Page = True, Visible = True, Width = True, XDialogModel = False, XDialogView = False) # Class constants used together with the Execute() method OKBUTTON, CANCELBUTTON = 1, 0 @@ -1906,12 +1906,12 @@ class SFDialogs: serviceproperties = dict(Cancel = True, Caption = True, ControlType = False, CurrentNode = True, Default = True, Enabled = True, Format = True, ListCount = False, ListIndex = True, Locked = True, MultiSelect = True, Name = False, - OnActionPerformed = False, OnAdjustmentValueChanged = False, OnFocusGained = False, - OnFocusLost = False, OnItemStateChanged = False, OnKeyPressed = False, - OnKeyReleased = False, OnMouseDragged = False, OnMouseEntered = False, - OnMouseExited = False, OnMouseMoved = False, OnMousePressed = False, - OnMouseReleased = False, OnNodeExpanded = True, OnNodeSelected = True, - OnTextChanged = False, Page = True, Parent = False, Picture = True, + OnActionPerformed = True, OnAdjustmentValueChanged = True, OnFocusGained = True, + OnFocusLost = True, OnItemStateChanged = True, OnKeyPressed = True, +
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfwidgets/SF_Toolbar.xba |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f8efe70aa2799622c12e27dbff70c7f12fe4b3e7 Author: Andrea Gelmini AuthorDate: Tue Feb 28 21:03:16 2023 +0100 Commit: Julien Nabet CommitDate: Wed Mar 1 05:50:03 2023 + Fix typo Change-Id: I53e2a2f57ca1f00a07c62918e6e34c57a53fdcf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148022 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfwidgets/SF_Toolbar.xba b/wizards/source/sfwidgets/SF_Toolbar.xba index e53d52306f4b..d65e7c61db06 100644 --- a/wizards/source/sfwidgets/SF_Toolbar.xba +++ b/wizards/source/sfwidgets/SF_Toolbar.xba @@ -154,7 +154,7 @@ End Property SFWidgets.SF_Toolbar.Name (get) REM - Property Get ResourceURL() As String - Returns True when the toolbar is avaialble in all documents of the same type + Returns True when the toolbar is available in all documents of the same type Example: MsgBox myToolbar.ResourceURL
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfwidgets/SF_Toolbar.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f0ad08ab845d87f04f7b6c0b48e872252810435f Author: Andrea Gelmini AuthorDate: Tue Feb 28 21:02:35 2023 +0100 Commit: Julien Nabet CommitDate: Wed Mar 1 05:49:39 2023 + Fix typo Change-Id: I7a1302f472473171b31a4c2b21c9bfbfe1517904 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148020 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfwidgets/SF_Toolbar.xba b/wizards/source/sfwidgets/SF_Toolbar.xba index 16089e485f1b..e53d52306f4b 100644 --- a/wizards/source/sfwidgets/SF_Toolbar.xba +++ b/wizards/source/sfwidgets/SF_Toolbar.xba @@ -350,7 +350,7 @@ Private Sub _CollectAllButtons() Dim oElement As Object com.sun.star.ui.XUIElement Dim oSettings As Object com.sun.star.container.XIndexAccess -Dim vProperties() As Variant Array of property alues +Dim vProperties() As Variant Array of property values Dim iType As Integer Separators have type = 1, others have Type = 0 Dim oAccessible As Object com.sun.star.accessibility.XAccessible Dim sLabel As String Label in static description @@ -538,4 +538,4 @@ Private Function _Repr() As String End Function SFWidgets.SF_Toolbar._Repr REM END OF SFWIDGETS.SF_TOOLBAR - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_UI.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 78670b9dcb64e515712c6b1d411ad30478f9abb4 Author: Andrea Gelmini AuthorDate: Tue Feb 28 21:02:56 2023 +0100 Commit: Julien Nabet CommitDate: Wed Mar 1 05:49:06 2023 + Fix typo Change-Id: Ib620227c38d27d3de1a774f9c3aebfbcc5edd0a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148021 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/scriptforge/SF_UI.xba b/wizards/source/scriptforge/SF_UI.xba index b01f6131e7f9..392eeb29a64d 100644 --- a/wizards/source/scriptforge/SF_UI.xba +++ b/wizards/source/scriptforge/SF_UI.xba @@ -1425,7 +1425,7 @@ Try: .UIName = sUIName Set .UIConfigurationManager = oUIConfigMgr .ElementsInfoIndex = i - Distinguish builtin and custom toolbars stored in the applcation + Distinguish builtin and custom toolbars stored in the application If SF_String.StartsWith(sBarName, cstCUSTOM, CaseSensitive := True) Then .Storage = cstCUSTOMTOOLBAR sBarName = Mid(sBarName, Len(cstCUSTOM) + 1) @@ -1506,4 +1506,4 @@ Private Function _Repr() As String End Function ScriptForge.SF_UI._Repr REM END OF SCRIPTFORGE.SF_UI - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |3 wizards/source/sfdocuments/SF_Calc.xba |7 ++ wizards/source/sfdocuments/SF_Document.xba | 73 +++ wizards/source/sfdocuments/SF_FormDocument.xba |7 ++ wizards/source/sfdocuments/SF_Writer.xba |7 ++ 5 files changed, 97 insertions(+) New commits: commit 96302e0bbadfe3ed33af4a14a33a44bab3f5f0d4 Author: Jean-Pierre Ledure AuthorDate: Fri Jan 27 16:39:42 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Fri Jan 27 16:54:19 2023 + ScriptForge (SF_Document) Echo() method freezes screen updates While a script is executed any display update resulting from that execution is done immediately. For performance reasons it might be an advantage to differ the display updates up to the end of the script. This is where pairs of Echo() methods to set and reset the removal of the immediate updates may be beneficial. Optionally the actual mouse pointer can be modified to the image of an hourglass. Arguments: EchoOn: when False, the display updates are suspended. Default = True. Multiple calls with EchoOn = False are harmless. Hourglass: when True, the mouse pointer is changed to an hourglass. Default = False. The mouse pointer needs to be inside the actual document's window. Note that it is very likely that at the least manual movement of the mouse, the operating system or the LibreOffice process will take back the control of the mouse icon and its usual behaviour. The method may be called from any document, including Calc and Writer, or form document. It may be invoked from Basic and Python user scripts. Echo() should be documented in the sfdocument.xhp help page. Change-Id: I4d669f5e332131bd1b2efcd33b7a98b304796ad1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146258 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 7abd8ff67716..a67dca437fd1 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1993,6 +1993,9 @@ class SFDocuments: def CreateMenu(self, menuheader, before = '', submenuchar = '>'): return self.ExecMethod(self.vbMethod, 'CreateMenu', menuheader, before, submenuchar) +def Echo(self, echoon = True, hourglass = False): +return self.ExecMethod(self.vbMethod, 'Echo', echoon, hourglass) + def ExportAsPDF(self, filename, overwrite = False, pages = '', password = '', watermark = ''): return self.ExecMethod(self.vbMethod, 'ExportAsPDF', filename, overwrite, pages, password, watermark) diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index bba5ebdf5b2e..dfd66fb5a2bf 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -3718,6 +3718,13 @@ Public Function CreateMenu(Optional ByVal MenuHeader As Variant _ Set CreateMenu = [_Super].CreateMenu(MenuHeader, Before, SubmenuChar) End Function SFDocuments.SF_Calc.CreateMenu +REM - +Public Sub Echo(Optional ByVal EchoOn As Variant _ + , Optional ByVal Hourglass As Variant _ + ) + [_Super].Echo(EchoOn, Hourglass) +End Sub SFDocuments.SF_Calc.Echo + REM - Public Function ExportAsPDF(Optional ByVal FileName As Variant _ , Optional ByVal Overwrite As Variant _ diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba index 03fb215369ea..879d90c0cfef 100644 --- a/wizards/source/sfdocuments/SF_Document.xba +++ b/wizards/source/sfdocuments/SF_Document.xba @@ -538,6 +538,78 @@ Catch: GoTo Finally End Function SFDocuments.SF_Document.CreateMenu +REM - +Public Sub Echo(Optional ByVal EchoOn As Variant _ + , Optional ByVal Hourglass As Variant _ + ) + While a script is executed any display update resulting from that execution + is done immediately. + For performance reasons it might be an advantage to differ the display updates + up to the end of the script. + This is where pairs of Echo() methods to set and reset the removal of
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Calc.xba | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) New commits: commit 9079d15ec54928e1e7d5596e148d0f9aefe81bd6 Author: Jean-Pierre Ledure AuthorDate: Wed Jan 25 15:26:10 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Thu Jan 26 11:22:37 2023 + ScriptForge (SF_Calc) more accurate comments Impact only on comments, code left unchanged Change-Id: I5549f2549d2b9ff351ad6174b9dba458525db210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146139 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index 8169ae2e188c..bba5ebdf5b2e 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -29,6 +29,7 @@ Option Explicit The SF_Calc module is focused on : - management (copy, insert, move, ...) of sheets within a Calc document - exchange of data between Basic data structures and Calc ranges of values + - copying and importing massive amounts of data The current module is closely related to the UI service of the ScriptForge library @@ -63,9 +64,9 @@ Option Explicit or an object produced by .Range() The sheet name is optional (default = active sheet). Surrounding quotes and $ signs are optional ~.~, ~ The current selection in the active sheet - $SheetX.D2 or $D$2 A single cell - $SheetX.D2:F6, D2:D10 Multiple cells - $SheetX.A:A or 3:5 All cells in the same column or row up to the last active cell + $SheetX.D2 or $D$2 A single cell + $SheetX.D2:F6, D2:D10 Multiple cells + $SheetX.A:A or 3:5 All cells in the same column or row up to the last active cell SheetX.* All cells up to the last active cell myRange A range name at spreadsheet level ~.yourRange, SheetX.someRange A range name at sheet level @@ -74,10 +75,10 @@ Option Explicit Several methods may receive a FilterFormula as argument. A FilterFormula may be associated with a FilterScope: row, column or cell. - These arguments determines on which rows/columns/cells of a range the method should be applied + These arguments determine on which rows/columns/cells of a range the method should be applied Examples: - oDoc.ClearAll(A1:J10, FilterFormula := =(A1=0), FilterScope := CELL) Clear all negative values - oDoc.ClearAll(A2:J10, FilterFormula := =(A2A1), FilterScope := COLUMN)Clear when identical to above cell + oDoc.ClearAll(A1:J10, FilterFormula := =(A1=0), FilterScope := CELL) Clear all negative values + oDoc.ClearAll(SheetX.A1:J10, =SUM(SheetX.A1:A10)100, COLUMN) Clear all columns whose sum is greater than 500 FilterFormula: a Calc formula that returns TRUE or FALSE the formula is expressed in terms of @@ -4372,8 +4373,8 @@ Private Function _ParseAddress(ByVal psAddress As String) As Object Parse and validate a sheet or range reference Syntax to parse: [Sheet].[Range] - Sheet = [][$]sheet[] or document named range or ~ - Range = A1:D10, A1, A:D, 10:10 ($ ignored), or sheet named range or ~ + Sheet = [$][]sheet[] or document named range or ~ + Range = A1:D10, A1, A:D, 10:10 ($ ignored), or sheet named range or ~ or * Returns: An object of type _Address Exceptions:
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdialogs/SF_Dialog.xba | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) New commits: commit bc8c1d45ac91a1b3855eec8358260a8720d4c081 Author: Jean-Pierre Ledure AuthorDate: Mon Jan 23 15:35:47 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Tue Jan 24 14:25:01 2023 + ScriptForge (SF_Dialog) define constants as properties OKBUTTON and CANCELBUTTON are defined in the help as properties, both for Basic and Python user scripts. To make dialog.OKBUTTON valid in Basic, OKBUTTON should be defined either as (1) Public Const OKBUTTON = 1 or (2) Property Get OKBUTTON() Actually, it if a Private constant. <= wrong Choice is made to make it a full property (2). Python equivalent is OK, no change required. No impact on help documentation. Change-Id: Id4cf7dfbaff68fc8cc48a5c4779374ce1e7cc88b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146008 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 507e5ac72c00..081584f56e81 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -99,8 +99,8 @@ Private _ControlCache As Variant Array of control objects sorted like E REM MODULE CONSTANTS Dialog usual buttons -Private Const OKBUTTON = 1 -Private Const CANCELBUTTON = 0 +Private Const cstOKBUTTON = 1 +Private Const cstCANCELBUTTON = 0 Page management Private Const PILOTCONTROL = 1 @@ -152,6 +152,11 @@ End Function SFDialogs.SF_Dialog Explicit Destructor REM == PROPERTIES +REM - +Property Get CANCELBUTTON() As Variant + CANCELBUTTON = cstCANCELBUTTON +End Property SFDialogs.SF_Dialog.CANCELBUTTON (get) + REM - Property Get Caption() As Variant The Caption property refers to the title of the dialog @@ -188,6 +193,11 @@ Property Get Name() As String Name = _PropertyGet(Name) End Property SFDialogs.SF_Dialog.Name +REM - +Property Get OKBUTTON() As Variant + OKBUTTON = cstOKBUTTON +End Property SFDialogs.SF_Dialog.OKBUTTON (get) + REM - Property Get OnFocusGained() As Variant Get the script associated with the OnFocusGained event
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Calc.xba |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 4525c47fa150bfc13b93763a3bce910623158810 Author: Jean-Pierre Ledure AuthorDate: Sun Jan 22 17:33:36 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Sun Jan 22 17:31:14 2023 + ScriptForge (SF_Calc) fix typo Change-Id: I086d4f9f6490ecce773aef598049af07b5f852d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145978 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index ac6976acf2de..8169ae2e188c 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -2665,7 +2665,7 @@ Try: sRowsRange = SetArray(Offset(sMirrorRange, , Width(sMirrorRange), 1, 1), vRows()) **Step 3: sort the mirrored data, including the row numbers column - sMirrorRange = $SF_WORK.$A$1:$K$100 + sFullMirrorRange = $SF_WORK.$A$1:$K$100 sFullMirrorRange = Offset(sMirrorRange, , , , Width(sMirrorRange) + 1) SortRange(sFullMirrorRange, SortKeys := Columns, CaseSensitive := CaseSensitive) @@ -4826,4 +4826,4 @@ CatchSheet: End Function SFDocuments.SF_Calc._ValidateSheetName REM END OF SFDOCUMENTS.SF_CALC - + \ No newline at end of file
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/SF_Utils.xba |2 +- wizards/source/scriptforge/po/ScriptForge.pot|4 ++-- wizards/source/scriptforge/po/en.po |4 ++-- wizards/source/scriptforge/po/pt.po |2 +- wizards/source/scriptforge/python/scriptforge.py |2 +- 5 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 3563f2064ab4b4772dd805a4acff9e541a723431 Author: Jean-Pierre Ledure AuthorDate: Sun Jan 22 16:23:00 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Sun Jan 22 16:27:39 2023 + ScriptForge Upgrade version number to 7.6 Change-Id: Ifbf5ba5b28b7afff64ed36965eadfa68a750cfd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145976 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index 91b703c46431..d01d66aa946f 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -21,7 +21,7 @@ REM = GLOBAL Global _SF_As VariantSF_Root (Basic) object) ScriptForge version -Const SF_Version = 7.4 +Const SF_Version = 7.6 Standard symbolic names for VarTypes V_EMPTY = 0 diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot index 894b9da3bbe0..e1eca9ae462f 100644 --- a/wizards/source/scriptforge/po/ScriptForge.pot +++ b/wizards/source/scriptforge/po/ScriptForge.pot @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.4 +# ScriptForge Release 7.6 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2022-10-12 15:07:35\n" +"POT-Creation-Date: 2023-01-22 15:34:36\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po index 894b9da3bbe0..e1eca9ae462f 100644 --- a/wizards/source/scriptforge/po/en.po +++ b/wizards/source/scriptforge/po/en.po @@ -7,14 +7,14 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.4 +# ScriptForge Release 7.6 # --- # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice_status=UNCONFIRMED=UI\n; -"POT-Creation-Date: 2022-10-12 15:07:35\n" +"POT-Creation-Date: 2023-01-22 15:34:36\n" "PO-Revision-Date: -MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/wizards/source/scriptforge/po/pt.po b/wizards/source/scriptforge/po/pt.po index 3069dc87e0b3..316956c431c4 100644 --- a/wizards/source/scriptforge/po/pt.po +++ b/wizards/source/scriptforge/po/pt.po @@ -7,7 +7,7 @@ # *** are part of the LibreOffice project. *** # * # -# ScriptForge Release 7.4 +# ScriptForge Release 7.6 # --- # msgid "" diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index f368198be7e2..7abd8ff67716 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -103,7 +103,7 @@ class ScriptForge(object, metaclass = _Singleton): # Class constants # # library = 'ScriptForge' -Version = '7.4' # Actual version number +Version = '7.6' # Actual version number # # Basic dispatcher for Python scripts basicdispatcher = '@application#ScriptForge.SF_PythonHelper._PythonDispatcher'
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Calc.xba |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit ebf6bf0e32d3b937be2d950591d3abffde135b14 Author: Andrea Gelmini AuthorDate: Sat Jan 21 20:41:36 2023 +0100 Commit: Julien Nabet CommitDate: Sat Jan 21 21:10:32 2023 + Fix typos Change-Id: Ie6dcedee4a1202f43feee99169172e2a3b1523b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145959 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index a6dce33f9d6a..ac6976acf2de 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -2645,7 +2645,7 @@ Check: End If Try: - Lets assume the initial range is $Sheet1.$B$11:$K$110 (100 rows, 10 clumns, no header) + Lets assume the initial range is $Sheet1.$B$11:$K$110 (100 rows, 10 columns, no header) Ignore header, consider only the effective data If Header Then Set oRangeAddress = _Offset(Range, 1, 0, Height(Range) - 1, 0) Else Set oRangeAddress = _ParseAddress(Range) @@ -2653,7 +2653,7 @@ Try: lRandom = ScriptForge.SF_Session.ExecuteCalcFunction(RANDBETWEEN.NV, 1, 99) sWorkSheet = SF_WORK_ Right(00 lRandom, 6) InsertSheet(sWorkSheet) - sMurrorRange = $SF_WORK.$A$1:$J$100 + sMirrorRange = $SF_WORK.$A$1:$J$100 sMirrorRange = CopyToCell(oRangeAddress, $ sWorkSheet .$A$1) **Step 2: add a column in the mirror with the row numbers in the initial range @@ -4826,4 +4826,4 @@ CatchSheet: End Function SFDocuments.SF_Calc._ValidateSheetName REM END OF SFDOCUMENTS.SF_CALC - \ No newline at end of file +
[Libreoffice-commits] core.git: wizards/source
wizards/source/scriptforge/python/scriptforge.py |3 wizards/source/sfdocuments/SF_Calc.xba | 126 +++ 2 files changed, 129 insertions(+) New commits: commit ac21a5ee9b51ab771736a2695426196f2f663c34 Author: Jean-Pierre Ledure AuthorDate: Sat Jan 21 16:43:39 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Sat Jan 21 16:48:19 2023 + ScriptForge (SF_Calc) new RemoveDuplicates() method Remove duplicate values from a range of values. The comparison between rows is done on a subset of the columns in the range. The resulting range replaces the input range, in which, either: all duplicate rows are cleared from their content all duplicate rows are suppressed and rows below are pushed upwards. Anyway, the first copy of each set of duplicates is kept and the initial sequence is preserved. Arguments of the method: Range: the range, as a string, from which the duplicate rows should be removed Columns: an array of column numbers to compare; items are in the interval [1 .. range width] Default = the first column in the range Header: when True, the first row is a header row. Default = False. CaseSensitive: for string comparisons. Default = False. Mode: either "CLEAR" or "COMPACT" (Default) For large ranges, the "COMPACT" mode is probably significantly slower. The method has been implemented for Basic and Python user scripts. The calc.xhp help page should be updated accordingly. Change-Id: I352b2f3da98974d9482575850550cec4e27d2e01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145954 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index a15261caed58..f368198be7e2 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -2263,6 +2263,9 @@ class SFDocuments: def PrintOut(self, sheetname = '~', pages = '', copies = 1): return self.ExecMethod(self.vbMethod, 'PrintOut', sheetname, pages, copies) +def RemoveDuplicates(self, range, columns = 1, header = False, casesensitive = False, mode = 'COMPACT'): +return self.ExecMethod(self.vbMethod, 'RemoveDuplicates', range, columns, header, casesensitive, mode) + def RemoveSheet(self, sheetname): return self.ExecMethod(self.vbMethod, 'RemoveSheet', sheetname) diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index f2c9fc34e2f2..a6dce33f9d6a 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -2111,6 +2111,7 @@ Public Function Methods() As Variant , OpenRangeSelector _ , Printf _ , PrintOut _ + , RemoveDuplicates _ , RemoveSheet _ , RenameSheet _ , SetArray _ @@ -2582,6 +2583,131 @@ Public Function Properties() As Variant End Function SFDocuments.SF_Calc.Properties +REM - +Public Function RemoveDuplicates(Optional ByVal Range As Variant _ + , Optional ByVal Columns As Variant _ + , Optional ByVal Header As Variant _ + , Optional ByVal CaseSensitive As Variant _ + , Optional ByVal Mode As Variant _ + ) As String + Remove duplicate values from a range of values. + The comparison between rows is done on a subset of the columns in the range. + The resulting range replaces the input range, in which, either: + all duplicate rows are cleared from their content + all duplicate rows are suppressed and rows below are pushed upwards. + Anyway, the first copy of each set of duplicates is kept and the initial sequence is preserved. + Args: + Range: the range, as a string, from which the duplicate rows should be removed + Columns: an array of column numbers to compare; items are in the interval [1 .. range width] + Default = the first column in the range + Header: when True, the first row is a header row.
[Libreoffice-commits] core.git: wizards/source
wizards/source/sfdocuments/SF_Calc.xba | 97 + 1 file changed, 62 insertions(+), 35 deletions(-) New commits: commit 40bc1b275324f9a730960fe5d4d8982cdfbc7b03 Author: Jean-Pierre Ledure AuthorDate: Tue Jan 17 18:13:48 2023 +0100 Commit: Jean-Pierre Ledure CommitDate: Wed Jan 18 14:18:40 2023 + ScriptForge - (SF_Calc) sort ranges on more than 3 keys The Calc.SortRange() method sorts the given range on any number of columns/rows. The sorting order may vary by column/row. The sorting algorithm allows for maximum 3 keys. When the number of sort keys is > 3 then the range is sorted several times, by groups of 3 keys, starting from the last key. In this context the algorithm used by Calc to sort ranges is presumed STABLE, i.e. it maintains the relative order of records with equal keys. Change-Id: If7f4920f7ab8f8ffb71edf648ed9accc8eb62dce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145681 Tested-by: Jean-Pierre Ledure Reviewed-by: Jean-Pierre Ledure Tested-by: Jenkins diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index 391321f361d8..f2c9fc34e2f2 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -1084,7 +1084,7 @@ Const cstSubArgs = SourceRange, DestinationRange If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo Catch sCopy = -Check: +Check:string If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then If Not _IsStillAlive(True) Then GoTo Finally If Not ScriptForge.SF_Utils._Validate(SourceRange, SourceRange, Array(V_STRING, ScriptForge.V_OBJECT), , , CALCREFERENCE) Then GoTo Finally @@ -3305,7 +3305,11 @@ Public Function SortRange(Optional ByVal Range As Variant _ , Optional ByVal CaseSensitive As Variant _ , Optional ByVal SortColumns As Variant _ ) As Variant - Sort the given range on maximum 3 columns/rows. The sorting order may vary by column/row + Sort the given range on any number of columns/rows. The sorting order may vary by column/row + If the number of sort keys is 3 then the range is sorted several times, by groups of 3 keys, + starting from the last key. In this context the algorithm used by Calc to sort ranges + is presumed STABLE, i.e. it maintains the relative order of records with equal keys. + Args: Range: the range to sort as a string SortKeys: a scalar (if 1 column/row) or an array of column/row numbers starting from 1 @@ -3329,13 +,19 @@ Public Function SortRange(Optional ByVal Range As Variant _ Dim sSort As String Return value Dim oRangeAddress As _AddressParsed range Dim oRange As Object com.sun.star.table.XCellRange +Dim oSortRange As Object The area to sort as an _Address object Dim oDestRange As Object Destination as a range Dim oDestAddress As Object com.sun.star.table.CellRangeAddress Dim oDestCell As Object com.sun.star.table.CellAddress Dim vSortDescriptor As Variant Array of com.sun.star.beans.PropertyValue Dim vSortFields As Variant Array of com.sun.star.table.TableSortField Dim sOrder As String Item in SortOrder -Dim i As Long +Dim lSort As LongCounter for sub-sorts +Dim lKeys As LongUBound of SortKeys +Dim lKey As Long Actual index in SortKeys +Dim i As Long, j As Long +Const cstMaxKeys = 3 Maximum number of keys allowed in a single sorting step + Const cstThisSub = SFDocuments.Calc.SortRange Const cstSubArgs = Range, SortKeys, [TargetRange=], [SortOrder=ASC], [DestinationCell=], [ContainsHeader=False], [CaseSensitive=False], [SortColumns=False] @@ -3368,47 +3378,64 @@ Check: If Not ScriptForge.SF_Utils._Validate(SortColumns, SortColumns, ScriptForge.V_BOOLEAN) Then GoTo Finally End If Set oRangeAddress = _ParseAddress(Range) - If Len(DestinationCell) 0 Then Set oDestRange = _ParseAddress(DestinationCell) + If Len(DestinationCell) 0 Then Set oDestRange = _ParseAddress(DestinationCell) Else Set oDestRange = Nothing Try: - Initialize the sort descriptor + Initialize a generic sort descriptor Set oRange = oRangeAddress.XCellRange - vSortDescriptor = oRange.createSortDescriptor +