summaryrefslogtreecommitdiff
path: root/wizards/source/scriptforge
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2020-12-16 17:34:04 +0100
committerJean-Pierre Ledure <jp@ledure.be>2020-12-17 08:56:47 +0100
commite6915d4be4d576fdfd4d612c7968f493edba62c5 (patch)
tree9570a04759820be5180df2e57ca4c91ecc83483e /wizards/source/scriptforge
parent11382ccf2ff58ba470dfa604654685730e0411f8 (diff)
ScriptForge - (SFDocuments) Introduce form class
New SF_Form class in SFDocuments library Support for Writer, Calc and Base forms Skeleton of Form class module Forms() methods in Calc, Base and Document modules to create a new instance New error messages in po file Change-Id: Id78a4604caf61901d87750026be45cef8f74f110 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107848 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards/source/scriptforge')
-rw-r--r--wizards/source/scriptforge/SF_Exception.xba18
-rw-r--r--wizards/source/scriptforge/SF_Root.xba38
-rw-r--r--wizards/source/scriptforge/SF_Utils.xba2
-rw-r--r--wizards/source/scriptforge/po/ScriptForge.pot65
-rw-r--r--wizards/source/scriptforge/po/en.po65
5 files changed, 180 insertions, 8 deletions
diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba
index 5a04fc0bca29..c3f9c96dc93a 100644
--- a/wizards/source/scriptforge/SF_Exception.xba
+++ b/wizards/source/scriptforge/SF_Exception.xba
@@ -104,6 +104,12 @@ Const CALCADDRESSERROR = &quot;CALCADDRESSERROR&quot;
Const DUPLICATESHEETERROR = &quot;DUPLICATESHEETERROR&quot;
Const OFFSETADDRESSERROR = &quot;OFFSETADDRESSERROR&quot;
+&apos; SF_Form
+Const FORMDEADERROR = &quot;FORMDEADERROR&quot;
+Const CALCFORMNOTFOUNDERROR = &quot;CALCFORMNOTFOUNDERROR&quot;
+Const WRITERFORMNOTFOUNDERROR = &quot;WRITERFORMNOTFOUNDERROR&quot;
+Const BASEFORMNOTFOUNDERROR = &quot;BASEFORMNOTFOUNDERROR&quot;
+
&apos; SF_Dialog
Const DIALOGNOTFOUNDERROR = &quot;DIALOGNOTFOUNDERROR&quot;
Const DIALOGDEADERROR = &quot;DIALOGDEADERROR&quot;
@@ -824,6 +830,18 @@ Try:
sMessage = sLocation _
&amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;OFFSETADDRESS&quot;, pvArgs(0), pvArgs(1), pvArgs(2), pvArgs(3), pvArgs(4) _
, pvArgs(5), pvArgs(6), pvArgs(7), pvArgs(8), pvArgs(9), pvArgs(10), pvArgs(11))
+ Case FORMDEADERROR &apos; SF_Form._IsStillAlive(FormName, DocumentName)
+ sMessage = sLocation _
+ &amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;FORMDEAD&quot;, pvArgs(0), pvArgs(1))
+ Case CALCFORMNOTFOUNDERROR &apos; SF_Calc.Forms(Index, SheetName, Document)
+ sMessage = sLocation _
+ &amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;CALCFORMNOTFOUND&quot;, pvArgs(0), pvArgs(1), pvArgs(2))
+ Case WRITERFORMNOTFOUNDERROR &apos; SF_Document.Forms(Index, Document)
+ sMessage = sLocation _
+ &amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;WRITERFORMNOTFOUND&quot;, pvArgs(0), pvArgs(1))
+ Case BASEFORMNOTFOUNDERROR &apos; SF_Base.Forms(Index, FormDocument, BaseDocument)
+ sMessage = sLocation _
+ &amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;BASEFORMNOTFOUND&quot;, pvArgs(0), pvArgs(1), pvArgs(2))
Case DIALOGNOTFOUNDERROR &apos; SF_Dialog._NewDialog(Service, DialogName, WindowName)
sMessage = sLocation _
&amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;DIALOGNOTFOUND&quot;, pvArgs(0), pvArgs(1), pvArgs(2), pvArgs(3), pvArgs(4) _
diff --git a/wizards/source/scriptforge/SF_Root.xba b/wizards/source/scriptforge/SF_Root.xba
index 74154285f551..07ec5acfca8d 100644
--- a/wizards/source/scriptforge/SF_Root.xba
+++ b/wizards/source/scriptforge/SF_Root.xba
@@ -725,6 +725,44 @@ Try:
&amp; &quot;%11: An identifier\n&quot; _
&amp; &quot;%12: A file name&quot; _
)
+ &apos; SF_Form._IsStillAlive
+ .AddText( Context := &quot;FORMDEAD&quot; _
+ , MsgId := &quot;The requested action could not be executed because the form is not open or the document was closed inadvertently.\n\n&quot; _
+ &amp; &quot;The concerned form is &apos;%1&apos; in document &apos;%2&apos;.&quot; _
+ , Comment := &quot;SF_Dialog._IsStillAlive error message\n&quot; _
+ &amp; &quot;%1: An identifier&quot; _
+ &amp; &quot;%2: A file name&quot; _
+ )
+ &apos; SF_Calc.Forms
+ .AddText( Context := &quot;CALCFORMNOTFOUND&quot; _
+ , MsgId := &quot;The requested form could not be found in the Calc sheet. The given index is off-limits.\n\n&quot; _
+ &amp; &quot;The concerned Calc document is &apos;%3&apos;.\n\n&quot; _
+ &amp; &quot;The name of the sheet = &apos;%2&apos;\n&quot; _
+ &amp; &quot;The index = %1&quot; _
+ , Comment := &quot;SF_Form determination\n&quot; _
+ &amp; &quot;%1: A number\n&quot; _
+ &amp; &quot;%2: A sheet name\n&quot; _
+ &amp; &quot;%3: A file name&quot; _
+ )
+ &apos; SF_Document.Forms
+ .AddText( Context := &quot;WRITERFORMNOTFOUND&quot; _
+ , MsgId := &quot;The requested form could not be found in the Writer document. The given index is off-limits.\n\n&quot; _
+ &amp; &quot;The concerned Writer document is &apos;%2&apos;.\n\n&quot; _
+ &amp; &quot;The index = %1&quot; _
+ , Comment := &quot;SF_Form determination\n&quot; _
+ &amp; &quot;%1: A number\n&quot; _
+ &amp; &quot;%2: A file name&quot; _
+ )
+ &apos; SF_Base.Forms
+ .AddText( Context := &quot;BASEFORMNOTFOUND&quot; _
+ , MsgId := &quot;The requested form could not be found in the form document &apos;%2&apos;. The given index is off-limits.\n\n&quot; _
+ &amp; &quot;The concerned Base document is &apos;%3&apos;.\n\n&quot; _
+ &amp; &quot;The index = %1&quot; _
+ , Comment := &quot;SF_Form determination\n&quot; _
+ &amp; &quot;%1: A number\n&quot; _
+ &amp; &quot;%2: A string\n&quot; _
+ &amp; &quot;%3: A file name&quot; _
+ )
&apos; SF_Dialog._NewDialog
.AddText( Context := &quot;DIALOGNOTFOUND&quot; _
, MsgId := &quot;The requested dialog could not be located in the given container or library.\n&quot; _
diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba
index 80c939b697bd..22ad2dbceaab 100644
--- a/wizards/source/scriptforge/SF_Utils.xba
+++ b/wizards/source/scriptforge/SF_Utils.xba
@@ -226,6 +226,8 @@ Dim sHeader As String &apos; The specific header to insert
Try:
With _SF_
+ If Not IsNull(.Interface) Then .Interface.Dispose()
+ ._LoadLocalizedInterface(psMode := &quot;ADDTEXT&quot;) &apos; Force reload of labels from the code
.Interface.ExportToPOTFile(FileName, Header := sHeader)
End With
diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot
index ea7209881cb7..9e39b5da6896 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&bug_status=UNCONFIRMED&component=UI\n"
-"POT-Creation-Date: 2020-12-06 12:16:30\n"
+"POT-Creation-Date: 2020-12-15 15:57:29\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -465,7 +465,7 @@ msgstr ""
#. SF_Session.ExecuteBasicScript error message
#. %1: An identifier
#. %2: A string
-#. %3: A number
+#. %3: A (long) string
#, kde-format
msgctxt "SCRIPTEXEC"
msgid ""
@@ -726,6 +726,62 @@ msgid ""
"« %11 » = %12"
msgstr ""
+#. SF_Dialog._IsStillAlive error message
+#. %1: An identifier%2: A file name
+#, kde-format
+msgctxt "FORMDEAD"
+msgid ""
+"The requested action could not be executed because the form is not "
+"open or the document was closed inadvertently.\n"
+"\n"
+"The concerned form is '%1' in document '%2'."
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A sheet name
+#. %3: A file name
+#, kde-format
+msgctxt "CALCFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the Calc sheet. The given "
+"index is off-limits.\n"
+"\n"
+"The concerned Calc document is '%3'.\n"
+"\n"
+"The name of the sheet = '%2'\n"
+"The index = %1"
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A file name
+#, kde-format
+msgctxt "WRITERFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the Writer document. The "
+"given index is off-limits.\n"
+"\n"
+"The concerned Writer document is '%2'.\n"
+"\n"
+"The index = %1"
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A string
+#. %3: A file name
+#, kde-format
+msgctxt "BASEFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the form document '%2'. The "
+"given index is off-limits.\n"
+"\n"
+"The concerned Base document is '%3'.\n"
+"\n"
+"The index = %1"
+msgstr ""
+
#. SF_Dialog creation
#. %1: An identifier
#. %2: A string
@@ -766,7 +822,8 @@ msgstr ""
msgctxt "CONTROLTYPE"
msgid ""
"The control '%1' in dialog '%2' is of type '%3'.\n"
-"The property or method '%4' is not applicable on that type of dialog controls."
+"The property or method '%4' is not applicable on that type of dialog "
+"controls."
msgstr ""
#. SF_DialogControl add line in textbox
@@ -798,4 +855,4 @@ msgid ""
"Check its syntax, table and/or field names, ...\n"
"\n"
"SQL Statement : « %1 »"
-msgstr ""
+msgstr "" \ No newline at end of file
diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po
index ea7209881cb7..9e39b5da6896 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&bug_status=UNCONFIRMED&component=UI\n"
-"POT-Creation-Date: 2020-12-06 12:16:30\n"
+"POT-Creation-Date: 2020-12-15 15:57:29\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -465,7 +465,7 @@ msgstr ""
#. SF_Session.ExecuteBasicScript error message
#. %1: An identifier
#. %2: A string
-#. %3: A number
+#. %3: A (long) string
#, kde-format
msgctxt "SCRIPTEXEC"
msgid ""
@@ -726,6 +726,62 @@ msgid ""
"« %11 » = %12"
msgstr ""
+#. SF_Dialog._IsStillAlive error message
+#. %1: An identifier%2: A file name
+#, kde-format
+msgctxt "FORMDEAD"
+msgid ""
+"The requested action could not be executed because the form is not "
+"open or the document was closed inadvertently.\n"
+"\n"
+"The concerned form is '%1' in document '%2'."
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A sheet name
+#. %3: A file name
+#, kde-format
+msgctxt "CALCFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the Calc sheet. The given "
+"index is off-limits.\n"
+"\n"
+"The concerned Calc document is '%3'.\n"
+"\n"
+"The name of the sheet = '%2'\n"
+"The index = %1"
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A file name
+#, kde-format
+msgctxt "WRITERFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the Writer document. The "
+"given index is off-limits.\n"
+"\n"
+"The concerned Writer document is '%2'.\n"
+"\n"
+"The index = %1"
+msgstr ""
+
+#. SF_Form determination
+#. %1: A number
+#. %2: A string
+#. %3: A file name
+#, kde-format
+msgctxt "BASEFORMNOTFOUND"
+msgid ""
+"The requested form could not be found in the form document '%2'. The "
+"given index is off-limits.\n"
+"\n"
+"The concerned Base document is '%3'.\n"
+"\n"
+"The index = %1"
+msgstr ""
+
#. SF_Dialog creation
#. %1: An identifier
#. %2: A string
@@ -766,7 +822,8 @@ msgstr ""
msgctxt "CONTROLTYPE"
msgid ""
"The control '%1' in dialog '%2' is of type '%3'.\n"
-"The property or method '%4' is not applicable on that type of dialog controls."
+"The property or method '%4' is not applicable on that type of dialog "
+"controls."
msgstr ""
#. SF_DialogControl add line in textbox
@@ -798,4 +855,4 @@ msgid ""
"Check its syntax, table and/or field names, ...\n"
"\n"
"SQL Statement : « %1 »"
-msgstr ""
+msgstr "" \ No newline at end of file